From: Christian Dywan Date: Tue, 18 May 2010 21:16:14 +0000 (+0200) Subject: Add 'Add to Speed Dial' button to 'Add bookmark' X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a69ba674b1ee19655cc36a5000db6b7bfb1acf8d;p=midori Add 'Add to Speed Dial' button to 'Add bookmark' --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 95463255..3d2bfca4 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -1,5 +1,5 @@ /* - Copyright (C) 2007-2009 Christian Dywan + Copyright (C) 2007-2010 Christian Dywan Copyright (C) 2008 Dale Whittaker Copyright (C) 2009 Jérôme Geulfucci @@ -218,6 +218,9 @@ _action_menus_activate_item_alt (GtkAction* action, guint button, MidoriBrowser* browser); +static void +midori_browser_add_speed_dial (MidoriBrowser* browser); + #define _action_by_name(brwsr, nme) \ gtk_action_group_get_action (brwsr->action_group, nme) #define _action_set_sensitive(brwsr, nme, snstv) \ @@ -687,6 +690,15 @@ midori_browser_edit_bookmark_uri_changed_cb (GtkEntry* entry, || g_str_has_prefix (uri, "javascript:"))); } +static void +midori_browser_edit_bookmark_add_speed_dial_cb (GtkWidget* button, + KatzeItem* bookmark) +{ + MidoriBrowser* browser = midori_browser_get_for_widget (button); + gtk_widget_set_sensitive (button, FALSE); + midori_browser_add_speed_dial (browser); +} + /* Private function, used by MidoriBookmarks and MidoriHistory */ /* static */ void midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, @@ -842,6 +854,21 @@ midori_browser_edit_bookmark_dialog_new (MidoriBrowser* browser, gtk_widget_show_all (hbox); } + if (new_bookmark && !is_folder) + { + hbox = gtk_hbox_new (FALSE, 8); + gtk_container_set_border_width (GTK_CONTAINER (hbox), 1); + label = gtk_label_new (NULL); + gtk_size_group_add_widget (sizegroup, label); + gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); + label = gtk_button_new_with_mnemonic (_("Add to _Speed Dial")); + g_signal_connect (label, "clicked", + G_CALLBACK (midori_browser_edit_bookmark_add_speed_dial_cb), bookmark); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + gtk_container_add (GTK_CONTAINER (content_area), hbox); + gtk_widget_show_all (hbox); + } + hbox = gtk_hbox_new (FALSE, 8); gtk_container_set_border_width (GTK_CONTAINER (hbox), 1); label = gtk_label_new (NULL);