summaryrefslogtreecommitdiff
path: root/invest-applet/invest/invest-applet.py
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2012-12-03 23:48:48 +0100
committerStefano Karapetsas <[email protected]>2012-12-03 23:48:48 +0100
commit540e2e460c8155a22b10c1712eec71c9bf25aea9 (patch)
treefedf92ae6b47340fc4155319c5c978124a17df9e /invest-applet/invest/invest-applet.py
parentba7f835eb79762dd65356a0722aa3e64ad03decb (diff)
downloadmate-applets-540e2e460c8155a22b10c1712eec71c9bf25aea9.tar.bz2
mate-applets-540e2e460c8155a22b10c1712eec71c9bf25aea9.tar.xz
invest-applet: port to gobject introspection
there is an issue to fix with self.applet.window.get_origin in applet.py
Diffstat (limited to 'invest-applet/invest/invest-applet.py')
-rwxr-xr-xinvest-applet/invest/invest-applet.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/invest-applet/invest/invest-applet.py b/invest-applet/invest/invest-applet.py
index 92a2b960..4fa883fc 100755
--- a/invest-applet/invest/invest-applet.py
+++ b/invest-applet/invest/invest-applet.py
@@ -1,8 +1,11 @@
#!/usr/bin/env python
#
-import gobject
-import gtk, mateapplet
+import gi
+gi.require_version("Gtk", "2.0")
+from gi.repository import Gtk
+from gi.repository import GObject
+from gi.repository import MatePanelApplet
import getopt, sys
from os.path import *
@@ -30,20 +33,20 @@ locale.textdomain(mate_invest.defs.GETTEXT_PACKAGE)
from gettext import gettext as _
-def applet_factory(applet, iid):
+def applet_factory(applet, iid, data):
mate_invest.debug('Starting invest instance: %s %s'% ( applet, iid ))
mate_invest.applet.InvestApplet(applet)
return True
# Return a standalone window that holds the applet
def build_window():
- app = gtk.Window(gtk.WINDOW_TOPLEVEL)
+ app = Gtk.Window(Gtk.WindowType.TOPLEVEL)
app.set_title(_("Invest Applet"))
- app.connect("destroy", gtk.main_quit)
+ app.connect("destroy", Gtk.main_quit)
app.set_property('resizable', False)
- applet = mateapplet.Applet()
- applet_factory(applet, None)
+ applet = MatePanelApplet.Applet()
+ applet_factory(applet, None, None)
applet.reparent(app)
app.show_all()
@@ -88,11 +91,11 @@ if __name__ == "__main__":
if standalone:
build_window()
- gtk.main()
+ Gtk.main()
else:
- mateapplet.matecomponent_factory(
- "OAFIID:Invest_Applet_Factory",
- mateapplet.Applet.__gtype__,
- mate_invest.defs.PACKAGE,
- mate_invest.defs.VERSION,
- applet_factory)
+ MatePanelApplet.Applet.factory_main(
+ "InvestAppletFactory",
+ True,
+ MatePanelApplet.Applet.__gtype__,
+ applet_factory,
+ None)