diff options
author | Sebastien Estienne <sebastien.estienne@gmail.com> | 2007-09-22 14:50:25 +0000 |
---|---|---|
committer | Sebastien Estienne <sebastien.estienne@gmail.com> | 2007-09-22 14:50:25 +0000 |
commit | 86598900afd14e0cbbd2abcac02ae8c992a6277b (patch) | |
tree | 58ed909498c2ff7cec8857eae5c6d3c5ef83f0e2 /src | |
parent | c65e644f69232f96d173335d90d1890428dc6e90 (diff) |
add basic support for printer thanx to Jason Whitlark
add support for different kind of message (error, warning, info)
fix emacs encoding settings
git-svn-id: file:///home/lennart/svn/public/service-discovery-applet/trunk@141 3be567f1-68ff-0310-b24a-ad7cc433fd2f
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/pluginutils.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/modules/pluginutils.py b/src/modules/pluginutils.py index f1e0ea4..d775b38 100644 --- a/src/modules/pluginutils.py +++ b/src/modules/pluginutils.py @@ -1,4 +1,4 @@ -# -*- coding: UTF-8 -*- +# -*- coding: utf-8 -*- # -*- python -*- # Copyright (C) 2005 by Sebastien Estienne # @@ -18,8 +18,12 @@ import gtk pygtk.require('2.0') def error_msg(msg): + message(msg, "error") + +def message(msg, type="info"): + msg_type = eval("gtk.MESSAGE_%s" % type.upper()) d = gtk.MessageDialog(parent=None, flags=gtk.DIALOG_MODAL, - type=gtk.MESSAGE_ERROR, buttons=gtk.BUTTONS_OK) + type=msg_type, buttons=gtk.BUTTONS_OK) d.set_markup(msg) d.show_all() d.run() |