From a40cd75d14a34d0c47c73cee394d4271a0b7ef7f Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Tue, 28 Apr 2009 23:52:16 +0200 Subject: [PATCH] Add new transfer preferences and new Applications tab --- midori/midori-preferences.c | 100 ++++++++++++++++++++---------------- 1 file changed, 56 insertions(+), 44 deletions(-) diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index c85760c5..530de62e 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -327,6 +327,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, GtkWidget* entry; GtkWidget* hbox; gint icon_width, icon_height; + gchar* program; g_return_if_fail (MIDORI_IS_PREFERENCES (preferences)); g_return_if_fail (MIDORI_IS_WEB_SETTINGS (settings)); @@ -421,55 +422,19 @@ midori_preferences_set_settings (MidoriPreferences* preferences, button = katze_property_proxy (settings, "show-crash-dialog", NULL); SPANNED_ADD (button, 0, 2, 2, 3); FRAME_NEW (_("Transfers")); - TABLE_NEW (4, 2); - #if WEBKIT_CHECK_VERSION (1, 1, 3) + TABLE_NEW (2, 2); label = katze_property_label (settings, "download-folder"); INDENTED_ADD (label, 0, 1, 0, 1); button = katze_property_proxy (settings, "download-folder", "folder"); FILLED_ADD (button, 1, 2, 0, 1); - #endif - label = katze_property_label (settings, "download-manager"); + label = katze_property_proxy (settings, "ask-for-destination-folder", NULL); + gtk_widget_set_sensitive (label, FALSE); INDENTED_ADD (label, 0, 1, 1, 2); - hbox = gtk_hbox_new (FALSE, 4); - button = gtk_image_new (); - gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), - GTK_ICON_SIZE_MENU, &icon_width, &icon_height); - gtk_widget_set_size_request (button, icon_width, icon_height); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); - entry = katze_property_proxy (settings, "download-manager", NULL); - gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); - proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); - g_signal_connect (entry, "focus-out-event", - G_CALLBACK (proxy_download_manager_icon_cb), button); - FILLED_ADD (hbox, 1, 2, 1, 2); - label = katze_property_label (settings, "text-editor"); - INDENTED_ADD (label, 0, 1, 2, 3); - hbox = gtk_hbox_new (FALSE, 4); - button = gtk_image_new (); - gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), - GTK_ICON_SIZE_MENU, &icon_width, &icon_height); - gtk_widget_set_size_request (button, icon_width, icon_height); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); - entry = katze_property_proxy (settings, "text-editor", NULL); - gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); - proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); - g_signal_connect (entry, "focus-out-event", - G_CALLBACK (proxy_download_manager_icon_cb), button); - FILLED_ADD (hbox, 1, 2, 2, 3); - label = katze_property_label (settings, "news-aggregator"); - INDENTED_ADD (label, 0, 1, 3, 4); - hbox = gtk_hbox_new (FALSE, 4); - button = gtk_image_new (); - gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), - GTK_ICON_SIZE_MENU, &icon_width, &icon_height); - gtk_widget_set_size_request (button, icon_width, icon_height); - gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); - entry = katze_property_proxy (settings, "news-aggregator", NULL); - gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); - proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); - g_signal_connect (entry, "focus-out-event", - G_CALLBACK (proxy_download_manager_icon_cb), button); - FILLED_ADD (hbox, 1, 2, 3, 4); + button = katze_property_proxy (settings, "notify-transfer-completed", NULL); + if (!((program = g_find_program_in_path ("notify-send")))) + gtk_widget_set_sensitive (button, FALSE); + g_free (program); + SPANNED_ADD (button, 1, 2, 1, 2); /* Page "Appearance" */ PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Appearance")); @@ -592,6 +557,53 @@ midori_preferences_set_settings (MidoriPreferences* preferences, button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL); WIDGET_ADD (button, 1, 2, 5, 6); + /* Page "Applications" */ + PAGE_NEW (GTK_STOCK_CONVERT, _("Applications")); + FRAME_NEW (_("External applications")); + TABLE_NEW (3, 2); + label = katze_property_label (settings, "text-editor"); + INDENTED_ADD (label, 0, 1, 0, 1); + hbox = gtk_hbox_new (FALSE, 4); + button = gtk_image_new (); + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), + GTK_ICON_SIZE_MENU, &icon_width, &icon_height); + gtk_widget_set_size_request (button, icon_width, icon_height); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); + entry = katze_property_proxy (settings, "text-editor", NULL); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); + g_signal_connect (entry, "focus-out-event", + G_CALLBACK (proxy_download_manager_icon_cb), button); + FILLED_ADD (hbox, 1, 2, 0, 1); + label = katze_property_label (settings, "download-manager"); + INDENTED_ADD (label, 0, 1, 1, 2); + hbox = gtk_hbox_new (FALSE, 4); + button = gtk_image_new (); + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), + GTK_ICON_SIZE_MENU, &icon_width, &icon_height); + gtk_widget_set_size_request (button, icon_width, icon_height); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); + entry = katze_property_proxy (settings, "download-manager", NULL); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); + g_signal_connect (entry, "focus-out-event", + G_CALLBACK (proxy_download_manager_icon_cb), button); + FILLED_ADD (hbox, 1, 2, 1, 2); + label = katze_property_label (settings, "news-aggregator"); + INDENTED_ADD (label, 0, 1, 2, 3); + hbox = gtk_hbox_new (FALSE, 4); + button = gtk_image_new (); + gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (button), + GTK_ICON_SIZE_MENU, &icon_width, &icon_height); + gtk_widget_set_size_request (button, icon_width, icon_height); + gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 4); + entry = katze_property_proxy (settings, "news-aggregator", NULL); + gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0); + proxy_download_manager_icon_cb (entry, NULL, GTK_IMAGE (button)); + g_signal_connect (entry, "focus-out-event", + G_CALLBACK (proxy_download_manager_icon_cb), button); + FILLED_ADD (hbox, 1, 2, 2, 3); + /* Page "Network" */ PAGE_NEW (GTK_STOCK_NETWORK, _("Network")); FRAME_NEW (_("Network"));