예제 #1
0
파일: grins.py 프로젝트: scooter23/grins
 def checkversion_callback(self):
     import MMurl
     import version
     import windowinterface
     import settings
     url = 'http://www.oratrix.com/indir/%s/updatecheck.txt' % version.shortversion
     try:
         fp = MMurl.urlopen(url)
         data = fp.read()
         fp.close()
     except:
         windowinterface.showmessage(
             'Unable to check for upgrade. You can try again later, or visit www.oratrix.com with your webbrowser.'
         )
         print "Could not load URL", url
         return
     data = data.strip()
     if not data:
         windowinterface.showmessage(
             'You are running the latest version of the software')
         return
     cancel = windowinterface.GetOKCancel(
         'There appears to be a newer version!\nDo you want to know more?')
     if cancel:
         return
     # Pass the version and the second item of the license along.
     id = settings.get('license').split('-')[1]
     url = '%s?version=%s&id=%s' % (data, version.shortversion, id)
     windowinterface.htmlwindow(url)
예제 #2
0
파일: grins.py 프로젝트: scooter23/grins
    def __init__(self, opts, files):
        import windowinterface, features
        if hasattr(features, 'expiry_date') and features.expiry_date:
            import time
            import version
            tm = time.localtime(time.time())
            yymmdd = tm[:3]
            if yymmdd > features.expiry_date:
                rv = windowinterface.GetOKCancel(
                    "This beta copy of GRiNS has expired.\n\n"
                    "Do you want to check www.oratrix.com for a newer version?"
                )
                if rv == 0:
                    url = 'http://www.oratrix.com/indir/%s/update.html' % version.shortversion
                    windowinterface.htmlwindow(url)
                sys.exit(0)
        self.tmpopts = opts
        self.tmpfiles = files

        flag = hasattr(windowinterface,
                       'is_embedded') and windowinterface.is_embedded()
        if hasattr(features, 'license_features_needed'
                   ) and features.license_features_needed and not flag:
            import license
            license_features_needed = list(features.license_features_needed)
            if 'smil2player' not in license_features_needed:
                license_features_needed.append('smil2player')
            self.tmplicensedialog = license.WaitLicense(
                self.do_init, license_features_needed)
        else:
            self.do_init()
        self.recent_file_list = []
예제 #3
0
    def checkversion_callback(self):
        import MMurl
        import windowinterface
        url = self._get_versiondep_url('updatecheck.txt')

        try:
            fp = MMurl.urlopen(url)
            data = fp.read()
            fp.close()
        except:
            windowinterface.showmessage(
                'Unable to check for upgrade. You can try again later, or visit www.oratrix.com with your webbrowser.'
            )
            return
        data = data.strip()
        if not data:
            windowinterface.showmessage(
                'You are running the latest version of the software.')
            return
        cancel = windowinterface.GetOKCancel(
            'There appears to be a newer version!\nDo you want to know more?')
        if cancel:
            return
        url = self._add_license_id(self, data)
        windowinterface.htmlwindow(url)
예제 #4
0
    def __init__(self, opts, files, splash):
        import windowinterface
        import license
        self.splash = splash
        if hasattr(features, 'expiry_date') and features.expiry_date:
            import time
            import version
            tm = time.localtime(time.time())
            yymmdd = tm[:3]
            if yymmdd > features.expiry_date:
                rv = windowinterface.GetOKCancel(
                    "This beta copy of GRiNS has expired.\n\n"
                    "Do you want to check www.oratrix.com for a newer version?"
                )
                if rv == 0:
                    url = self._get_versiondep_url('update.html')
                    windowinterface.htmlwindow(url)
                sys.exit(0)
        self.tmpopts = opts
        self.tmpfiles = files

        self.tmplicensedialog = license.WaitLicense(
            self.do_init, features.license_features_needed)
        self.recent_file_list = [
        ]  # This is the list of recently opened files.
예제 #5
0
 def transaction(self, type):
     if self.myCommit:
         return 1
     if self.is_changed():
         q = windowinterface.GetOKCancel(
             "You have unsaved changes in the source view.\nIs it OK to discard these?",
             self.toplevel.window)
         return not q
     return 1
예제 #6
0
 def asksavechanges(self):
     if self.url:
         return windowinterface.GetYesNoCancel('Save changes to %s?' % self.url)
     # User wants to save, but we have no url.
     answer = windowinterface.GetOKCancel('Discard old contents of RealPix node?')
     if answer == 0:
         # Discard, return as "don't save"
         return 1
     # Cancel and don't discard are both returned as "cancel"
     return 2
예제 #7
0
    def __init__(self):
        import windowinterface
        if hasattr(features, 'expiry_date') and features.expiry_date:
            import time
            import version
            tm = time.localtime(time.time())
            yymmdd = tm[:3]
            if yymmdd > features.expiry_date:
                rv = windowinterface.GetOKCancel(
                    "This beta copy of GRiNS has expired.\n\n"
                    "Do you want to check www.oratrix.com for a newer version?"
                )
                if rv == 0:
                    url = 'http://www.oratrix.com/indir/%s/update.html' % version.shortversion
                    windowinterface.htmlwindow(url)
                sys.exit(0)

        self.do_init()