[gnome-applets/wip/dont-use-deprecated: 3/3] A few fixes



commit 36781f46f946f165058c3b27981802584c5a9a8e
Author: Rodrigo Moya <rodrigo gnome-db org>
Date:   Tue Nov 23 11:12:56 2010 +0100

    A few fixes

 invest-applet/invest/__init__.py      |    6 +++---
 invest-applet/invest/applet.py        |    2 +-
 invest-applet/invest/invest-applet.py |    5 +++--
 3 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/invest-applet/invest/__init__.py b/invest-applet/invest/__init__.py
index 29fb7d6..ec53bcb 100644
--- a/invest-applet/invest/__init__.py
+++ b/invest-applet/invest/__init__.py
@@ -3,7 +3,7 @@ from os.path import join, exists, isdir, isfile, dirname, abspath, expanduser
 from types import ListType
 import datetime
 
-import gtk, gtk.gdk, gconf, gobject
+from gi.repository import Gtk, Gdk, GConf, GObject
 import cPickle
 
 import networkmanager
@@ -55,7 +55,7 @@ if not exists(USER_INVEST_DIR):
 os.chdir(expanduser("~"))
 
 #Gconf client
-GCONF_CLIENT = gconf.client_get_default()
+GCONF_CLIENT = GConf.Client.get_default()
 
 # GConf directory for invest in window mode and shared settings
 GCONF_DIR = "/apps/invest"
@@ -205,7 +205,7 @@ def get_gnome_proxy_retry(client, attempts, sleep):
 			gobject.timeout_add(sleep * 1000, get_gnome_proxy_retry, client, attempts, sleep)
 
 # use gconf to get proxy config
-client = gconf.client_get_default()
+client = GConf.Client.get_default()
 get_gnome_proxy(client)
 
 
diff --git a/invest-applet/invest/applet.py b/invest-applet/invest/applet.py
index da487a7..a0236f2 100644
--- a/invest-applet/invest/applet.py
+++ b/invest-applet/invest/applet.py
@@ -8,7 +8,7 @@ import invest, invest.about, invest.chart, invest.preferences, invest.defs
 from invest.quotes import QuoteUpdater
 from invest.widgets import *
 
-Gtk.window_set_default_icon_from_file(join(invest.ART_DATA_DIR, "invest_neutral.svg"))
+Gtk.Window.set_default_icon_from_file(join(invest.ART_DATA_DIR, "invest_neutral.svg"))
 
 class InvestApplet(PanelApplet.Applet):
 	def __init__(self, applet):
diff --git a/invest-applet/invest/invest-applet.py b/invest-applet/invest/invest-applet.py
index c672950..87972f0 100755
--- a/invest-applet/invest/invest-applet.py
+++ b/invest-applet/invest/invest-applet.py
@@ -37,7 +37,7 @@ def applet_factory(applet, iid):
 
 # 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.set_property('resizable', False)
@@ -90,7 +90,8 @@ if __name__ == "__main__":
 		build_window()
 		Gtk.main()
 	else:
-		PanelApplet.factory(
+		PanelApplet.Applet.factory_main(
 			"InvestAppletFactory",
+			True,
 			InvestApplet.__gtype__,
 			applet_factory)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]