[Xfce4-commits] <xfce4-settings:master> Pressing Escape/Enter in Layout selection dialog acts as Cancel/Ok correspondingly.

Igor Slepchin noreply at xfce.org
Wed Aug 22 23:14:07 CEST 2012


Updating branch refs/heads/master
         to 3de5f20cca31d8ba8dbbc9db9f189f0b4f4c0d3c (commit)
       from 1a9ef929f30fd8264ca9e996133a4bbceeb1cdf1 (commit)

commit 3de5f20cca31d8ba8dbbc9db9f189f0b4f4c0d3c
Author: Igor Slepchin <igor.slepchin at gmail.com>
Date:   Wed Jul 25 00:25:09 2012 -0400

    Pressing Escape/Enter in Layout selection dialog acts as Cancel/Ok correspondingly.
    
    The old code treated Escape as Ok...

 dialogs/keyboard-settings/keyboard-dialog.glade    |    4 ++--
 dialogs/keyboard-settings/xfce-keyboard-settings.c |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/dialogs/keyboard-settings/keyboard-dialog.glade b/dialogs/keyboard-settings/keyboard-dialog.glade
index 9624960..5a4c9e8 100644
--- a/dialogs/keyboard-settings/keyboard-dialog.glade
+++ b/dialogs/keyboard-settings/keyboard-dialog.glade
@@ -90,8 +90,8 @@
       </object>
     </child>
     <action-widgets>
-      <action-widget response="1">layout_selection_ok_button</action-widget>
-      <action-widget response="0">layout_selection_cancel_button</action-widget>
+      <action-widget response="-5">layout_selection_ok_button</action-widget>
+      <action-widget response="-6">layout_selection_cancel_button</action-widget>
     </action-widgets>
   </object>
   <object class="XfceTitledDialog" id="keyboard-settings-dialog">
diff --git a/dialogs/keyboard-settings/xfce-keyboard-settings.c b/dialogs/keyboard-settings/xfce-keyboard-settings.c
index 778e413..fcddca0 100644
--- a/dialogs/keyboard-settings/xfce-keyboard-settings.c
+++ b/dialogs/keyboard-settings/xfce-keyboard-settings.c
@@ -1677,7 +1677,7 @@ xfce_keyboard_settings_layout_activate_cb (GtkTreeView       *tree_view,
                                            GtkTreeViewColumn *column,
                                            GtkDialog         *dialog)
 {
-  gtk_dialog_response (dialog, 1);
+  gtk_dialog_response (dialog, GTK_RESPONSE_OK);
 }
 
 
@@ -1719,6 +1719,7 @@ xfce_keyboard_settings_layout_selection (XfceKeyboardSettings *settings,
       xkl_config_registry_foreach_layout (settings->priv->xkl_registry,
           (ConfigItemProcessFunc) xfce_keyboard_settings_add_layout_to_list, settings);
       g_signal_connect (GTK_TREE_VIEW (layout_selection_view), "row-activated", G_CALLBACK (xfce_keyboard_settings_layout_activate_cb), keyboard_layout_selection_dialog);
+      gtk_dialog_set_default_response (GTK_DIALOG (keyboard_layout_selection_dialog), GTK_RESPONSE_OK);
     }
 
   model = gtk_tree_view_get_model (GTK_TREE_VIEW (layout_selection_view));
@@ -1831,7 +1832,7 @@ xfce_keyboard_settings_layout_selection (XfceKeyboardSettings *settings,
   val_layout = NULL;
   gtk_widget_show (GTK_WIDGET (keyboard_layout_selection_dialog));
   result = gtk_dialog_run (GTK_DIALOG (keyboard_layout_selection_dialog));
-  if (result)
+  if (result == GTK_RESPONSE_OK)
     {
       gtk_tree_selection_get_selected (selection, &model, &iter);
       gtk_tree_model_get (model, &iter, XKB_AVAIL_LAYOUTS_TREE_ID, &layout,


More information about the Xfce4-commits mailing list