12 import os |
12 import os |
13 import zipfile |
13 import zipfile |
14 |
14 |
15 from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QFile, QIODevice, QUrl, QProcess |
15 from PyQt4.QtCore import pyqtSignal, pyqtSlot, Qt, QFile, QIODevice, QUrl, QProcess |
16 from PyQt4.QtGui import QWidget, QDialogButtonBox, QAbstractButton, QTreeWidgetItem, \ |
16 from PyQt4.QtGui import QWidget, QDialogButtonBox, QAbstractButton, QTreeWidgetItem, \ |
17 QDialog, QVBoxLayout, QMainWindow |
17 QDialog, QVBoxLayout |
18 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply |
18 from PyQt4.QtNetwork import QNetworkAccessManager, QNetworkRequest, QNetworkReply |
19 try: |
19 try: |
20 from PyQt4.QtNetwork import QSslError # __IGNORE_EXCEPTION__ __IGNORE_WARNING__ |
20 from PyQt4.QtNetwork import QSslError # __IGNORE_EXCEPTION__ __IGNORE_WARNING__ |
21 SSL_AVAILABLE = True |
21 SSL_AVAILABLE = True |
22 except ImportError: |
22 except ImportError: |
23 SSL_AVAILABLE = False |
23 SSL_AVAILABLE = False |
24 |
24 |
25 from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog |
25 from .Ui_PluginRepositoryDialog import Ui_PluginRepositoryDialog |
26 |
26 |
27 from E5Gui import E5MessageBox |
27 from E5Gui import E5MessageBox |
|
28 from E5Gui.E5MainWindow import E5MainWindow |
28 |
29 |
29 from E5XML.PluginRepositoryReader import PluginRepositoryReader |
30 from E5XML.PluginRepositoryReader import PluginRepositoryReader |
30 |
31 |
31 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired |
32 from E5Network.E5NetworkProxyFactory import proxyAuthenticationRequired |
32 |
33 |
567 @return list of plugin filenames (list of strings) |
568 @return list of plugin filenames (list of strings) |
568 """ |
569 """ |
569 return self.cw.getDownloadedPlugins() |
570 return self.cw.getDownloadedPlugins() |
570 |
571 |
571 |
572 |
572 class PluginRepositoryWindow(QMainWindow): |
573 class PluginRepositoryWindow(E5MainWindow): |
573 """ |
574 """ |
574 Main window class for the standalone dialog. |
575 Main window class for the standalone dialog. |
575 """ |
576 """ |
576 def __init__(self, parent=None): |
577 def __init__(self, parent=None): |
577 """ |
578 """ |
582 super().__init__(parent) |
583 super().__init__(parent) |
583 self.cw = PluginRepositoryWidget(self) |
584 self.cw = PluginRepositoryWidget(self) |
584 size = self.cw.size() |
585 size = self.cw.size() |
585 self.setCentralWidget(self.cw) |
586 self.setCentralWidget(self.cw) |
586 self.resize(size) |
587 self.resize(size) |
|
588 |
|
589 self.setStyle(Preferences.getUI("Style"), Preferences.getUI("StyleSheet")) |
587 |
590 |
588 self.cw.buttonBox.accepted[()].connect(self.close) |
591 self.cw.buttonBox.accepted[()].connect(self.close) |
589 self.cw.buttonBox.rejected[()].connect(self.close) |
592 self.cw.buttonBox.rejected[()].connect(self.close) |
590 self.cw.closeAndInstall.connect(self.__startPluginInstall) |
593 self.cw.closeAndInstall.connect(self.__startPluginInstall) |
591 |
594 |