[gnome-commander] search: make ENTER activate the default dialog button (find)



commit 8f34c766d86b66315769124f443c12b0797394dc
Author: Piotr Eljasiak <epiotr src gnome org>
Date:   Sat Aug 20 20:44:49 2011 +0200

    search: make ENTER activate the default dialog button (find)

 src/dialogs/gnome-cmd-search-dialog.cc       |    2 ++
 src/gnome-cmd-selection-profile-component.cc |   10 +++++++---
 src/gnome-cmd-selection-profile-component.h  |    2 ++
 3 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index 6a2b1e4..9588597 100755
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -1173,6 +1173,8 @@ GnomeCmdSearchDialog::GnomeCmdSearchDialog(GnomeCmdData::SearchConfig &cfg): def
 
     priv->profile_component->set_content_patterns_history(defaults.content_patterns.ents);
 
+    priv->profile_component->set_default_activation(*this);
+
     gtk_widget_show_all (button);
     gtk_widget_show (*priv->profile_component);
 
diff --git a/src/gnome-cmd-selection-profile-component.cc b/src/gnome-cmd-selection-profile-component.cc
index adc0993..950f5ba 100755
--- a/src/gnome-cmd-selection-profile-component.cc
+++ b/src/gnome-cmd-selection-profile-component.cc
@@ -199,9 +199,6 @@ GnomeCmdSelectionProfileComponent::GnomeCmdSelectionProfileComponent(GnomeCmdDat
 
     g_signal_connect (priv->filter_type_combo, "changed", G_CALLBACK (Private::on_filter_type_changed), this);
     g_signal_connect (priv->find_text_check, "toggled", G_CALLBACK (Private::on_find_text_toggled), this);
-
-    g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (priv->pattern_combo)), "activate", G_CALLBACK (gtk_window_activate_default), this);
-    g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (priv->find_text_combo)), "activate", G_CALLBACK (gtk_window_activate_default), this);
 }
 
 
@@ -257,3 +254,10 @@ void GnomeCmdSelectionProfileComponent::set_content_patterns_history(GList *hist
 
     g_list_foreach (history, (GFunc) combo_box_insert_text, priv->find_text_combo);
 }
+
+
+void GnomeCmdSelectionProfileComponent::set_default_activation(GtkWindow *w)
+{
+    g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (priv->pattern_combo)), "activate", G_CALLBACK (gtk_window_activate_default), w);
+    g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (priv->find_text_combo)), "activate", G_CALLBACK (gtk_window_activate_default), w);
+}
diff --git a/src/gnome-cmd-selection-profile-component.h b/src/gnome-cmd-selection-profile-component.h
index 153d053..dcd64be 100755
--- a/src/gnome-cmd-selection-profile-component.h
+++ b/src/gnome-cmd-selection-profile-component.h
@@ -57,6 +57,8 @@ struct GnomeCmdSelectionProfileComponent
 
     void set_name_patterns_history(GList *history);
     void set_content_patterns_history(GList *history);
+
+    void set_default_activation(GtkWindow *w);
 };
 
 #endif // __GNOME_CMD_SELECTION_PROFILE_COMPONENT_H__



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