示例#1
0
 def fill_cbSelectUninstallPlugin(self, obj):
     o = self.builder.get_object
     store = Gtk.ListStore(str, GdkPixbuf.Pixbuf)
     user_plugins = user_plugins_names()
     active_plugins = active_plugins_names()
     removable_plugins = []
     for x in user_plugins:
         if x not in active_plugins:
             removable_plugins.append(x)
     for x in removable_plugins:
         store.append([
             x,
             load_pixbuf(all_plugins[x].icon),
         ])
     o('cbSelectUninstallPlugin').set_model(store)
     self.selected_uninstallplugin = None
示例#2
0
 def fill_cbSelectUninstallPlugin(self, obj):
     o = self.builder.get_object
     store = Gtk.ListStore(str, GdkPixbuf.Pixbuf)
     user_plugins = user_plugins_names()
     active_plugins = active_plugins_names()
     removable_plugins = []
     for x in user_plugins:
         if x not in active_plugins:
             removable_plugins.append(x)
     for x in removable_plugins:
         store.append([
             x,
             load_pixbuf(all_plugins[x].icon),
         ])
     o('cbSelectUninstallPlugin').set_model(store)
     self.selected_uninstallplugin = None
示例#3
0
 def click_btnInstall(self, obj):
     o = self.builder.get_object
     if self.install_package:
         if not install_plugin(self.install_package):
             box = Gtk.MessageDialog(type=Gtk.MessageType.ERROR,
                                     buttons=Gtk.ButtonsType.OK)
             box.set_markup(RESOURCES.MSGBOX_ERR_INSTALL_PLUGIN)
         else:
             box = Gtk.MessageDialog(type=Gtk.MessageType.INFO,
                                     buttons=Gtk.ButtonsType.OK)
             box.set_markup(RESOURCES.MSGBOX_OK_INSTALL_PLUGIN)
             o('txtChoosePackage').set_text("")
             for name in user_plugins_names():
                 m = load_plugin_module(name)
                 if m:
                     all_plugins[name] = m.Plugin()
             self.install_package = None
             self.fill_cbSelectUninstallPlugin(None)
         box.run()
         box.hide()
         box.destroy()
示例#4
0
 def click_btnInstall(self, obj):
     o = self.builder.get_object
     if self.install_package:
         if not install_plugin(self.install_package):
             box = Gtk.MessageDialog(type=Gtk.MessageType.ERROR,
                                     buttons=Gtk.ButtonsType.OK)
             box.set_markup(RESOURCES.MSGBOX_ERR_INSTALL_PLUGIN)
         else:
             box = Gtk.MessageDialog(type=Gtk.MessageType.INFO,
                                     buttons=Gtk.ButtonsType.OK)
             box.set_markup(RESOURCES.MSGBOX_OK_INSTALL_PLUGIN)
             o('txtChoosePackage').set_text("")
             for name in user_plugins_names():
                 m = load_plugin_module(name)
                 if m:
                     all_plugins[name] = m.Plugin()
             self.install_package = None
             self.fill_cbSelectUninstallPlugin(None)
         box.run()
         box.hide()
         box.destroy()
示例#5
0
_WIZARD_WIZARD_SUBCOMMAND = 'start-wizard'
_WIZARD_MANAGER_SUBCOMMAND = 'start-manager'
_WIZARD_WIZARD_ICON = 'alarmclock_wand-128'
_WIZARD_MANAGER_ICON = 'alarmclock_wand-128'
_WIZARD_WIZARD_DLGICON = 'alarmclock_wand'
_WIZARD_MANAGER_DLGICON = 'alarmclock_wand'

# NOTE: all APP_... constants are builtins from the main script

# load all plugins
all_plugins = {}
for name in stock_plugins_names():
    m = load_plugin_module(name, stock=True)
    if m:
        all_plugins[name] = m.Plugin()
for name in user_plugins_names():
    m = load_plugin_module(name)
    if m:
        try:
            all_plugins[name] = m.Plugin()
        except Exception:
            if PLUGIN_TEMP_FOLDER:
                _x_info = sys.exc_info()
                sys.stderr.write("%s: %s\n" % (_x_info[0].__name__, _x_info[1]))
                traceback.print_tb(_x_info[2])


# load windows and stock panes
ui_app_wizard_master = app_dialog('app-wizard-master')
ui_app_wizard_panes = app_dialog('app-wizard-panes')
示例#6
0
_WIZARD_WIZARD_SUBCOMMAND = 'start-wizard'
_WIZARD_MANAGER_SUBCOMMAND = 'start-manager'
_WIZARD_WIZARD_ICON = 'alarmclock_wand-128'
_WIZARD_MANAGER_ICON = 'alarmclock_wand-128'
_WIZARD_WIZARD_DLGICON = 'alarmclock_wand'
_WIZARD_MANAGER_DLGICON = 'alarmclock_wand'

# NOTE: all APP_... constants are builtins from the main script

# load all plugins
all_plugins = {}
for name in stock_plugins_names():
    m = load_plugin_module(name, stock=True)
    if m:
        all_plugins[name] = m.Plugin()
for name in user_plugins_names():
    m = load_plugin_module(name)
    if m:
        try:
            all_plugins[name] = m.Plugin()
        except Exception:
            if PLUGIN_TEMP_FOLDER:
                _x_info = sys.exc_info()
                sys.stderr.write("%s: %s\n" % (_x_info[0].__name__, _x_info[1]))
                traceback.print_tb(_x_info[2])


# load windows and stock panes
ui_app_wizard_master = app_dialog('app-wizard-master')
ui_app_wizard_panes = app_dialog('app-wizard-panes')