示例#1
0
    def setup_finish(self):
        self.hosts[self.site_name] = self.site
        mw.set_setting('mediawiki_site', self.hosts)

        if sublime.ok_cancel_dialog('Activate this host?'):
            mw.set_setting("mediawiki_site_active", self.site_name)

        mw.status_message('Setup finished.')
示例#2
0
 def on_done(self, index):
     # not escaped
     if index >= 0:
         site_active = self.site_keys[index].strip()
         if site_active.startswith(self.SITE_ON):
             site_active = site_active[len(self.SITE_ON):]
         # force to set site_active in global and in view settings
         if mw.props.get_view_setting(self.window.active_view(), 'is_here'):
             mw.props.set_view_setting(self.window.active_view(), 'site', site_active)
         mw.set_setting("site_active", site_active)
示例#3
0
 def on_done(self, index):
     # not escaped
     if index >= 0:
         site_active = self.site_keys[index].strip()
         if site_active.startswith(self.site_on):
             site_active = site_active[len(self.site_on):]
         # force to set site_active in global and in view settings
         # current_syntax = self.window.active_view().settings().get('syntax')
         # if current_syntax is not None and current_syntax.endswith('Mediawiker/Mediawiki.tmLanguage'):
         if self.window.active_view().settings().get('mediawiker_is_here', False):
             self.window.active_view().settings().set('mediawiker_site', site_active)
         mw.set_setting("mediawiki_site_active", site_active)