Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/alerts.py
diff options
context:
space:
mode:
authorDaniel Francis <francis@sugarlabs.org>2013-01-02 23:39:34 (GMT)
committer Daniel Francis <francis@sugarlabs.org>2013-01-02 23:39:34 (GMT)
commitcb6082321b3c54eb1fc69900f68d4827bf061ee9 (patch)
treed4d8c67acced7754dd36066741f669273040f9cc /alerts.py
parent1265546eda5b8ba30a5e430c50ad08f15b31c692 (diff)
Port to Gtk3
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'alerts.py')
-rw-r--r--alerts.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/alerts.py b/alerts.py
index 7f90efb..a83460a 100644
--- a/alerts.py
+++ b/alerts.py
@@ -1,4 +1,4 @@
-# Copyright (C) 2012 S. Daniel Francis <francis@sugarlabs.org>
+# Copyright (C) 2012-2013 S. Daniel Francis <francis@sugarlabs.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,29 +15,29 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
-import gtk
+from gi.repository import Gtk
-import pynotify
+from gi.repository import Notify
import info
-pynotify.init(info.name)
+Notify.init(info.name)
-class Alert(gtk.MessageDialog):
+class Alert(Gtk.MessageDialog):
def __init__(self, parent, title, content, mtype):
- gtk.MessageDialog.__init__(self, parent, gtk.DIALOG_MODAL,
+ GObject.GObject.__init__(self, parent, Gtk.DialogFlags.MODAL,
type=mtype,
- buttons=gtk.BUTTONS_OK)
+ buttons=Gtk.ButtonsType.OK)
self.set_markup('<b>%s</b>' % title)
self.format_secondary_markup(content)
def run(self):
- gtk.MessageDialog.run(self)
- gtk.MessageDialog.destroy(self)
+ Gtk.MessageDialog.run(self)
+ Gtk.MessageDialog.destroy(self)
-class NotifyAlert(pynotify.Notification):
+class NotifyAlert(Notify.Notification):
def __init__(self, parent, title, content, icon, timeout):
- pynotify.Notification.__init__(self, title, message=content, icon=icon)
+ Notify.Notification.__init__(self, title, message=content, icon=icon)
self.set_timeout(timeout)
def run(self):