Пример #1
0
    def __init__(self, version=None, latest_stable_version=None):

        wx.Dialog.__init__(self,
                           None,
                           -1,
                           u"关于",
                           style=wx.DEFAULT_DIALOG_STYLE | wx.THICK_FRAME
                           | wx.TAB_TRAVERSAL)

        update_version = u"欢迎使用!"
        co.log([version, latest_stable_version])
        if latest_stable_version and latest_stable_version != "0":
            cv = co.compareVersion(version, latest_stable_version)
            if cv < 0:
                update_version = u"更新的稳定版 v%s 已经发布!" % latest_stable_version
            else:
                update_version = u"您正在使用最新稳定版本。"

        hwin = AboutHtml(self)
        hwin.SetPage(u"""
            <font size="9" color="#44474D"><b>SwitchHosts!</b></font><br />
            <font size="3" color="#44474D">%(version)s</font><br /><br />
            <font size="3" color="#909090"><i>%(update_version)s</i></font><br />
            <p>
                本程序用于在多个 hosts 之间快速切换。
            </p>
            <p>
                主页:<a href="http://oldj.github.io/SwitchHosts/">http://oldj.github.io/SwitchHosts/</a><br />
                <!--源码:<a href="https://github.com/oldj/SwitchHosts">https://github.com/oldj/SwitchHosts</a><br />-->
                作者:<a href="http://oldj.net">oldj</a><br />
                <br />
                以下网友对本软件也有贡献:<br />
                <a href="http://weibo.com/charlestang">@charlestang</a>,
                <a href="http://weibo.com/allenm56">@allenm</a>,
                <a href="http://www.weibo.com/emersonli">@emersonli</a>,
                <a href="https://github.com/qiyuan4f">@qiyuan4f</a> <br />
                <br />
                <font color="#909090">本程序完全免费,如果您觉得它还不错,欢迎<a href="https://me.alipay.com/oldj">捐赠</a>支持作者,谢谢!</font>
            </p>
        """ % {
            "version": version,
            "update_version": update_version,
        })

        hwin.FindWindowById(wx.ID_OK)
        irep = hwin.GetInternalRepresentation()
        hwin.SetSize((irep.GetWidth() + 25, irep.GetHeight() + 30))
        self.SetClientSize(hwin.GetSize())
        self.CenterOnParent(wx.BOTH)
        self.SetFocus()
Пример #2
0
        def _msg():
            if not ver:
                wx.MessageBox(u"未能取得最新版本号!", caption=u"出错啦!")

            else:
                cmp = co.compareVersion(self.version, self.latest_stable_version)
                try:
                    if cmp >= 0:
                        wx.MessageBox(u"当前已是最新版本!")
                    else:
                        wx.MessageBox(u"更新的稳定版 %s 已经发布!" % self.latest_stable_version)
                except Exception:
                    co.debugErr()
                    pass
Пример #3
0
    def __init__(self, version=None, latest_stable_version=None):

        wx.Dialog.__init__(self, None, -1, u"关于",
                style=wx.DEFAULT_DIALOG_STYLE|wx.THICK_FRAME|wx.TAB_TRAVERSAL
            )

        update_version = u"欢迎使用!"
        co.log([version, latest_stable_version])
        if latest_stable_version and latest_stable_version != "0":
            cv = co.compareVersion(version, latest_stable_version)
            if cv < 0:
                update_version = u"更新的稳定版 v%s 已经发布!" % latest_stable_version
            else:
                update_version = u"您正在使用最新稳定版本。"
            

        hwin = AboutHtml(self)
        hwin.SetPage(u"""
            <font size="9" color="#44474D"><b>SwitchHosts!</b></font><br />
            <font size="3" color="#44474D">%(version)s</font><br /><br />
            <font size="3" color="#909090"><i>%(update_version)s</i></font><br />
            <p>
                本程序用于在多个 hosts 之间快速切换。
            </p>
            <p>
                主页:<a href="http://oldj.github.io/SwitchHosts/">http://oldj.github.io/SwitchHosts/</a><br />
                <!--源码:<a href="https://github.com/oldj/SwitchHosts">https://github.com/oldj/SwitchHosts</a><br />-->
                作者:<a href="http://oldj.net">oldj</a><br />
                <br />
                以下网友对本软件也有贡献:<br />
                <a href="http://weibo.com/charlestang">@charlestang</a>,
                <a href="http://weibo.com/allenm56">@allenm</a>,
                <a href="http://www.weibo.com/emersonli">@emersonli</a>,
                <a href="https://github.com/qiyuan4f">@qiyuan4f</a> <br />
                <br />
                <font color="#909090">本程序完全免费,如果您觉得它还不错,欢迎<a href="https://me.alipay.com/oldj">捐赠</a>支持作者,谢谢!</font>
            </p>
        """ % {
            "version": version,
            "update_version": update_version,
        })

        hwin.FindWindowById(wx.ID_OK)
        irep = hwin.GetInternalRepresentation()
        hwin.SetSize((irep.GetWidth() + 25, irep.GetHeight() + 30))
        self.SetClientSize(hwin.GetSize())
        self.CenterOnParent(wx.BOTH)
        self.SetFocus()
Пример #4
0
        def _msg():
            if not ver:
                wx.MessageBox(u"未能取得最新版本号!", caption=u"出错啦!")

            else:
                cmp = co.compareVersion(self.version,
                                        self.latest_stable_version)
                try:
                    if cmp >= 0:
                        wx.MessageBox(u"当前已是最新版本!")
                    else:
                        wx.MessageBox(u"更新的稳定版 %s 已经发布!" %
                                      self.latest_stable_version)
                except Exception:
                    co.debugErr()
                    pass
Пример #5
0
        def _msg():
            if not ver:
                wx.MessageBox(u"未能取得最新版本号!", caption=u"出错啦!")

            else:
                cmp = co.compareVersion(self.version, self.latest_stable_version)
                try:
                    if cmp >= 0:
                        wx.MessageBox(u"当前已是最新版本!")
                    else:
                        if wx.MessageBox(u"更新的稳定版 %s 已经发布,现在立刻查看吗?" % self.latest_stable_version,
                            u"发现新版本!",
                            wx.YES_NO | wx.ICON_INFORMATION
                        ) == wx.YES:
                            self.openHomepage()

                except Exception:
                    co.debugErr()
                    pass