Revert Changes

This commit is contained in:
Tim Bentley 2010-07-09 21:27:18 +01:00
parent b438cb22a5
commit 9d77444ddf
3 changed files with 9 additions and 28 deletions

View File

@ -646,20 +646,13 @@ class Ui_AmendThemeDialog(object):
QtGui.QDialogButtonBox.Ok) QtGui.QDialogButtonBox.Ok)
self.ThemeButtonBox.setObjectName(u'ThemeButtonBox') self.ThemeButtonBox.setObjectName(u'ThemeButtonBox')
self.AmendThemeLayout.addWidget(self.ThemeButtonBox) self.AmendThemeLayout.addWidget(self.ThemeButtonBox)
self.SaveAsButton = QtGui.QPushButton(
translate('AmendThemeForm','Save &as'))
self.SaveAsButton.setCheckable(True)
self.SaveAsButton.setAutoDefault(False)
self.ThemeButtonBox.addButton(self.SaveAsButton,
QtGui.QDialogButtonBox.ActionRole)
self.retranslateUi(AmendThemeDialog) self.retranslateUi(AmendThemeDialog)
self.ThemeTabWidget.setCurrentIndex(0) self.ThemeTabWidget.setCurrentIndex(0)
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.QObject.connect(self.ThemeButtonBox,
QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept) QtCore.SIGNAL(u'accepted()'), AmendThemeDialog.accept)
QtCore.QObject.connect(self.ThemeButtonBox, QtCore.QObject.connect(self.ThemeButtonBox,
QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject) QtCore.SIGNAL(u'rejected()'), AmendThemeDialog.reject)
QtCore.QObject.connect(self.SaveAsButton,
QtCore.SIGNAL(u'clicked()'), AmendThemeDialog.saveAs)
QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog) QtCore.QMetaObject.connectSlotsByName(AmendThemeDialog)
AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit) AmendThemeDialog.setTabOrder(self.ThemeButtonBox, self.ThemeNameEdit)
AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget) AmendThemeDialog.setTabOrder(self.ThemeNameEdit, self.ThemeTabWidget)
@ -855,19 +848,19 @@ class Ui_AmendThemeDialog(object):
translate('AmendThemeForm', 'Alignment')) translate('AmendThemeForm', 'Alignment'))
self.HorizontalLabel.setText( self.HorizontalLabel.setText(
translate('AmendThemeForm', 'Horizontal align:')) translate('AmendThemeForm', 'Horizontal align:'))
self.HorizontalComboBox.setItemText(0, self.HorizontalComboBox.setItemText(0,
translate('AmendThemeForm', 'Left')) translate('AmendThemeForm', 'Left'))
self.HorizontalComboBox.setItemText(1, self.HorizontalComboBox.setItemText(1,
translate('AmendThemeForm', 'Right')) translate('AmendThemeForm', 'Right'))
self.HorizontalComboBox.setItemText(2, self.HorizontalComboBox.setItemText(2,
translate('AmendThemeForm', 'Center')) translate('AmendThemeForm', 'Center'))
self.VerticalLabel.setText( self.VerticalLabel.setText(
translate('AmendThemeForm', 'Vertical align:')) translate('AmendThemeForm', 'Vertical align:'))
self.VerticalComboBox.setItemText(0, self.VerticalComboBox.setItemText(0,
translate('AmendThemeForm', 'Top')) translate('AmendThemeForm', 'Top'))
self.VerticalComboBox.setItemText(1, self.VerticalComboBox.setItemText(1,
translate('AmendThemeForm', 'Middle')) translate('AmendThemeForm', 'Middle'))
self.VerticalComboBox.setItemText(2, self.VerticalComboBox.setItemText(2,
translate('AmendThemeForm', 'Bottom')) translate('AmendThemeForm', 'Bottom'))
self.TransitionGroupBox.setTitle( self.TransitionGroupBox.setTitle(
translate('AmendThemeForm', 'Slide Transition')) translate('AmendThemeForm', 'Slide Transition'))

View File

@ -137,12 +137,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
QtCore.SIGNAL(u'stateChanged(int)'), QtCore.SIGNAL(u'stateChanged(int)'),
self.onSlideTransitionCheckBoxChanged) self.onSlideTransitionCheckBoxChanged)
def saveAs(self):
self.ThemeNameEdit.setEnabled(True)
self.SaveAsButton.setEnabled(False)
self.ThemeNameEdit.setText(u'')
self.ThemeNameEdit.setFocus()
def accept(self): def accept(self):
new_theme = ThemeXML() new_theme = ThemeXML()
theme_name = unicode(self.ThemeNameEdit.text()) theme_name = unicode(self.ThemeNameEdit.text())
@ -206,7 +200,7 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
save_from, save_to) is not False: save_from, save_to) is not False:
return QtGui.QDialog.accept(self) return QtGui.QDialog.accept(self)
def loadTheme(self, theme, newTheme=False): def loadTheme(self, theme):
log.debug(u'LoadTheme %s', theme) log.debug(u'LoadTheme %s', theme)
self.theme = theme self.theme = theme
# Stop the initial screen setup generating 1 preview per field! # Stop the initial screen setup generating 1 preview per field!
@ -214,12 +208,6 @@ class AmendThemeForm(QtGui.QDialog, Ui_AmendThemeDialog):
self.paintUi(self.theme) self.paintUi(self.theme)
self.allowPreview = True self.allowPreview = True
self.previewTheme() self.previewTheme()
self.ThemeNameEdit.setEnabled(True)
self.SaveAsButton.setEnabled(False)
if not newTheme:
self.ThemeNameEdit.setEnabled(False)
self.SaveAsButton.setEnabled(True)
def onImageToolButtonClicked(self): def onImageToolButtonClicked(self):
images_filter = get_images_filter() images_filter = get_images_filter()

View File

@ -173,7 +173,7 @@ class ThemeManager(QtGui.QWidget):
editing form for the user to make their customisations. editing form for the user to make their customisations.
""" """
theme = self.createThemeFromXml(self.baseTheme(), self.path) theme = self.createThemeFromXml(self.baseTheme(), self.path)
self.amendThemeForm.loadTheme(theme, True) self.amendThemeForm.loadTheme(theme)
self.saveThemeName = u'' self.saveThemeName = u''
self.amendThemeForm.exec_() self.amendThemeForm.exec_()