[Xfce4-commits] [panel-plugins/xfce4-smartbookmark-plugin] 01/01: Fix value changes saving in prefs dialog (#12666)

noreply at xfce.org noreply at xfce.org
Wed Jun 29 21:00:23 CEST 2016


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

landry pushed a commit to branch master
in repository panel-plugins/xfce4-smartbookmark-plugin.

commit 4ef680fdfea8cc7967ae5c1b2f28f1de9f11c00d
Author: Landry Breuil <landry at xfce.org>
Date:   Wed Jun 29 20:58:51 2016 +0200

    Fix value changes saving in prefs dialog (#12666)
    
    Connect the callbacks to the 'changed' signal instead of the 'activate' signal which
    is only called upon Enter. This way, the label is updated live on the panel,
    and the url is properly saved when exiting the prefs dialog.
---
 src/smartbookmark.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/smartbookmark.c b/src/smartbookmark.c
index 752514d..f6c35c2 100644
--- a/src/smartbookmark.c
+++ b/src/smartbookmark.c
@@ -97,16 +97,16 @@ static gboolean do_search(const char *url, const char *keyword)
 
 
 /* callback: apply the new value to the url string */
-static void url_entry_activate_cb(GtkWidget *widget, t_search *search)
+static void url_entry_changed_cb(GtkWidget *widget, t_search *search)
 {
-    DBG ("Activate url_entry");
+    DBG ("url_entry_changed_cb");
     search->url = g_strdup(gtk_entry_get_text(GTK_ENTRY(search->url_entry)));
 }
 
 /* callback: apply the new value to the label_text string */
-static void text_entry_activate_cb(GtkWidget *widget, t_search *search)
+static void text_entry_changed_cb(GtkWidget *widget, t_search *search)
 {
-    DBG ("text_entry_activate_cb");
+    DBG ("text_entry_changed_cb");
     search->label_text = g_strdup(gtk_entry_get_text(GTK_ENTRY(search->label_entry)));
     gtk_label_set_text(GTK_LABEL(search->label), search->label_text);
 }
@@ -278,7 +278,7 @@ static void search_create_options(XfcePanelPlugin *plugin, t_search *search)
     if(search->label_text)
         gtk_entry_set_text(GTK_ENTRY(search->label_entry), search->label_text);
     //DBG("connect signal");
-    g_signal_connect (GTK_WIDGET(search->label_entry), "activate", G_CALLBACK (text_entry_activate_cb), search);
+    g_signal_connect (GTK_WIDGET(search->label_entry), "changed", G_CALLBACK (text_entry_changed_cb), search);
 
     /* Hide label option */
     search->hide_check = gtk_switch_new();
@@ -308,7 +308,7 @@ static void search_create_options(XfcePanelPlugin *plugin, t_search *search)
     /* url field */
     if(search->url!=NULL)
         gtk_entry_set_text(GTK_ENTRY(search->url_entry), search->url);
-    g_signal_connect (GTK_WIDGET(search->url_entry), "activate", G_CALLBACK (url_entry_activate_cb), search);
+    g_signal_connect (GTK_WIDGET(search->url_entry), "changed", G_CALLBACK (url_entry_changed_cb), search);
     gtk_grid_attach(GTK_GRID(grid), GTK_WIDGET(search->url_entry), 1, 2, 2, 1);
 
     gtk_widget_show_all(search->opt_dialog);

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list