Exemplo n.º 1
0
    def __init__(self, parent, sub=None, ref=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())

        self.m_panelSub.setStream(sub)
        self.m_panelRef.setStream(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())

        assetListUpdater.start(autoUpdate=settings().autoUpdate)
Exemplo n.º 2
0
def updateAssetList(parent):
    if not assetListUpdater.isRunning() and not assetListUpdater.isListReady:
        assetListUpdater.start(autoUpdate=False)

    with BusyDlg(parent, _('Downloading assets list...'),
                 cancellable=True) as dlg:
        if dlg.ShowModalWhile(assetListUpdater.isRunning) == wx.ID_OK:
            return assetListUpdater.hasList()
        else:
            assetListUpdater.stop()
Exemplo n.º 3
0
    def checkForUpdate(self):
        updAsset = assetManager.getSelfUpdaterAsset()
        if updAsset:
            if not assetListUpdater.isRunning() and not updAsset.hasUpdate():
                assetListUpdater.start(updateList=True, autoUpdate=True)

            if assetListUpdater.isRunning():
                with BusyDlg(self, _('Checking for update...')) as dlg:
                    dlg.ShowModalWhile(assetListUpdater.isRunning)

            return updAsset.hasUpdate()
        return False
Exemplo n.º 4
0
    def checkForUpdate(self):
        updAsset = assetManager.getSelfUpdaterAsset()
        if updAsset:
            if not assetListUpdater.isRunning() and not updAsset.hasUpdate():
                assetListUpdater.start(updateList=True, autoUpdate=True)

            if assetListUpdater.isRunning():
                with BusyDlg(self,
                             _('Checking for update...'),
                             cancellable=True) as dlg:
                    if dlg.ShowModalWhile(
                            assetListUpdater.isRunning) == wx.ID_OK:
                        if assetListUpdater.hasList():
                            return updAsset
                    else:
                        assetListUpdater.stop()
            else:
                return updAsset