From 43e7edd99ff13d4f92ce6792f1fb1831d705aa3a Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Tue, 24 Jul 2012 18:29:17 +0000 Subject: [PATCH] Infodialog sufficiently large Add easy test of dialogs to dialog.py svn: r20066 --- src/gui/dialog.py | 32 ++++++++++++++++++++++++++++++++ src/gui/glade/dialog.glade | 4 ++++ 2 files changed, 36 insertions(+) diff --git a/src/gui/dialog.py b/src/gui/dialog.py index d4a9ca5d4..83a2072d6 100644 --- a/src/gui/dialog.py +++ b/src/gui/dialog.py @@ -26,6 +26,8 @@ # #------------------------------------------------------------------------- import sys +import logging +_LOG = logging.getLogger(".dialog") #------------------------------------------------------------------------- # @@ -351,3 +353,33 @@ class MessageHideDialog(object): def update_checkbox(self, obj, constant): config.set(constant, obj.get_active()) config.save() + +## Testing function of some of these dialogs +def main(args): + + win = Gtk.Window() + win.set_title('Dialog test window') + win.set_position(Gtk.WindowPosition.CENTER) + def cb(window, event): + Gtk.main_quit() + win.connect('delete-event', cb) + + + def test_info(obj): + InfoDialog('The title', 'This is a lot of info\n to show to all!', parent=win) + + vbox = Gtk.VBox() + win.add(vbox) + + btn1 = Gtk.Button('Info dialog') + btn1.connect('clicked', test_info) + vbox.pack_start(btn1, True, True, 0) + + win.show_all() + Gtk.main() + +if __name__ == '__main__': + import sys + # fall back to root logger for testing + _LOG = logging + sys.exit(main(sys.argv)) diff --git a/src/gui/glade/dialog.glade b/src/gui/glade/dialog.glade index 847bc123f..9fb9a3f41 100644 --- a/src/gui/glade/dialog.glade +++ b/src/gui/glade/dialog.glade @@ -223,12 +223,16 @@ True True etched-in + 300 + 300 308 210 True True + natural + natural False