# HG changeset patch # User Dirk Olmes # Date 1273813502 -7200 # Node ID c858aab71e5b0d437ba071793b10d76756b25137 # Parent 0c2578196643201d4b8e3e521d5c27f0fb7759ad add preferences dialog diff -r 0c2578196643 -r c858aab71e5b MainWindow.py --- a/MainWindow.py Fri May 14 06:48:48 2010 +0200 +++ b/MainWindow.py Fri May 14 07:05:02 2010 +0200 @@ -3,6 +3,7 @@ from DisplayModel import DisplayModel from Feed import Feed from FeedEntry import FeedEntry +from Preferences import Preferences from PyQt4 import QtGui from PyQt4.QtCore import QUrl from PyQt4.QtGui import QFont @@ -66,6 +67,11 @@ url = QUrl(self.selectedEntry.link) self.ui.webView.load(url) self.ui.webView.show() + + def showPreferences(self): + preferences = Preferences(self.session) + preferences.exec_() + class FeedEntryItemDelegate(QtGui.QStyledItemDelegate): def __init__(self): diff -r 0c2578196643 -r c858aab71e5b Preferences.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Preferences.py Fri May 14 07:05:02 2010 +0200 @@ -0,0 +1,13 @@ + +from PyQt4 import QtGui +from Ui_Preferences import Ui_Preferences + +class Preferences(QtGui.QDialog): + def __init__(self, session=None): + QtGui.QWidget.__init__(self, None) + self.session = session + self.ui = Ui_Preferences() + self.ui.setupUi(self) + + def startMaximizedChanged(self, change): + print("start maximized: " + str(change)) diff -r 0c2578196643 -r c858aab71e5b Ui_MainWindow.ui --- a/Ui_MainWindow.ui Fri May 14 06:48:48 2010 +0200 +++ b/Ui_MainWindow.ui Fri May 14 07:05:02 2010 +0200 @@ -15,7 +15,7 @@ - worm.pngworm.png + ../../../.designer/backup/worm.png../../../.designer/backup/worm.png @@ -136,11 +136,14 @@ - false + true Preferences + + Ctrl+. + @@ -272,6 +275,22 @@ + + actionPreferences + activated() + MainWindow + showPreferences() + + + -1 + -1 + + + 495 + 374 + + + addFeed() @@ -280,5 +299,6 @@ toggleReadOnSelectedEntry() openSelectedEntryInBrowser() openLinkFromSelectedEntry() + showPreferences() diff -r 0c2578196643 -r c858aab71e5b Ui_Preferences.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Ui_Preferences.ui Fri May 14 07:05:02 2010 +0200 @@ -0,0 +1,104 @@ + + + Preferences + + + + 0 + 0 + 400 + 300 + + + + Preferences + + + + worm.pngworm.png + + + + + 30 + 240 + 341 + 32 + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + 10 + 10 + 141 + 22 + + + + Start maximized + + + + + + + buttonBox + accepted() + Preferences + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + Preferences + reject() + + + 316 + 260 + + + 286 + 274 + + + + + startMaximized + stateChanged(int) + Preferences + startMaximizedChanged() + + + 80 + 20 + + + 199 + 149 + + + + + + startMaximizedChanged() + +