[gnome-tweak-tool] make extension uninstall dialog modal
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-tweak-tool] make extension uninstall dialog modal
- Date: Tue, 26 Mar 2013 22:32:31 +0000 (UTC)
commit 7e2c2c95aa0c8222b78bf555f92f8c722c2d54f6
Author: John Stowers <john stowers gmail com>
Date: Sun Mar 24 21:23:46 2013 +0100
make extension uninstall dialog modal
gtweak/tweakmodel.py | 1 +
gtweak/tweaks/tweak_shell_extensions.py | 4 +++-
gtweak/tweakview.py | 1 +
3 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtweak/tweakmodel.py b/gtweak/tweakmodel.py
index c0f7b13..97cce66 100644
--- a/gtweak/tweakmodel.py
+++ b/gtweak/tweakmodel.py
@@ -42,6 +42,7 @@ TWEAK_SORT_LAST = 1e3
LOG = logging.getLogger(__name__)
class Tweak:
+ main_window = None
def __init__(self, name, description, **options):
self.name = name
self.description = description
diff --git a/gtweak/tweaks/tweak_shell_extensions.py b/gtweak/tweaks/tweak_shell_extensions.py
index 9070530..63d8743 100644
--- a/gtweak/tweaks/tweak_shell_extensions.py
+++ b/gtweak/tweaks/tweak_shell_extensions.py
@@ -87,7 +87,9 @@ class _ShellExtensionTweak(Tweak):
if os.path.exists(path):
first_message = _("Delete an extension")
second_message = _("Do you want to delete the extension ")+name+"?"
- dialog = Gtk.MessageDialog(None,0,type=Gtk.MessageType.QUESTION,
+ dialog = Gtk.MessageDialog(
+ self.main_window,0,
+ type=Gtk.MessageType.QUESTION,
buttons=Gtk.ButtonsType.YES_NO,
message_format=first_message)
dialog.format_secondary_text(second_message)
diff --git a/gtweak/tweakview.py b/gtweak/tweakview.py
index 480e96e..ac8ae45 100644
--- a/gtweak/tweakview.py
+++ b/gtweak/tweakview.py
@@ -75,6 +75,7 @@ class TweakView:
#add all tweaks
self._tweak_vbox = builder.get_object('tweak_vbox')
for t in sorted(self._model.tweaks, key=_sort_tweak_widgets_by_widget_type):
+ t.main_window = self._main_window
self._tweak_vbox.pack_start(t.widget, False, False, 0)
t.set_notify_cb(self._on_tweak_notify)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]