From 5acfb94f9dc86f20bdef55371cb97aab26792483 Mon Sep 17 00:00:00 2001 From: Michiel Nauta Date: Fri, 3 Jun 2011 15:33:29 +0000 Subject: [PATCH] Make InfoDialog non modal svn: r17680 --- src/QuestionDialog.py | 11 +++++------ src/glade/questiondialog.glade | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/QuestionDialog.py b/src/QuestionDialog.py index 36eab87a0..9bc7e34d6 100644 --- a/src/QuestionDialog.py +++ b/src/QuestionDialog.py @@ -240,7 +240,7 @@ class OkDialog(gtk.MessageDialog): class InfoDialog(object): """ - Dialog to show selectable info in a scrolled window + Non modal dialog to show selectable info in a scrolled window """ def __init__(self, msg1, infotext, parent=None): self.xml = Glade(toplevel='infodialog') @@ -260,13 +260,12 @@ class InfoDialog(object): if parent: self.top.set_transient_for(parent) + self.top.connect('response', self.destroy) self.top.show() - self.response = self.top.run() - #no matter how it finishes, destroy dialog - self.top.destroy() - def get_response(self): - return self.response + def destroy(self, dialog, response_id): + #no matter how it finishes, destroy dialog + dialog.destroy() class MissingMediaDialog(object): def __init__(self, msg1, msg2, task1, task2, task3, parent=None): diff --git a/src/glade/questiondialog.glade b/src/glade/questiondialog.glade index 10d19d648..5f2beacfb 100644 --- a/src/glade/questiondialog.glade +++ b/src/glade/questiondialog.glade @@ -470,7 +470,7 @@ end - gtk-ok + gtk-close True True True @@ -494,7 +494,7 @@ - button182 + button182