More cleanups

This commit is contained in:
Tim Bentley 2011-04-13 19:40:09 +01:00
parent 0b4fd3c585
commit 79ed96648f
2 changed files with 8 additions and 10 deletions

View File

@ -35,20 +35,20 @@ class Ui_SettingsDialog(object):
settingsDialog.resize(800, 500) settingsDialog.resize(800, 500)
settingsDialog.setWindowIcon( settingsDialog.setWindowIcon(
build_icon(u':/system/system_settings.png')) build_icon(u':/system/system_settings.png'))
self.settingsLayout = QtGui.QGridLayout(settingsDialog) self.dialogLayout = QtGui.QGridLayout(settingsDialog)
self.settingsLayout.setObjectName(u'settingsLayout') self.dialogLayout.setObjectName(u'dialogLayout')
self.settingsLayout.setMargin(0) self.dialogLayout.setMargin(0)
self.settingListWidget = QtGui.QListWidget(settingsDialog) self.settingListWidget = QtGui.QListWidget(settingsDialog)
self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0)) self.settingListWidget.setMinimumSize(QtCore.QSize(150, 0))
self.settingListWidget.setHorizontalScrollBarPolicy( self.settingListWidget.setHorizontalScrollBarPolicy(
QtCore.Qt.ScrollBarAlwaysOff) QtCore.Qt.ScrollBarAlwaysOff)
self.settingListWidget.setObjectName(u'settingListWidget') self.settingListWidget.setObjectName(u'settingListWidget')
self.settingsLayout.addWidget(self.settingListWidget, 0, 0, 1, 1) self.dialogLayout.addWidget(self.settingListWidget, 0, 0, 1, 1)
self.stackedLayout = QtGui.QStackedLayout() self.stackedLayout = QtGui.QStackedLayout()
self.stackedLayout.setObjectName(u'stackedLayout') self.stackedLayout.setObjectName(u'stackedLayout')
self.settingsLayout.addLayout(self.stackedLayout, 0, 1, 1, 1) self.dialogLayout.addLayout(self.stackedLayout, 0, 1, 1, 1)
self.buttonBox = create_accept_reject_button_box(settingsDialog, True) self.buttonBox = create_accept_reject_button_box(settingsDialog, True)
self.settingsLayout.addWidget(self.buttonBox, 1, 1, 1, 1) self.dialogLayout.addWidget(self.buttonBox, 1, 1, 1, 1)
self.retranslateUi(settingsDialog) self.retranslateUi(settingsDialog)
QtCore.QMetaObject.connectSlotsByName(settingsDialog) QtCore.QMetaObject.connectSlotsByName(settingsDialog)
QtCore.QObject.connect(self.settingListWidget, QtCore.QObject.connect(self.settingListWidget,

View File

@ -60,9 +60,9 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
# load all the settings # load all the settings
for tabIndex in range(0, self.stackedLayout.count()): for tabIndex in range(0, self.stackedLayout.count()):
self.stackedLayout.widget(tabIndex).load() self.stackedLayout.widget(tabIndex).load()
self.settingListWidget.setCurrentRow(0)
return QtGui.QDialog.exec_(self) return QtGui.QDialog.exec_(self)
def insertTab(self, tab, location): def insertTab(self, tab, location):
""" """
Add a tab to the form at a specific location Add a tab to the form at a specific location
@ -78,13 +78,11 @@ class SettingsForm(QtGui.QDialog, Ui_SettingsDialog):
match = True match = True
break break
if not match: if not match:
self.stackedLayout.addWidget(tab) pos = self.stackedLayout.addWidget(tab)
item_name = QtGui.QListWidgetItem(tab.tabTitleVisible) item_name = QtGui.QListWidgetItem(tab.tabTitleVisible)
icon = build_icon(tab.icon_path) icon = build_icon(tab.icon_path)
item_name.setIcon(icon) item_name.setIcon(icon)
self.settingListWidget.insertItem(14 + location, item_name) self.settingListWidget.insertItem(14 + location, item_name)
self.stackedLayout.addWidget(tab)
self.stackedLayout.setCurrentIndex(0)
def removeTab(self, tab): def removeTab(self, tab):
""" """