commit-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Commit-gnuradio] [gnuradio] 21/43: grc: Default button in save dialog i


From: git
Subject: [Commit-gnuradio] [gnuradio] 21/43: grc: Default button in save dialog is now 'save' instead of 'close without saving'
Date: Thu, 2 Apr 2015 19:15:51 +0000 (UTC)

This is an automated email from the git hooks/post-receive script.

jcorgan pushed a commit to branch master
in repository gnuradio.

commit 212982ca906b136ab0e4bb7bb47b5588c75de61a
Author: Ethan Trewhitt <address@hidden>
Date:   Wed Feb 18 12:36:00 2015 -0500

    grc: Default button in save dialog is now 'save' instead of 'close without 
saving'
---
 grc/gui/Dialogs.py    | 4 +++-
 grc/gui/MainWindow.py | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/grc/gui/Dialogs.py b/grc/gui/Dialogs.py
index cf0ca02..e1fc680 100644
--- a/grc/gui/Dialogs.py
+++ b/grc/gui/Dialogs.py
@@ -116,7 +116,7 @@ class TextDisplay(gtk.TextView):
         menu.show_all()
         return False
 
-def MessageDialogHelper(type, buttons, title=None, markup=None, 
extra_buttons=None):
+def MessageDialogHelper(type, buttons, title=None, markup=None, 
default_response=None, extra_buttons=None):
     """
     Create a modal message dialog and run it.
 
@@ -128,6 +128,7 @@ def MessageDialogHelper(type, buttons, title=None, 
markup=None, extra_buttons=No
     Args:
         title: the title of the window (string)
         markup: the message text with pango markup
+        default_response: if set, determines which button is highlighted by 
default
         extra_buttons: a tuple containing pairs of values; each value is the 
button's text and the button's return value
 
     Returns:
@@ -137,6 +138,7 @@ def MessageDialogHelper(type, buttons, title=None, 
markup=None, extra_buttons=No
     if title: message_dialog.set_title(title)
     if markup: message_dialog.set_markup(markup)
     if extra_buttons: message_dialog.add_buttons(*extra_buttons)
+    if default_response: message_dialog.set_default_response(default_response)
     response = message_dialog.run()
     message_dialog.destroy()
     return response
diff --git a/grc/gui/MainWindow.py b/grc/gui/MainWindow.py
index f26f30e..2d48504 100644
--- a/grc/gui/MainWindow.py
+++ b/grc/gui/MainWindow.py
@@ -351,7 +351,7 @@ class MainWindow(gtk.Window):
         )
         return MessageDialogHelper(
             gtk.MESSAGE_QUESTION, gtk.BUTTONS_NONE, 'Unsaved Changes!',
-            'Would you like to save changes before closing?', buttons
+            'Would you like to save changes before closing?', gtk.RESPONSE_OK, 
buttons
         )
 
     def _get_files(self):



reply via email to

[Prev in Thread] Current Thread [Next in Thread]