From e401667e1312e9f96054b527c2623b5fa9ac8e1c Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Tue, 3 May 2011 21:24:11 -0700 Subject: [PATCH] Move theme selection into options menu --- menus.py | 17 ++++++++++++++++- pesterchum.py | 10 +++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/menus.py b/menus.py index c918bcd..d819a94 100644 --- a/menus.py +++ b/menus.py @@ -621,7 +621,7 @@ class PesterOptions(QtGui.QDialog): self.tabs = QtGui.QButtonGroup(self) self.connect(self.tabs, QtCore.SIGNAL('buttonClicked(int)'), self, QtCore.SLOT('changePage(int)')) - tabNames = ["Chum List", "Conversations", "Sound", "Logging", "Idle"] + tabNames = ["Chum List", "Conversations", "Sound", "Logging", "Idle", "Theme"] for t in tabNames: button = QtGui.QPushButton(t) self.tabs.addButton(button) @@ -703,6 +703,13 @@ class PesterOptions(QtGui.QDialog): layout_5.addWidget(QtGui.QLabel("Minutes before Idle:")) layout_5.addWidget(self.idleBox) + avail_themes = self.config.availableThemes() + self.themeBox = QtGui.QComboBox(self) + for (i, t) in enumerate(avail_themes): + self.themeBox.addItem(t) + if t == theme.name: + self.themeBox.setCurrentIndex(i) + self.ok = QtGui.QPushButton("OK", self) self.ok.setDefault(True) self.connect(self.ok, QtCore.SIGNAL('clicked()'), @@ -767,6 +774,14 @@ class PesterOptions(QtGui.QDialog): layout_idle.addLayout(layout_5) self.pages.addWidget(widget) + # Theme + widget = QtGui.QWidget() + layout_theme = QtGui.QVBoxLayout(widget) + layout_theme.setAlignment(QtCore.Qt.AlignTop) + layout_theme.addWidget(QtGui.QLabel("Pick a Theme:")) + layout_theme.addWidget(self.themeBox) + self.pages.addWidget(widget) + layout_0 = QtGui.QVBoxLayout() layout_1 = QtGui.QHBoxLayout() layout_1.addLayout(layout_4) diff --git a/pesterchum.py b/pesterchum.py index 4565f1a..bd5b88c 100644 --- a/pesterchum.py +++ b/pesterchum.py @@ -1356,10 +1356,6 @@ class PesterWindow(MovingWindow): filemenu.addAction(self.reconnectAction) filemenu.addAction(exitaction) - changetheme = QtGui.QAction(self.theme["main/menus/profile/theme"], self) - self.changetheme = changetheme - self.connect(changetheme, QtCore.SIGNAL('triggered()'), - self, QtCore.SLOT('pickTheme()')) changequirks = QtGui.QAction(self.theme["main/menus/profile/quirks"], self) self.changequirks = changequirks self.connect(changequirks, QtCore.SIGNAL('triggered()'), @@ -1381,7 +1377,6 @@ class PesterWindow(MovingWindow): profilemenu = self.menu.addMenu(self.theme["main/menus/profile/_name"]) self.profilemenu = profilemenu - profilemenu.addAction(changetheme) profilemenu.addAction(changequirks) profilemenu.addAction(loadslum) profilemenu.addAction(changecoloraction) @@ -1672,7 +1667,6 @@ class PesterWindow(MovingWindow): self.idleaction.setText(theme["main/menus/client/idle"]) self.reconnectAction.setText(theme["main/menus/client/reconnect"]) self.filemenu.setTitle(theme["main/menus/client/_name"]) - self.changetheme.setText(theme["main/menus/profile/theme"]) self.changequirks.setText(theme["main/menus/profile/quirks"]) self.loadslum.setText(theme["main/menus/profile/block"]) self.changecoloraction.setText(theme["main/menus/profile/color"]) @@ -2331,11 +2325,13 @@ class PesterWindow(MovingWindow): if idlesetting != curidle: self.config.set('idleTime', idlesetting) self.idlethreshold = 60*idlesetting + # theme + self.themeSelected() self.optionmenu = None @QtCore.pyqtSlot() def themeSelected(self): - themename = unicode(self.choosetheme.themeBox.currentText()) + themename = unicode(self.optionmenu.themeBox.currentText()) if themename != self.theme.name: try: self.changeTheme(pesterTheme(themename))