コード例 #1
0
    def __Get_sIBL_GUI_pushButton__clicked(self, checked):
        """
		Defines the slot triggered by **Get_sIBL_GUI_pushButton** Widget when clicked.

		:param checked: Checked state.
		:type checked: bool
		"""
        urlTokens = self.releases[Constants.applicationName].url.split(
            self.__splitter)
        builds = dict(((urlTokens[i].strip(), urlTokens[i + 1].strip(" \""))
                       for i in range(0, len(urlTokens), 2)))

        if platform.system() == "Windows" or platform.system() == "Microsoft":
            url = builds["Windows"]
        elif platform.system() == "Darwin":
            url = builds["Mac Os X"]
        elif platform.system() == "Linux":
            url = builds["Linux"]

        self.__downloadManager = DownloadManager(self,
                                                 self.__networkAccessManager,
                                                 self.__container.ioDirectory,
                                                 [url], Qt.Window)
        self.__downloadManager.downloadFinished.connect(
            self.__downloadManager__finished)
        self.__downloadManager.show()
        self.__downloadManager.startDownload()
コード例 #2
0
    def __Get_Latest_Templates_pushButton__clicked(self, checked):
        """
		Defines the slot triggered by **Get_Latest_Templates_pushButton** Widget when clicked.

		:param checked: Checked state.
		:type checked: bool
		"""

        requests = []
        for row in range(self.__view.rowCount()):
            if self.__view.cellWidget(row, 1).state:
                requests.append(self.__view.item(row, 0).data)

        if not requests:
            return

        downloadDirectory = self.__getTemplatesDownloadDirectory()
        if not downloadDirectory:
            return

        if not foundations.io.isWritable(downloadDirectory):
            self.__container.engine.notificationsManager.exceptify(
                "{0} | '{1}' directory is not writable".format(
                    self.__class__.__name__, downloadDirectory))
            return

        LOGGER.debug(
            "> Templates download directory: '{0}'.".format(downloadDirectory))
        self.__downloadManager = DownloadManager(
            self, self.__networkAccessManager, downloadDirectory,
            [request.url for request in requests], Qt.Window)
        self.__downloadManager.downloadFinished.connect(
            self.__downloadManager__finished)
        self.__downloadManager.show()
        self.__downloadManager.startDownload()
コード例 #3
0
    def __Get_Latest_Templates_pushButton__clicked(self, checked):
        """
		This method is triggered when **Get_Latest_Templates_pushButton** Widget is clicked.

		:param checked: Checked state. ( Boolean )
		"""

        requests = []
        for row in range(self.__view.rowCount()):
            if self.__view.cellWidget(row, 1).state:
                requests.append(self.__view.item(row, 0).data)

        if not requests:
            return

        downloadDirectory = self.__getTemplatesDownloadDirectory()
        if not downloadDirectory:
            return

        LOGGER.debug(
            "> Templates download directory: '{0}'.".format(downloadDirectory))
        self.__downloadManager = DownloadManager(
            self, self.__networkAccessManager, downloadDirectory,
            [request.url for request in requests], Qt.Window)
        self.__downloadManager.downloadFinished.connect(
            self.__downloadManager__finished)
        self.__downloadManager.show()
        self.__downloadManager.startDownload()