eric7/WebBrowser/Sync/SyncCheckPage.py

Sat, 22 May 2021 18:51:46 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 22 May 2021 18:51:46 +0200
branch
eric7
changeset 8356
68ec9c3d4de5
parent 8318
962bce857696
child 8881
54e42bc2437a
permissions
-rw-r--r--

Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.

1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
1 # -*- coding: utf-8 -*-
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
2
7923
91e843545d9a Updated copyright for 2021.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7533
diff changeset
3 # Copyright (c) 2012 - 2021 Detlev Offenbach <detlev@die-offenbachs.de>
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
4 #
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
5
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
6 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
7 Module implementing the synchronization status wizard page.
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
8 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
9
8318
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
10 from PyQt6.QtCore import QTimer
962bce857696 Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8312
diff changeset
11 from PyQt6.QtWidgets import QWizardPage
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
12
1695
7b115f986d48 Added capability to synchronize bookmarks, history, passwords and user agent settings via a shared directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1680
diff changeset
13 from . import SyncGlobals
7b115f986d48 Added capability to synchronize bookmarks, history, passwords and user agent settings via a shared directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1680
diff changeset
14
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
15 from .Ui_SyncCheckPage import Ui_SyncCheckPage
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
16
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
17 import Preferences
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
18 import UI.PixmapCache
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
19
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
20
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
21 class SyncCheckPage(QWizardPage, Ui_SyncCheckPage):
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
22 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
23 Class implementing the synchronization status wizard page.
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
24 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
25 def __init__(self, parent=None):
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
26 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
27 Constructor
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
28
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
29 @param parent reference to the parent widget (QWidget)
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
30 """
8218
7c09585bd960 Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7923
diff changeset
31 super().__init__(parent)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
32 self.setupUi(self)
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
33
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
34 def initializePage(self):
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
35 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
36 Public method to initialize the page.
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
37 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
38 self.syncErrorLabel.hide()
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
39
1680
28e57079dab5 Added capability to encrypt the synchronized data (web browser).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1673
diff changeset
40 forceUpload = self.field("ReencryptData")
28e57079dab5 Added capability to encrypt the synchronized data (web browser).
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1673
diff changeset
41
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
42 from WebBrowser.WebBrowserWindow import WebBrowserWindow
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
43 syncMgr = WebBrowserWindow.syncManager()
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
44 syncMgr.syncError.connect(self.__syncError)
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
45 syncMgr.syncStatus.connect(self.__updateMessages)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
46 syncMgr.syncFinished.connect(self.__updateLabels)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
47
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
48 if Preferences.getWebBrowser("SyncType") == SyncGlobals.SyncTypeFtp:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
49 self.handlerLabel.setText(self.tr("FTP"))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
50 self.infoLabel.setText(self.tr("Host:"))
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
51 self.infoDataLabel.setText(
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
52 Preferences.getWebBrowser("SyncFtpServer"))
7269
0c63ea7f94bd Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
53 elif (
0c63ea7f94bd Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
54 Preferences.getWebBrowser("SyncType") ==
0c63ea7f94bd Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
55 SyncGlobals.SyncTypeDirectory
0c63ea7f94bd Continued to resolve code style issue M841.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7229
diff changeset
56 ):
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
57 self.handlerLabel.setText(self.tr("Shared Directory"))
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
58 self.infoLabel.setText(self.tr("Directory:"))
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
59 self.infoDataLabel.setText(
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
60 Preferences.getWebBrowser("SyncDirectoryPath"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
61 else:
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
62 self.handlerLabel.setText(self.tr("No Synchronization"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
63 self.hostLabel.setText("")
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
64
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
65 self.bookmarkMsgLabel.setText("")
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
66 self.historyMsgLabel.setText("")
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
67 self.passwordsMsgLabel.setText("")
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
68 self.userAgentsMsgLabel.setText("")
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
69 self.speedDialMsgLabel.setText("")
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
70
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
71 if not syncMgr.syncEnabled():
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
72 self.bookmarkLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
73 UI.PixmapCache.getPixmap("syncNo"))
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
74 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo"))
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
75 self.passwordsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
76 UI.PixmapCache.getPixmap("syncNo"))
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
77 self.userAgentsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
78 UI.PixmapCache.getPixmap("syncNo"))
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
79 self.speedDialLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
80 UI.PixmapCache.getPixmap("syncNo"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
81 return
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
82
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
83 # bookmarks
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
84 if Preferences.getWebBrowser("SyncBookmarks"):
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
85 self.__makeAnimatedLabel("loadingAnimation", self.bookmarkLabel)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
86 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
87 self.bookmarkLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
88 UI.PixmapCache.getPixmap("syncNo"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
89
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
90 # history
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
91 if Preferences.getWebBrowser("SyncHistory"):
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
92 self.__makeAnimatedLabel("loadingAnimation", self.historyLabel)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
93 else:
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
94 self.historyLabel.setPixmap(UI.PixmapCache.getPixmap("syncNo"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
95
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
96 # Passwords
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
97 if Preferences.getWebBrowser("SyncPasswords"):
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
98 self.__makeAnimatedLabel("loadingAnimation", self.passwordsLabel)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
99 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
100 self.passwordsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
101 UI.PixmapCache.getPixmap("syncNo"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
102
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
103 # user agent settings
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
104 if Preferences.getWebBrowser("SyncUserAgents"):
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
105 self.__makeAnimatedLabel("loadingAnimation", self.userAgentsLabel)
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
106 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
107 self.userAgentsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
108 UI.PixmapCache.getPixmap("syncNo"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
109
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
110 # speed dial settings
4774
2c6ffa778c3b Continued porting the web browser.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 4631
diff changeset
111 if Preferences.getWebBrowser("SyncSpeedDial"):
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
112 self.__makeAnimatedLabel("loadingAnimation", self.speedDialLabel)
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
113 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
114 self.speedDialLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
115 UI.PixmapCache.getPixmap("syncNo"))
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
116
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
117 QTimer.singleShot(
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
118 0, lambda: syncMgr.loadSettings(forceUpload=forceUpload))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
119
1673
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
120 def __makeAnimatedLabel(self, fileName, label):
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
121 """
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
122 Private slot to create an animated label.
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
123
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
124 @param fileName name of the file containing the animation
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
125 @type str
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
126 @param label reference to the label to be animated
8356
68ec9c3d4de5 Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 8318
diff changeset
127 @type EricAnimatedLabel
1673
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
128 """
7514
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
129 label.setInterval(40)
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
130 label.setAnimationFile(fileName)
0960c7c1f497 Added a label widget showing an animated pixmap.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7360
diff changeset
131 label.start()
1673
06eeffc8c97d Fine tuned the label animations.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1626
diff changeset
132
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
133 def __updateMessages(self, type_, msg):
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
134 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
135 Private slot to update the synchronization status info.
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
136
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
137 @param type_ type of synchronization data (string)
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
138 @param msg synchronization message (string)
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
139 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
140 if type_ == "bookmarks":
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
141 self.bookmarkMsgLabel.setText(msg)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
142 elif type_ == "history":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
143 self.historyMsgLabel.setText(msg)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
144 elif type_ == "passwords":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
145 self.passwordsMsgLabel.setText(msg)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
146 elif type_ == "useragents":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
147 self.userAgentsMsgLabel.setText(msg)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
148 elif type_ == "speeddial":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
149 self.speedDialMsgLabel.setText(msg)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
150
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
151 def __updateLabels(self, type_, status, download):
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
152 """
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
153 Private slot to handle a finished synchronization event.
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
154
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
155 @param type_ type of the synchronization event (string one
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
156 of "bookmarks", "history", "passwords", "useragents" or
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
157 "speeddial")
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
158 @param status flag indicating success (boolean)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
159 @param download flag indicating a download of a file (boolean)
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
160 """
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
161 if type_ == "bookmarks":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
162 if status:
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
163 self.bookmarkLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
164 UI.PixmapCache.getPixmap("syncCompleted"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
165 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
166 self.bookmarkLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
167 UI.PixmapCache.getPixmap("syncFailed"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
168 elif type_ == "history":
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
169 if status:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
170 self.historyLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
171 UI.PixmapCache.getPixmap("syncCompleted"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
172 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
173 self.historyLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
174 UI.PixmapCache.getPixmap("syncFailed"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
175 elif type_ == "passwords":
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
176 if status:
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
177 self.passwordsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
178 UI.PixmapCache.getPixmap("syncCompleted"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
179 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
180 self.passwordsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
181 UI.PixmapCache.getPixmap("syncFailed"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
182 elif type_ == "useragents":
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
183 if status:
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
184 self.userAgentsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
185 UI.PixmapCache.getPixmap("syncCompleted"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
186 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
187 self.userAgentsLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
188 UI.PixmapCache.getPixmap("syncFailed"))
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
189 elif type_ == "speeddial":
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
190 if status:
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
191 self.speedDialLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
192 UI.PixmapCache.getPixmap("syncCompleted"))
1700
40c911b8c0dd Made the speed dial settings synchronizable via the sync manager.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 1695
diff changeset
193 else:
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
194 self.speedDialLabel.setPixmap(
7533
88261c96484b Removed the '.png' extension from all call to get an icon or a pixmap from the PixmapCache because this is not needed anymore.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 7514
diff changeset
195 UI.PixmapCache.getPixmap("syncFailed"))
1626
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
196
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
197 def __syncError(self, message):
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
198 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
199 Private slot to handle general synchronization issues.
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
200
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
201 @param message error message (string)
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
202 """
a77c8ea8582c Added capability to synchronise bookmarks, history, passwords and user agent settings via an FTP server.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff changeset
203 self.syncErrorLabel.show()
3190
a9a94491c4fd Changed the code to use QObject.tr() instead of QObject.trUtf8().
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 3160
diff changeset
204 self.syncErrorLabel.setText(self.tr(
3002
6ffc581f00f1 Continued to shorten the code lines to max. 79 characters.
Detlev Offenbach <detlev@die-offenbachs.de>
parents: 2403
diff changeset
205 '<font color="#FF0000"><b>Error:</b> {0}</font>').format(message))

eric ide

mercurial