def onClick(self, widget, event):
        if event.button!=1:
            return
        
        (x,y) = (event.x, event.y)
        (bx, by) = widget.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT,int(x),int(y))
        
        iter = widget.get_iter_at_location(bx,by)

        if not iter.has_tag(self.href_tag):
            # click wasn't on a URL 
            return

        # user clicked on URL, launch browser
        utils.launch_browser(
            preferences.userPrefs, self.auth_url, self.main_window)
    def onClick(self, widget, event):
        if event.button != 1:
            return

        (x, y) = (event.x, event.y)
        (bx, by) = widget.window_to_buffer_coords(gtk.TEXT_WINDOW_TEXT, int(x),
                                                  int(y))

        iter = widget.get_iter_at_location(bx, by)

        if not iter.has_tag(self.href_tag):
            # click wasn't on a URL
            return

        # user clicked on URL, launch browser
        utils.launch_browser(preferences.userPrefs, self.auth_url,
                             self.main_window)
Пример #3
0
    def display_help(self,section=None):
        # if yelp is available use docbook XML; otherwise fall back to HTML
        yelp_path = utils.find_in_path("yelp")
        if yelp_path:
            base_help_file = "gnofract4d-manual.xml"
        else:
            base_help_file = "gnofract4d-manual.html"
            
        loc = "C" # FIXME

        # look locally first to support run-before-install
        local_dir = "doc/gnofract4d-manual/%s/" % loc
        install_dir = "../../share/gnome/help/gnofract4d/%s/" % loc

        helpfile = fractconfig.instance.find_resource(
            base_help_file, local_dir, install_dir)
        abs_file = os.path.abspath(helpfile)
        
        if not os.path.isfile(abs_file):
            self.show_error_message(
                _("Can't display help"),
                _("Can't find help file '%s'") % abs_file)
            return
        
        if section == None:
            anchor = ""
        else:
            anchor = "#" + section
        
        if yelp_path:
            os.system("yelp ghelp://%s%s >/dev/null 2>&1 &" % (abs_file, anchor))
        else:
            url="file://%s%s" % (abs_file, anchor)
            utils.launch_browser(
                preferences.userPrefs,
                url,
                self.window)
Пример #4
0
 def report_bug(self, *args):
     url="http://sourceforge.net/tracker/?func=add&group_id=785&atid=100785"
     utils.launch_browser(
         preferences.userPrefs,
         url,
         self.window)
Пример #5
0
 def view_group_fractals(self, *args):
     utils.launch_browser(preferences.userPrefs,
                    "http://flickr.com/groups/gnofract4d/pool/",
                    self.window)
Пример #6
0
 def view_my_fractals(self, *args):
     nsid = flickr_assistant.get_user(self.window, self.f)
     if nsid != "":
         url = "http://flickr.com/photos/%s/" % nsid
         utils.launch_browser(preferences.userPrefs, url, self.window)
Пример #7
0
 def report_bug(self, *args):
     url="https://github.com/edyoung/gnofract4d/issues"
     utils.launch_browser(
         preferences.userPrefs,
         url,
         self.window)