mirror of
https://github.com/MCV-Software/TWBlue.git
synced 2024-11-22 11:18:08 -06:00
Merge pull request #540 from Arfs6/stop_update_running_source
stop updating while running from source
This commit is contained in:
commit
b3e0b21ee7
@ -1,5 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import os
|
||||
import sys
|
||||
import logging
|
||||
import webbrowser
|
||||
import wx
|
||||
@ -429,6 +430,10 @@ class Controller(object):
|
||||
return handler.account_settings(buffer=buffer, controller=self)
|
||||
|
||||
def check_for_updates(self, *args, **kwargs):
|
||||
if not getattr(sys, 'frozen', False):
|
||||
log.debug("Running from source, can't update")
|
||||
commonMessageDialogs.cant_update_source()
|
||||
return
|
||||
update = updater.do_update()
|
||||
if update == False:
|
||||
view.no_update_available()
|
||||
|
@ -8,6 +8,9 @@ from .wxUpdater import *
|
||||
logger = logging.getLogger("updater")
|
||||
|
||||
def do_update(endpoint=application.update_url):
|
||||
if not getattr(sys, 'frozen', False):
|
||||
logger.debug("Running from source, aborting update check")
|
||||
return False
|
||||
try:
|
||||
result = update.perform_update(endpoint=endpoint, current_version=application.version, app_name=application.name, update_available_callback=available_update_dialog, progress_callback=progress_callback, update_complete_callback=update_finished)
|
||||
except:
|
||||
|
@ -38,3 +38,9 @@ def invalid_configuration():
|
||||
def dead_pid():
|
||||
return wx.MessageDialog(None, _(u"{0} quit unexpectedly the last time it was run. If the problem persists, please report it to the {0} developers.").format(application.name), _(u"Warning"), wx.OK).ShowModal()
|
||||
|
||||
def cant_update_source() -> wx.MessageDialog:
|
||||
"""Shows a dialog telling a user he /she can't update because he / she is
|
||||
running from source
|
||||
"""
|
||||
dlg = wx.MessageDialog(None, _("Sorry, you can't update while running {} from source.").format(application.name), _("Error"), wx.OK)
|
||||
return dlg.ShowModal()
|
||||
|
Loading…
Reference in New Issue
Block a user