|
@@ -131,6 +131,7 @@ class Main(frame.MainFrame):
|
|
self.m_statusbar.SetStatusText(
|
|
self.m_statusbar.SetStatusText(
|
|
' WxPython版本:' + constant.WXPYTHON_VERSION_STRING, 2)
|
|
' WxPython版本:' + constant.WXPYTHON_VERSION_STRING, 2)
|
|
self.m_statusbar.SetStatusText(' 联系作者(RICKY):QQ11748854', 3)
|
|
self.m_statusbar.SetStatusText(' 联系作者(RICKY):QQ11748854', 3)
|
|
|
|
+
|
|
self.Centre()
|
|
self.Centre()
|
|
|
|
|
|
def task_start(self):
|
|
def task_start(self):
|
|
@@ -172,6 +173,32 @@ class Main(frame.MainFrame):
|
|
self.m_text_log.AppendText(message)
|
|
self.m_text_log.AppendText(message)
|
|
self.m_text_log.ShowPosition(self.m_text_log.GetLastPosition())
|
|
self.m_text_log.ShowPosition(self.m_text_log.GetLastPosition())
|
|
|
|
|
|
|
|
+ def upgrade_call_after(self, is_new_version, show_no_new_version_tip, title, message):
|
|
|
|
+ """
|
|
|
|
+ 接收更新程序线程传递消息,弹窗提示框
|
|
|
|
+
|
|
|
|
+ 参数:
|
|
|
|
+ self (object): 当前对象
|
|
|
|
+ is_new_version (bool): 是否是新版本
|
|
|
|
+ show_no_new_version_tip (bool): 是否显示提示
|
|
|
|
+ title (str): 标题
|
|
|
|
+ message (str): 消息
|
|
|
|
+ """
|
|
|
|
+ if is_new_version:
|
|
|
|
+ logger.info('检查更新结果:发现新的版本-{}', title)
|
|
|
|
+ dlg = wx.GenericMessageDialog(
|
|
|
|
+ self, '新版本:%s\n\n更新日志:\n%s' %
|
|
|
|
+ (title, message), '版本更新提醒', wx.OK | wx.CANCEL)
|
|
|
|
+ dlg.SetOKCancelLabels('前往升级', '忽略更新')
|
|
|
|
+ if dlg.ShowModal() == wx.ID_OK:
|
|
|
|
+ wx.LaunchDefaultBrowser(
|
|
|
|
+ 'https://gitee.com/lpf_project/RuoYi-MT/releases')
|
|
|
|
+ dlg.Destroy()
|
|
|
|
+ else:
|
|
|
|
+ logger.info('检查更新结果:当前版本是最新版本!')
|
|
|
|
+ if show_no_new_version_tip:
|
|
|
|
+ wx.MessageDialog(self, '当前版本是最新版本!', '检测更新', wx.OK).ShowModal()
|
|
|
|
+
|
|
def check_input(self):
|
|
def check_input(self):
|
|
"""
|
|
"""
|
|
校验输入框
|
|
校验输入框
|
|
@@ -230,7 +257,8 @@ class Main(frame.MainFrame):
|
|
|
|
|
|
# 实现退出菜单事件
|
|
# 实现退出菜单事件
|
|
def OnMenuClickEventExit(self, event):
|
|
def OnMenuClickEventExit(self, event):
|
|
- dlg = wx.MessageDialog(None, '确认退出程序吗?', '退出提醒', wx.YES_NO)
|
|
|
|
|
|
+ dlg = wx.MessageDialog(self, '确认退出程序吗?', '退出提醒', wx.YES_NO)
|
|
|
|
+ dlg.SetYesNoLabels('退出', '取消')
|
|
if dlg.ShowModal() == wx.ID_YES:
|
|
if dlg.ShowModal() == wx.ID_YES:
|
|
self.Destroy()
|
|
self.Destroy()
|
|
dlg.Destroy()
|
|
dlg.Destroy()
|
|
@@ -292,7 +320,8 @@ class Main(frame.MainFrame):
|
|
|
|
|
|
# 实现检测更新事件
|
|
# 实现检测更新事件
|
|
def OnUpgrade(self, event):
|
|
def OnUpgrade(self, event):
|
|
- upgradespider.check(True)
|
|
|
|
|
|
+ t = upgradespider.UpgradeThread(self, True)
|
|
|
|
+ t.start()
|
|
|
|
|
|
# 实现使用指南事件
|
|
# 实现使用指南事件
|
|
def OnManual(self, event):
|
|
def OnManual(self, event):
|