eric6/Helpviewer/Sync/SyncDataPage.py

branch
maintenance
changeset 7286
7eb04391adf7
parent 7226
babe80d84a3e
parent 7285
1ff497f33f31
child 7287
1c17f2191bdd
equal deleted inserted replaced
7226:babe80d84a3e 7286:7eb04391adf7
1 # -*- coding: utf-8 -*-
2
3 # Copyright (c) 2012 - 2019 Detlev Offenbach <detlev@die-offenbachs.de>
4 #
5
6 """
7 Module implementing the synchronization data wizard page.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QWizardPage
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(SyncDataPage, self).__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(
36 Preferences.getHelp("SyncUserAgents"))
37 self.speedDialCheckBox.setChecked(Preferences.getHelp("SyncSpeedDial"))
38
39 self.activeCheckBox.setChecked(Preferences.getHelp("SyncEnabled"))
40
41 def nextId(self):
42 """
43 Public method returning the ID of the next wizard page.
44
45 @return next wizard page ID (integer)
46 """
47 # save the settings
48 Preferences.setHelp("SyncEnabled", self.activeCheckBox.isChecked())
49
50 Preferences.setHelp(
51 "SyncBookmarks", self.bookmarksCheckBox.isChecked())
52 Preferences.setHelp(
53 "SyncHistory", self.historyCheckBox.isChecked())
54 Preferences.setHelp(
55 "SyncPasswords", self.passwordsCheckBox.isChecked())
56 Preferences.setHelp(
57 "SyncUserAgents", self.userAgentsCheckBox.isChecked())
58 Preferences.setHelp(
59 "SyncSpeedDial", self.speedDialCheckBox.isChecked())
60
61 from . import SyncGlobals
62 if self.activeCheckBox.isChecked():
63 return SyncGlobals.PageEncryption
64 else:
65 return SyncGlobals.PageCheck

eric ide

mercurial