Return in adblock filter entry should Add the filter
This commit is contained in:
parent
24310fd4e9
commit
da8983b09f
1 changed files with 4 additions and 1 deletions
|
@ -344,7 +344,8 @@ static void
|
||||||
adblock_preferences_add_clicked_cb (GtkWidget* button,
|
adblock_preferences_add_clicked_cb (GtkWidget* button,
|
||||||
GtkTreeModel* model)
|
GtkTreeModel* model)
|
||||||
{
|
{
|
||||||
GtkEntry* entry = g_object_get_data (G_OBJECT (button), "entry");
|
GtkEntry* entry = GTK_IS_ENTRY (button)
|
||||||
|
? button : g_object_get_data (G_OBJECT (button), "entry");
|
||||||
gtk_list_store_insert_with_values (GTK_LIST_STORE (model),
|
gtk_list_store_insert_with_values (GTK_LIST_STORE (model),
|
||||||
NULL, 0, 0, gtk_entry_get_text (entry), -1);
|
NULL, 0, 0, gtk_entry_get_text (entry), -1);
|
||||||
gtk_entry_set_text (entry, "");
|
gtk_entry_set_text (entry, "");
|
||||||
|
@ -534,6 +535,8 @@ adblock_get_preferences_dialog (MidoriExtension* extension)
|
||||||
g_object_set_data (G_OBJECT (button), "entry", entry);
|
g_object_set_data (G_OBJECT (button), "entry", entry);
|
||||||
g_signal_connect (button, "clicked",
|
g_signal_connect (button, "clicked",
|
||||||
G_CALLBACK (adblock_preferences_add_clicked_cb), liststore);
|
G_CALLBACK (adblock_preferences_add_clicked_cb), liststore);
|
||||||
|
g_signal_connect (entry, "activate",
|
||||||
|
G_CALLBACK (adblock_preferences_add_clicked_cb), liststore);
|
||||||
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
||||||
button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
|
button = gtk_button_new_from_stock (GTK_STOCK_EDIT);
|
||||||
g_object_set_data (G_OBJECT (button), "treeview", treeview);
|
g_object_set_data (G_OBJECT (button), "treeview", treeview);
|
||||||
|
|
Loading…
Reference in a new issue