Mercurial > hg > Feedworm
comparison PreferencesDialog.py @ 88:48d1d7bba548
UI for setting the proxy settings
author | Dirk Olmes <dirk@xanthippe.ping.de> |
---|---|
date | Thu, 18 Nov 2010 12:14:41 +0100 |
parents | e8c2730eb444 |
children | c17a224bc251 |
comparison
equal
deleted
inserted
replaced
87:b8bfd1bd6c55 | 88:48d1d7bba548 |
---|---|
9 self.session = session | 9 self.session = session |
10 self.preferences = Preferences(session) | 10 self.preferences = Preferences(session) |
11 self.ui = Ui_Preferences() | 11 self.ui = Ui_Preferences() |
12 self.ui.setupUi(self) | 12 self.ui.setupUi(self) |
13 self.fillUi() | 13 self.fillUi() |
14 | 14 |
15 def fillUi(self): | 15 def fillUi(self): |
16 maximized = self.preferences.startMaximized() | 16 maximized = self.preferences.startMaximized() |
17 self.ui.startMaximized.setChecked(maximized) | 17 self.ui.startMaximized.setChecked(maximized) |
18 | 18 |
19 hideRead = self.preferences.hideReadFeedEntries() | 19 hideRead = self.preferences.hideReadFeedEntries() |
20 self.ui.hideReadFeedEntries.setChecked(hideRead) | 20 self.ui.hideReadFeedEntries.setChecked(hideRead) |
21 | 21 |
22 showOnlyUnreadFeeds = self.preferences.showOnlyUnreadFeeds() | 22 showOnlyUnreadFeeds = self.preferences.showOnlyUnreadFeeds() |
23 self.ui.showOnlyUnreadFeeds.setChecked(showOnlyUnreadFeeds) | 23 self.ui.showOnlyUnreadFeeds.setChecked(showOnlyUnreadFeeds) |
24 | |
25 self.fillProxySettings() | |
26 | |
27 def fillProxySettings(self): | |
28 if self.preferences.isProxyConfigured(): | |
29 self.ui.proxyHost.setText(self.preferences.proxyHost()) | |
30 self.ui.proxyPort.setText(str(self.preferences.proxyPort())) | |
24 | 31 |
25 def startMaximizedChanged(self, change): | 32 def startMaximizedChanged(self, change): |
26 if change: | 33 if change: |
27 self.preferences.setStartMaximized(True) | 34 self.preferences.setStartMaximized(True) |
28 else: | 35 else: |
38 if change: | 45 if change: |
39 self.preferences.setShowOnlyUnreadFeeds(True) | 46 self.preferences.setShowOnlyUnreadFeeds(True) |
40 else: | 47 else: |
41 self.preferences.setShowOnlyUnreadFeeds(False) | 48 self.preferences.setShowOnlyUnreadFeeds(False) |
42 | 49 |
50 def storeProxySettings(self): | |
51 proxyHost = str(self.ui.proxyHost.text()) | |
52 self.preferences.setProxyHost(proxyHost) | |
53 | |
54 proxyPort = int(self.ui.proxyPort.text()) | |
55 self.preferences.setProxyPort(proxyPort) | |
56 | |
43 def accept(self): | 57 def accept(self): |
58 self.storeProxySettings() | |
44 self.session.commit() | 59 self.session.commit() |
45 QtGui.QDialog.accept(self) | 60 QtGui.QDialog.accept(self) |
46 | 61 |
47 def reject(self): | 62 def reject(self): |
48 self.session.rollback() | 63 self.session.rollback() |
49 QtGui.QDialog.reject(self) | 64 QtGui.QDialog.reject(self) |
50 | 65 |
51 |