|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 # Copyright (c) 2012 Detlev Offenbach <detlev@die-offenbachs.de> |
|
4 # |
|
5 |
|
6 """ |
|
7 Module implementing the synchronization data wizard page. |
|
8 """ |
|
9 |
|
10 from PyQt4.QtGui import QWizardPage |
|
11 |
|
12 from . import SyncGlobals |
|
13 |
|
14 from .Ui_SyncDataPage import Ui_SyncDataPage |
|
15 |
|
16 import Preferences |
|
17 |
|
18 |
|
19 class SyncDataPage(QWizardPage, Ui_SyncDataPage): |
|
20 """ |
|
21 Class implementing the synchronization data wizard page. |
|
22 """ |
|
23 def __init__(self, parent=None): |
|
24 """ |
|
25 Constructor |
|
26 |
|
27 @param parent reference to the parent widget (QWidget) |
|
28 """ |
|
29 super().__init__(parent) |
|
30 self.setupUi(self) |
|
31 |
|
32 self.bookmarksCheckBox.setChecked(Preferences.getHelp("SyncBookmarks")) |
|
33 self.historyCheckBox.setChecked(Preferences.getHelp("SyncHistory")) |
|
34 self.passwordsCheckBox.setChecked(Preferences.getHelp("SyncPasswords")) |
|
35 self.userAgentsCheckBox.setChecked(Preferences.getHelp("SyncUserAgents")) |
|
36 |
|
37 self.activeCheckBox.setChecked(Preferences.getHelp("SyncEnabled")) |
|
38 |
|
39 def nextId(self): |
|
40 """ |
|
41 Public method returning the ID of the next wizard page. |
|
42 |
|
43 @return next wizard page ID (integer) |
|
44 """ |
|
45 # save the settings |
|
46 Preferences.setHelp("SyncEnabled", self.activeCheckBox.isChecked()) |
|
47 |
|
48 Preferences.setHelp("SyncBookmarks", self.bookmarksCheckBox.isChecked()) |
|
49 Preferences.setHelp("SyncHistory", self.historyCheckBox.isChecked()) |
|
50 Preferences.setHelp("SyncPasswords", self.passwordsCheckBox.isChecked()) |
|
51 Preferences.setHelp("SyncUserAgents", self.userAgentsCheckBox.isChecked()) |
|
52 |
|
53 if self.activeCheckBox.isChecked(): |
|
54 return SyncGlobals.PageType |
|
55 else: |
|
56 return SyncGlobals.PageCheck |