summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbendikro <bro.devel+deluge@gmail.com>2019-11-05 15:45:30 +0100
committerCalum Lind <calumlind+deluge@gmail.com>2020-04-23 17:17:20 +0100
commit1e3c624613d7fbea8449b95ffff6d3104a9312c0 (patch)
tree173c2b4be70ec70503b624586a6f80978872659a
parent3519f341d474b09f7c0660724e4f6b970e8a6a7c (diff)
downloaddeluge-1e3c624613d7fbea8449b95ffff6d3104a9312c0.zip
deluge-1e3c624613d7fbea8449b95ffff6d3104a9312c0.tar.gz
deluge-1e3c624613d7fbea8449b95ffff6d3104a9312c0.tar.bz2
[GTK] Destroy the dialog before running the callback
Currently, the dialog window is displayed until after the callback has returned. The result is that if a new dialog is opened from the callback, the first dialog is still displayed until the new dialog is destroyed. Fix by destroying the dialog before running the callback.
-rw-r--r--deluge/ui/gtk3/dialogs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/deluge/ui/gtk3/dialogs.py b/deluge/ui/gtk3/dialogs.py
index 5169ab4..deea105 100644
--- a/deluge/ui/gtk3/dialogs.py
+++ b/deluge/ui/gtk3/dialogs.py
@@ -72,12 +72,12 @@ class BaseDialog(Gtk.Dialog):
self.vbox.show_all()
def _on_delete_event(self, widget, event):
- self.deferred.callback(Gtk.ResponseType.DELETE_EVENT)
self.destroy()
+ self.deferred.callback(Gtk.ResponseType.DELETE_EVENT)
def _on_response(self, widget, response):
- self.deferred.callback(response)
self.destroy()
+ self.deferred.callback(response)
def run(self):
"""
@@ -110,6 +110,8 @@ class YesNoDialog(BaseDialog):
(_('_No'), Gtk.ResponseType.NO, _('_Yes'), Gtk.ResponseType.YES),
parent,
)
+ # Use the preferred size calculated from the content
+ self.set_default_size(-1, -1)
class InformationDialog(BaseDialog):