Esempio n. 1
0
 def _on_view__navigation_policy_decision_requested(self, view, frame,
                                                    request, action,
                                                    policy):
     uri = request.props.uri
     if not uri.startswith('file:///'):
         policy.ignore()
         open_browser(uri, self.toplevel.get_screen())
Esempio n. 2
0
 def _open_uri(self, uri):
     if self._view:
         self._view.load_uri(uri)
         self.ok_button.grab_focus()
     else:
         open_browser(uri, self.toplevel.get_screen())
         self.toplevel.hide()
Esempio n. 3
0
 def _policy_decision(self, uri, policy):
     if uri.startswith('file:///'):
         policy.use()
     elif uri.startswith('http://localhost'):
         policy.use()
     elif uri.startswith('stoq://'):
         policy.ignore()
         self._parse_stoq_uri(uri)
     else:
         open_browser(uri, self.get_screen())
Esempio n. 4
0
def show_section(section, screen=None):
    if library.uninstalled:
        root = library.get_root()
        uri = os.path.join(root, 'docs', 'manual', 'pt_BR')
        if section != '':
            uri += '/' + section + '.page'
    else:
        uri = 'stoq'
        if section != '':
            uri += '?' + section

    if not screen:
        toplevel = get_current_toplevel()
        if toplevel:
            screen = toplevel.get_screen()

    try:
        gtk.show_uri(screen, 'ghelp:' + uri, gtk.get_current_event_time())
    except glib.GError:
        open_browser('http://doc.stoq.com.br/manual/%s/%s.html' % (
            stoq.short_version,
            section or 'index', ), screen)
Esempio n. 5
0
File: help.py Progetto: tmaxter/stoq
def show_section(section, screen=None):
    if library.uninstalled:
        root = library.get_root()
        uri = os.path.join(root, 'docs', 'manual', 'pt_BR')
        if section != '':
            uri += '/' + section + '.page'
    else:
        uri = 'stoq'
        if section != '':
            uri += '?' + section

    if not screen:
        toplevel = get_current_toplevel()
        if toplevel:
            screen = toplevel.get_screen()

    try:
        gtk.show_uri(screen, 'ghelp:' + uri, gtk.get_current_event_time())
    except glib.GError:
        open_browser(
            'http://doc.stoq.com.br/manual/%s/%s.html' % (
                stoq.short_version,
                section or 'index',
            ), screen)
Esempio n. 6
0
 def _show_uri(self, uri):
     toplevel = self.get_toplevel()
     open_browser(uri, toplevel.get_screen())
Esempio n. 7
0
 def _show_uri(self, uri):
     toplevel = self.get_toplevel()
     open_browser(uri, toplevel.get_screen())