diff options
Diffstat (limited to 'plugin/__init__.py')
-rw-r--r-- | plugin/__init__.py | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/plugin/__init__.py b/plugin/__init__.py index baaa057..223bc15 100644 --- a/plugin/__init__.py +++ b/plugin/__init__.py @@ -20,11 +20,11 @@ import subprocess from os.path import abspath, dirname from gettext import gettext as _ -import gtk import dbus -import gobject +from gi.repository import Gtk +from gi.repository import GObject -from sugar.graphics.alert import NotifyAlert, ErrorAlert +from sugar3.graphics.alert import NotifyAlert, ErrorAlert from sugar_network import api_url, server_mode, IPCClient from active_toolkit.options import Option @@ -102,27 +102,27 @@ def start(): def control_panel_section(): - section = gtk.VBox() + section = Gtk.VBox() - server_box = gtk.VBox() - section.pack_start(server_box) - master_button = gtk.RadioButton() + server_box = Gtk.VBox() + section.pack_start(server_box, False, False, 0) + master_button = Gtk.RadioButton() master_button.props.label = _('Connect to master server') - server_box.pack_start(master_button, expand=False) - discover_button = gtk.RadioButton(master_button) + server_box.pack_start(master_button, False, False, 0) + discover_button = Gtk.RadioButton(master_button) discover_button.props.label = _('Auto discover server in local network') - server_box.pack_start(discover_button, expand=False) + server_box.pack_start(discover_button, False, False, 0) if api_url.value: master_button.props.active = True else: discover_button.props.active = True - server_mode_button = gtk.CheckButton() + server_mode_button = Gtk.CheckButton() server_mode_button.props.label = _('Behave as a Sugar Network server ' 'providing data from mounted device') server_mode_button.props.active = server_mode.value - section.pack_start(server_mode_button, expand=False) + section.pack_start(server_mode_button, False, False, 0) def master_toggled_cb(button, url): api_url.value = url @@ -205,20 +205,20 @@ def _get_bundle_path(self): return env.split('=', 1)[-1] -class _Client(gobject.GObject): +class _Client(GObject.GObject): __gsignals__ = { 'event': ( - gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE, - [str, gobject.TYPE_PYOBJECT]), + GObject.SIGNAL_RUN_FIRST, GObject.TYPE_NONE, + [str, GObject.TYPE_PYOBJECT]), } def __init__(self): - gobject.GObject.__init__(self) + GObject.GObject.__init__(self) self._client = IPCClient() self._subscription = self._client.subscribe() - gobject.io_add_watch(self._subscription.fileno(), - gobject.IO_IN | gobject.IO_HUP, self.__subscription_cb) + GObject.io_add_watch(self._subscription.fileno(), + GObject.IO_IN | GObject.IO_HUP, self.__subscription_cb) def __getattr__(self, name): return getattr(self._client, name) |