diff options
author | Daniel Francis <francis@sugarlabs.org> | 2013-01-02 23:39:34 (GMT) |
---|---|---|
committer | Daniel Francis <francis@sugarlabs.org> | 2013-01-02 23:39:34 (GMT) |
commit | cb6082321b3c54eb1fc69900f68d4827bf061ee9 (patch) | |
tree | d4d8c67acced7754dd36066741f669273040f9cc /alerts.py | |
parent | 1265546eda5b8ba30a5e430c50ad08f15b31c692 (diff) |
Port to Gtk3
Signed-off-by: Daniel Francis <francis@sugarlabs.org>
Diffstat (limited to 'alerts.py')
-rw-r--r-- | alerts.py | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -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): |