Exemple #1
0
    def testOptionMenu(self):
        om = utils.create_option_menu(["foo", "bar", "Bazniculate Geometry"])
        utils.add_menu_item(om, "fishy")
        utils.set_selected(om, 3)
        self.assertEqual(3, utils.get_selected(om))

        utils.set_menu_from_list(om, ["hello", "world"])
        utils.set_selected(om, 1)
        item1 = utils.get_selected_value(om)
        self.assertEqual("world", item1)

        utils.set_selected_value(om, "hello")
        i = utils.get_selected(om)
        self.assertEqual(0, i)

        utils.set_selected_value(om, "world")
        i = utils.get_selected(om)
        self.assertEqual(1, i)
    def testOptionMenu(self):
        om = utils.create_option_menu(["foo","bar","Bazniculate Geometry"])
        utils.add_menu_item(om,"fishy")
        utils.set_selected(om,3)
        self.assertEqual(3, utils.get_selected(om))

        utils.set_menu_from_list(om, ["hello","world"])
        utils.set_selected(om,1)
        item1 = utils.get_selected_value(om)
        self.assertEqual("world",item1)

        utils.set_selected_value(om,"hello")
        i = utils.get_selected(om)
        self.assertEqual(0,i)

        utils.set_selected_value(om,"world")
        i = utils.get_selected(om)
        self.assertEqual(1,i)
Exemple #3
0
        def set_fractal_function(om, f, param, formula):
            index = utils.get_selected(om)
            if index != -1:
                # this shouldn't be necessary but I got weird errors
                # trying to reuse the old funclist
                list = formula.symbols.available_param_functions(param.ret, param.args)
                list.sort()

                fname = list[index]
                f.set_func(param, fname, formula)
        def set_fractal_function(om,f,param,formula):
            index = utils.get_selected(om)
            if index != -1:
                # this shouldn't be necessary but I got weird errors
                # trying to reuse the old funclist
                list = formula.symbols.available_param_functions(
                    param.ret,param.args)
                list.sort()

                fname = list[index]
                f.set_func(param,fname,formula)
 def set_fractal(entry,form,order):
     new_value = utils.get_selected(widget)
     form.set_param(order, new_value)
                d = hig.InformationAlert(
                    primary=_("Can't Post to Group"),
                    secondary=
                    _("Your image has been uploaded to Flickr, but you aren't a member of the Gnofract 4D group, so your image hasn't been added to the group pool. You can join the group at http://www.flickr.com/groups_join.gne?id=46555832@N00 ."
                      ),
                    parent=self,
                    ignore=ignore_info.T("cannot_post", True,
                                         gtk.RESPONSE_ACCEPT))

                d.run()
                d.destroy()
            else:
                display_flickr_error(err)

        # post to a blog if selected
        selected_blog = utils.get_selected(self.blog_menu)
        if selected_blog > 0:
            # 0 is "<None>"
            blog = self.blogs[selected_blog - 1]
            req = flickr.requestBlogsPostPhoto(blog, id, title, description,
                                               TOKEN)

            self.runRequest(req, self.onBlogPostComplete)
        else:
            self.onUploadComplete()

    def onBlogPostComplete(self, slave):
        try:
            resp = slave.response()
        except Exception, err:
            display_flickr_error(err)
Exemple #7
0
 def set_resolution(*args):
     index = utils.get_selected(res_menu)
     if index != -1:
         (w,h) = self.resolutions[index]
         preferences.userPrefs.set_size(w,h)
         self.update_subfracts()
Exemple #8
0
 def set_fractal(entry, form, order):
     new_value = utils.get_selected(widget)
     form.set_param(order, new_value)
 def set_prefs(*args):
     index = utils.get_selected(optMenu)
     if index != -1:
         self.prefs.set("display","antialias",str(index))
        except Exception,err:
            if err.code == 2:
                # user isn't a member of this group
                d = hig.InformationAlert(
                    primary=_("Can't Post to Group"),
                    secondary=_("Your image has been uploaded to Flickr, but you aren't a member of the Gnofract 4D group, so your image hasn't been added to the group pool. You can join the group at http://www.flickr.com/groups_join.gne?id=46555832@N00 ."),
                    parent = self,
                    ignore=ignore_info.T("cannot_post", True, gtk.RESPONSE_ACCEPT))

                d.run()
                d.destroy()
            else:
                display_flickr_error(err)

        # post to a blog if selected
        selected_blog = utils.get_selected(self.blog_menu)
        if selected_blog > 0:                    
            # 0 is "<None>"
            blog = self.blogs[selected_blog-1]
            req = flickr.requestBlogsPostPhoto(blog,id,title,description,TOKEN)

            self.runRequest(req, self.onBlogPostComplete)
        else:
            self.onUploadComplete()

    def onBlogPostComplete(self,slave):
        try:
            resp = slave.response()
        except Exception, err:
            display_flickr_error(err)
        self.onUploadComplete()
Exemple #11
0
 def set_prefs(*args):
     index = utils.get_selected(optMenu)
     if index != -1:
         self.prefs.set("display", "antialias", str(index))
Exemple #12
0
 def set_type_cb(self,optmenu):
     self.set_type(utils.get_selected(optmenu))