Esempio n. 1
0
    def checkForUpdate(self):
        updAsset = assetManager().getSelfUpdaterAsset()
        if updAsset:
            listUpdater = assetManager().getAssetListUpdater()
            if not listUpdater.isRunning():
                listUpdater.run()

            if listUpdater.isRunning():
                with BusyDlg(self, _('Checking for update...')) as dlg:
                    dlg.ShowModalWhile(listUpdater.isRunning)
            return updAsset
Esempio n. 2
0
 def updateAssetList(self):
     listUpdater = assetManager().getAssetListUpdater()
     if not listUpdater.isRunning() and not listUpdater.isUpdated():
         pr.println(2, '[+] updating assets list')
         listUpdater.run()
         listUpdater.wait()
     return listUpdater.isUpdated()
Esempio n. 3
0
    def __init__(self, parent, task=None):
        super().__init__(parent)

        img.setWinIcon(self)
        self.m_buttonMenu.SetLabel(u'\u22ee')  # 2630
        self.m_panelMain.GetSizer().SetSizeHints(self)

        self.m_buttonMaxDistInfo.message = descriptions.maxDistInfo

        if config.assetupd == None:
            self.m_menu.Remove(self.m_menuItemCheckUpdate.GetId())

        if task:
            self.m_panelSub.setStream(task.sub)
            self.m_panelRef.setStream(task.ref)

        self.m_sliderMaxDist.SetValue(settings().windowSize / 60.0)
        self.onSliderMaxDistScroll(None)

        self.Fit()
        self.Layout()

        # allow only to resize horizontally
        size = self.GetSize()
        self.SetSizeHints(minW=size.GetWidth(),
                          minH=size.GetHeight(),
                          maxH=size.GetHeight())

        listUpdater = assetManager().getAssetListUpdater(
            autoUpdate=settings().autoUpdate)
        if not listUpdater.isUpdated() and not listUpdater.isRunning():
            listUpdater.run()
Esempio n. 4
0
    def run(self, tasks):
        assets = assetManager().getAssetsForTasks(tasks)

        if assets.notInstalled():
            self.printMissingAssets(assets.notInstalled())
            return False
        else:
            return True
Esempio n. 5
0
    def run(self, tasks):
        self.updateAssetList()
        assets = assetManager().getAssetsForTasks(tasks)

        if assets.missing():
            self.printMissingAssets(assets.missing())
            return False

        return self.installAssets(assets.hasUpdate())
Esempio n. 6
0
def updateAssetList(parent):
    listUpdater = assetManager().getAssetListUpdater()
    if not listUpdater.isRunning() and not listUpdater.isUpdated():
        listUpdater.run()

    if listUpdater.isRunning():
        with BusyDlg(parent, _('Downloading assets list...')) as dlg:
            dlg.ShowModalWhile(listUpdater.isRunning)

    return listUpdater.isUpdated()
Esempio n. 7
0
    def installUpdate(self):
        updAsset = assetManager().getSelfUpdaterAsset()
        if updAsset and updAsset.hasUpdate():
            dlg = wx.MessageDialog(
                self, _('New version is available. Update now?'), _('Upgrade'),
                wx.YES_NO | wx.YES_DEFAULT | wx.ICON_QUESTION)
            if dlg.ShowModal() == wx.ID_YES:

                if not updAsset.hasInstaller():
                    DownloadWin(self, updAsset).ShowModal()

                if updAsset.hasInstaller():
                    updAsset.install()
                    return True
        return False
Esempio n. 8
0
def validateAssets(parent,
                   tasks,
                   updateAssets=True,
                   askForLang=True,
                   autoSave=False):
    if askForLang and settings().showLanguageNotSelectedPopup:
        if not askForLangSelection(parent, tasks):
            return False

    assets = assetManager().getAssetsForTasks(tasks)

    if assets.notInstalled():
        updateAssetList(parent)

    assets.validate()

    if assets.notInstalled():
        if not askForDownloadAssets(parent, assets.notInstalled()):
            return False

    if updateAssets and assets.hasUpdate():
        askForUpdateAssets(parent, assets.hasUpdate())

    return True