Exemplo n.º 1
0
 def _setup_plugins_dir(self):
     plugins_dir = get_plugins_dir()
     user_plugins_dir = get_user_plugins_dir()
     if os.path.exists(plugins_dir):
         self.engine.add_search_path(plugins_dir)
     if os.path.exists(user_plugins_dir):
         self.engine.add_search_path(user_plugins_dir)
Exemplo n.º 2
0
 def _setup_plugins_dir(self):
     plugins_dir = get_plugins_dir()
     user_plugins_dir = get_user_plugins_dir()
     if os.path.exists(plugins_dir):
         self.engine.add_search_path(plugins_dir)
     if os.path.exists(plugins_dir):
         self.engine.add_search_path(user_plugins_dir)
Exemplo n.º 3
0
    def __init__(self, app, preferences_dialog):
        Gtk.ScrolledWindow.__init__(self)

        list_store = PluginManagerStore.new(app, preferences_dialog)
        if list_store.get_n_items():
            plugins_box = PluginsBox(list_store)
        else:
            # We could use Gtk.ListBox.set_placeholder, but it
            # appears bad inside the list widget.
            placeholder_label = Gtk.Label.new(_("No plugins available"))
            placeholder_label.props.margin = 4 * PADDING
            placeholder_label.props.margin_top = 10 * PADDING
            placeholder_label.show()
            plugins_box = placeholder_label

        self._infobar_revealer = Gtk.Revealer()
        self._infobar = Gtk.InfoBar()
        fix_infobar(self._infobar)
        self._infobar_label = Gtk.Label()
        self._setup_infobar()

        note_label = Gtk.Label.new()
        note_label.set_markup(
            _("You can create <a href='{doc_url}'>plugins</a> into your <a href='{dir_url}'>plugins directory</a>."
              ).format(doc_url="http://developer.pitivi.org/Plugins.html",
                       dir_url=GLib.filename_to_uri(get_user_plugins_dir(),
                                                    None)))
        note_label.props.margin_top = PADDING * 4
        note_label.props.margin_bottom = PADDING * 2

        wrapper_box = Gtk.Box(orientation=Gtk.Orientation.VERTICAL)
        self.add(wrapper_box)
        self.set_min_content_height(500)
        self.set_min_content_width(600)

        wrapper_box.pack_start(self._infobar_revealer,
                               expand=False,
                               fill=False,
                               padding=0)
        wrapper_box.pack_start(plugins_box,
                               expand=False,
                               fill=False,
                               padding=0)
        wrapper_box.pack_start(note_label, expand=False, fill=False, padding=0)

        # Helpers
        self._infobar_timer = None
Exemplo n.º 4
0
 def get_dir(self):
     """Returns the directory where this type of plugins can be found."""
     if self.value == PluginType.USER:
         return get_user_plugins_dir()
     elif self.value == PluginType.SYSTEM:
         return get_plugins_dir()
Exemplo n.º 5
0
 def get_dir(self):
     if self.value == PluginType.USER:
         return get_user_plugins_dir()
     elif self.value == PluginType.SYSTEM:
         return get_plugins_dir()
Exemplo n.º 6
0
 def get_dir(self):
     if self.value == PluginType.USER:
         return get_user_plugins_dir()
     elif self.value == PluginType.SYSTEM:
         return get_plugins_dir()