Example #1
0
 def setup_thread(self, importer, label, connect_follow_up=True):
     tm = get_thread_manager()
     tm.add_thread(importer)
     tmg = get_thread_manager_gui()
     tmg.register_thread_with_dialog(label, importer)
     if connect_follow_up:
         importer.connect('completed', self.follow_up, importer)
Example #2
0
 def setup_window(self):
     # set our parent...
     from gourmet.threadManager import get_thread_manager_gui
     import gourmet.GourmetRecipeManager
     tmg = get_thread_manager_gui()
     self.w = Gtk.Window()
     self.w.set_title(self.title)
     main_app = gourmet.GourmetRecipeManager.get_application()
     self.w.set_transient_for(main_app.window)
     self.w.set_destroy_with_parent(False)
     self.hb = Gtk.HBox()
     self.w.add(self.hb)
     self.tv = Gtk.TextView()
     self.tv.set_size_request(600, 500)
     self.tv.set_wrap_mode(Gtk.WrapMode.WORD)
     self.action_area = Gtk.VBox()
     sw = Gtk.ScrolledWindow()
     sw.add(self.tv)
     sw.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)
     self.hb.add(sw)
     sw.show()
     self.tv.show()
     self.hb.pack_end(self.action_area, expand=False, fill=False, padding=0)
     self.action_area.show()
     self.tb = self.tv.get_buffer()
     self.setup_tags()
Example #3
0
    def setup_window(self):
        # set our parent...
        from gourmet.threadManager import get_thread_manager_gui

        tmg = get_thread_manager_gui()
        self.w = gtk.Window()
        self.w.set_title(self.title)
        self.w.set_transient_for(tmg.dialog)
        self.w.set_destroy_with_parent(False)
        self.hb = gtk.HBox()
        self.w.add(self.hb)
        self.tv = gtk.TextView()
        self.tv.set_size_request(600, 500)
        self.tv.set_wrap_mode(gtk.WRAP_WORD)
        self.action_area = gtk.VBox()
        sw = gtk.ScrolledWindow()
        sw.add(self.tv)
        sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
        self.hb.add(sw)
        sw.show()
        self.tv.show()
        self.hb.pack_end(self.action_area, expand=False)
        self.action_area.show()
        self.tb = self.tv.get_buffer()
        self.setup_tags()
Example #4
0
 def setup_thread(self, importer, label, connect_follow_up=True):
     tm = get_thread_manager()
     tm.add_thread(importer)
     tmg = get_thread_manager_gui()
     tmg.register_thread_with_dialog(label, importer)
     if connect_follow_up:
         importer.connect("completed", self.follow_up, importer)
Example #5
0
 def do_multiple_export (self, recs, fn, exp_type=None,
                                        setup_gui=True, extra_prefs=EXTRA_PREFS_AUTOMATIC):
         myexp, exporterInstance = self.get_multiple_exporter(recs,fn,exp_type,setup_gui,extra_prefs)
         tm = get_thread_manager()
         tm.add_thread(exporterInstance)
         if setup_gui:
             tmg = get_thread_manager_gui()
             tmg.register_thread_with_dialog(_('Export')+'('+myexp.label+')',exporterInstance)
             tmg.show()
         print 'Return exporter instance'
         return exporterInstance        
Example #6
0
 def do_multiple_export (self, recs, fn, exp_type=None,
                                        setup_gui=True, extra_prefs=EXTRA_PREFS_AUTOMATIC):
         myexp, exporterInstance = self.get_multiple_exporter(recs,fn,exp_type,setup_gui,extra_prefs)
         tm = get_thread_manager()
         tm.add_thread(exporterInstance)
         if setup_gui:
             tmg = get_thread_manager_gui()
             tmg.register_thread_with_dialog(_('Export')+'('+myexp.label+')',exporterInstance)
             tmg.show()
         print 'Return exporter instance'
         return exporterInstance        
Example #7
0
 def setup_thread (self, importer, label, connect_follow_up=True):
     tm = get_thread_manager()
     tm.add_thread(importer)
     tmg = get_thread_manager_gui()
     tmg.register_thread_with_dialog(label,
                                     _('Recipes successfully imported'),
                                     importer)
     tmg.show()
     if connect_follow_up:
         importer.connect('completed',
                          self.follow_up,
                          importer
                          )
Example #8
0
 def do_multiple_export (self, recs, fn, exp_type=None,
                                        setup_gui=True, extra_prefs=EXTRA_PREFS_AUTOMATIC):
         myexp, exporterInstance = self.get_multiple_exporter(recs,fn,exp_type,setup_gui,extra_prefs)
         tm = get_thread_manager()
         tm.add_thread(exporterInstance)
         if setup_gui:
             tmg = get_thread_manager_gui()
             tmg.register_thread_with_dialog(_('Export')+' ('+myexp.label+')',
                                             exporterInstance)
             exporterInstance.connect('completed', tmg.notification_thread_done,
                 _('Recipes successfully exported to <a href="file:///%s">%s</a>')%(fn,fn))
             tmg.show()
         print 'Return exporter instance'
         return exporterInstance        
Example #9
0
 def do_multiple_export (self, recs, fn, exp_type=None,
                                        setup_gui=True, extra_prefs=EXTRA_PREFS_AUTOMATIC):
         myexp, exporterInstance = self.get_multiple_exporter(recs,fn,exp_type,setup_gui,extra_prefs)
         tm = get_thread_manager()
         tm.add_thread(exporterInstance)
         if setup_gui:
             tmg = get_thread_manager_gui()
             tmg.register_thread_with_dialog(_('Export')+' ('+myexp.label+')',
                                             exporterInstance)
             exporterInstance.connect('completed', tmg.notification_thread_done,
                 _('Recipes successfully exported to <a href="file:///%s">%s</a>')%(fn,fn))
             tmg.show()
         print('Return exporter instance')
         return exporterInstance
Example #10
0
 def do_multiple_export(self, recs, fn, exp_type=None, setup_gui=True, extra_prefs=EXTRA_PREFS_AUTOMATIC):
     myexp, exporterInstance = self.get_multiple_exporter(recs, fn, exp_type, setup_gui, extra_prefs)
     tm = get_thread_manager()
     tm.add_thread(exporterInstance)
     if setup_gui:
         tmg = get_thread_manager_gui()
         tmg.register_thread_with_dialog(
             _("Export") + " (" + myexp.label + ")",
             _('Recipes successfully exported to <a href="file:///%s">%s</a>') % (fn, fn),
             exporterInstance,
         )
         tmg.show()
     print "Return exporter instance"
     return exporterInstance
Example #11
0
 def setup_window(self):
     # set our parent...
     from gourmet.threadManager import get_thread_manager_gui
     tmg = get_thread_manager_gui()
     self.w = gtk.Window()
     self.w.set_title(self.title)
     self.w.set_transient_for(tmg.dialog)
     self.w.set_destroy_with_parent(False)
     self.hb = gtk.HBox()
     self.w.add(self.hb)
     self.tv = gtk.TextView()
     self.tv.set_size_request(600, 500)
     self.tv.set_wrap_mode(gtk.WRAP_WORD)
     self.action_area = gtk.VBox()
     sw = gtk.ScrolledWindow()
     sw.add(self.tv)
     sw.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
     self.hb.add(sw)
     sw.show()
     self.tv.show()
     self.hb.pack_end(self.action_area, expand=False)
     self.action_area.show()
     self.tb = self.tv.get_buffer()
     self.setup_tags()
Example #12
0
 def setup_notification_message(self, importer):
     tmg = get_thread_manager_gui()
     importer.connect('completed', tmg.importer_thread_done)
Example #13
0
 def setup_notification_message(self, importer):
     tmg = get_thread_manager_gui()
     importer.connect("completed", tmg.importer_thread_done)