eric6/Helpviewer/Sync/SyncHostTypePage.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 host type wizard page.
8 """
9
10 from __future__ import unicode_literals
11
12 from PyQt5.QtWidgets import QWizardPage
13
14 from . import SyncGlobals
15
16 from .Ui_SyncHostTypePage import Ui_SyncHostTypePage
17
18 import Preferences
19
20
21 class SyncHostTypePage(QWizardPage, Ui_SyncHostTypePage):
22 """
23 Class implementing the synchronization host type wizard page.
24 """
25 def __init__(self, parent=None):
26 """
27 Constructor
28
29 @param parent reference to the parent widget (QWidget)
30 """
31 super(SyncHostTypePage, self).__init__(parent)
32 self.setupUi(self)
33
34 if Preferences.getHelp("SyncType") == SyncGlobals.SyncTypeFtp:
35 self.ftpRadioButton.setChecked(True)
36 elif Preferences.getHelp("SyncType") == SyncGlobals.SyncTypeDirectory:
37 self.directoryRadioButton.setChecked(True)
38 else:
39 self.noneRadioButton.setChecked(True)
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 if self.ftpRadioButton.isChecked():
49 Preferences.setHelp("SyncType", SyncGlobals.SyncTypeFtp)
50 return SyncGlobals.PageFTPSettings
51 elif self.directoryRadioButton.isChecked():
52 Preferences.setHelp("SyncType", SyncGlobals.SyncTypeDirectory)
53 return SyncGlobals.PageDirectorySettings
54 else:
55 Preferences.setHelp("SyncType", SyncGlobals.SyncTypeNone)
56 return SyncGlobals.PageCheck

eric ide

mercurial