2
from gi.repository import Gtk, GObject
5
5
import softwarecenter.plugin
6
from softwarecenter.view.basepane import BasePane
8
8
from gettext import gettext as _
10
class ExamplePluginPane(gtk.VBox, BasePane):
13
gtk.VBox.__init__(self)
14
self.pack_start(gtk.Label("Hello from the example plugin"))
17
10
class ExamplePlugin(softwarecenter.plugin.Plugin):
11
""" example plugin that will hide the exhibits banner """
20
VIEW_PAGE_EXAMPLE_PLUGIN = "view-page-example-plugin"
13
def _try_to_hide_banner(self):
14
if not self.app.available_pane.view_initialized:
15
# wait for the pane to fully initialize
17
self.app.available_pane.cat_view.vbox.get_children()[0].hide()
22
20
def init_plugin(self):
23
21
sys.stderr.write("init_plugin\n")
24
self.plugin_view = ExamplePluginPane()
25
self.app.view_manager.register(self.plugin_view,
26
self.VIEW_PAGE_EXAMPLE_PLUGIN)
28
# FIXME: workaround for imperfect apps.py
29
self.plugin_view.apps_filter = None
31
# FIXME: this needs to get better
32
model = self.app.view_switcher.get_model()
36
model.append(parent_iter, [icon,
38
self.VIEW_PAGE_EXAMPLE_PLUGIN,
23
GObject.timeout_add(100, self._try_to_hide_banner)