Blob Blame Raw
From ebfe7e07c42b0052ecd27c1889f3a0a29976ec63 Mon Sep 17 00:00:00 2001
From: Jakub Filak <jfilak@redhat.com>
Date: Fri, 18 Jul 2014 12:20:06 +0200
Subject: [PATCH 7/8] gui: apply configuration dialogues changes on Enter key

Related to rhbz#1067123

Signed-off-by: Jakub Filak <jfilak@redhat.com>
---
 src/gtk-helpers/event_config_dialog.c    | 3 +++
 src/gtk-helpers/workflow_config_dialog.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/src/gtk-helpers/event_config_dialog.c b/src/gtk-helpers/event_config_dialog.c
index cfd7433..3cc111c 100644
--- a/src/gtk-helpers/event_config_dialog.c
+++ b/src/gtk-helpers/event_config_dialog.c
@@ -122,6 +122,7 @@ static void add_option_to_table(gpointer data, gpointer user_data)
                              /*left,top:*/ 0, last_row,
                              /*width,height:*/ 1, 1);
             option_input = gtk_entry_new();
+            gtk_entry_set_activates_default(GTK_ENTRY(option_input), TRUE);
             gtk_widget_set_hexpand(option_input, TRUE);
             if (option->eo_value != NULL)
                 gtk_entry_set_text(GTK_ENTRY(option_input), option->eo_value);
@@ -331,6 +332,8 @@ config_dialog_t *create_event_config_dialog(const char *event_name, GtkWindow *p
 
     free(window_title);
 
+    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
+
     /* Allow resize?
      * W/o resize, e.g. upload configuration hint looks awfully
      * line wrapped.
diff --git a/src/gtk-helpers/workflow_config_dialog.c b/src/gtk-helpers/workflow_config_dialog.c
index 6c4d77c..d55f2f0 100644
--- a/src/gtk-helpers/workflow_config_dialog.c
+++ b/src/gtk-helpers/workflow_config_dialog.c
@@ -94,6 +94,8 @@ config_dialog_t *create_workflow_config_dialog(const char *workflow_name, GtkWin
 
     free(window_title);
 
+    gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_APPLY);
+
     gtk_window_set_resizable(GTK_WINDOW(dialog), true);
     gtk_window_set_default_size(GTK_WINDOW(dialog), 450, 450);
 
-- 
1.9.3