]> spindle.queued.net Git - midori/commitdiff
Show script, image and plugin options and views source in app menu
authorChristian Dywan <christian@twotoasts.de>
Mon, 26 Oct 2009 17:07:10 +0000 (18:07 +0100)
committerChristian Dywan <christian@twotoasts.de>
Mon, 26 Oct 2009 17:08:54 +0000 (18:08 +0100)
midori/midori-browser.c
midori/midori-preferences.c
midori/midori-view.c

index 7355377d1deeed27673653f6f4e811d86028a264..e675dcf8b9ab0d42c5922c06b1ef24e171775c5b 100644 (file)
@@ -2920,8 +2920,9 @@ _action_compact_menu_populate_popup (GtkAction*     action,
       #if HAVE_HILDON
       { "Find" },
       { "Homepage" },
-      { "ManageSearchEngines" },
+      { "SourceView" },
       #else
+      { "ManageSearchEngines" },
       { "Print" },
       { "PrivateBrowsing" },
       { NULL },
@@ -2930,12 +2931,15 @@ _action_compact_menu_populate_popup (GtkAction*     action,
       { "Statusbar" },
       { NULL },
       { "-" },
-      #endif
       { "ClearPrivateData" },
-      #if !HAVE_HILDON
       { "Fullscreen" },
       #endif
       { "Preferences" },
+      #if HAVE_HILDON
+      { "auto-load-images" },
+      { "enable-scripts" },
+      { "enable-plugins" },
+      #endif
     };
     guint i;
 
@@ -2954,14 +2958,19 @@ _action_compact_menu_populate_popup (GtkAction*     action,
         if (!actions[i].name)
             continue;
         _action = _action_by_name (browser, actions[i].name);
-        label = katze_object_get_string (_action, "label");
-        button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+        if (_action)
+        {
+            label = katze_object_get_string (_action, "label");
+            button = hildon_gtk_button_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
+            gtk_button_set_label (GTK_BUTTON (button), label);
+            gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
+            g_free (label);
+            g_signal_connect_swapped (button, "clicked",
+                G_CALLBACK (gtk_action_activate), _action);
+        }
+        else
+            button = katze_property_proxy (browser->settings, actions[i].name, NULL);
         gtk_widget_show (button);
-        gtk_button_set_label (GTK_BUTTON (button), label);
-        gtk_button_set_use_underline (GTK_BUTTON (button), TRUE);
-        g_free (label);
-        g_signal_connect_swapped (button, "clicked",
-            G_CALLBACK (gtk_action_activate), _action);
         hildon_app_menu_append (HILDON_APP_MENU (menu), GTK_BUTTON (button));
         #else
         GtkWidget* menuitem;
index 2a8256e5565d1f77cf04c8012790e495d270c04b..c32a46f37489af6ef2c7e69239b5c1c02df52a62 100644 (file)
@@ -371,10 +371,12 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     /* Page "Behavior" */
     PAGE_NEW (GTK_STOCK_SELECT_COLOR, _("Behavior"));
     FRAME_NEW (_("Features"));
+    #if !HAVE_HILDON
     button = katze_property_proxy (settings, "auto-load-images", NULL);
     gtk_button_set_label (GTK_BUTTON (button), _("Load images automatically"));
     gtk_widget_set_tooltip_text (button, _("Load and display images automatically"));
     INDENTED_ADD (button);
+    #endif
     #if WEBKIT_CHECK_VERSION (1, 1, 15) || HAVE_HILDON
     if (katze_object_get_boolean (gtk_settings, "gtk-touchscreen-mode"))
         button = katze_property_proxy (settings, "kinetic-scrolling", NULL);
@@ -388,6 +390,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
     #endif
     SPANNED_ADD (button);
+    #if !HAVE_HILDON
     button = katze_property_proxy (settings, "enable-scripts", NULL);
     gtk_button_set_label (GTK_BUTTON (button), _("Enable scripts"));
     gtk_widget_set_tooltip_text (button, _("Enable embedded scripting languages"));
@@ -396,7 +399,6 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     gtk_button_set_label (GTK_BUTTON (button), _("Enable Netscape plugins"));
     gtk_widget_set_tooltip_text (button, _("Enable embedded Netscape plugin objects"));
     SPANNED_ADD (button);
-    #if !HAVE_HILDON
     button = katze_property_proxy (settings, "enforce-96-dpi", NULL);
     gtk_button_set_label (GTK_BUTTON (button), _("Enforce 96 dots per inch"));
     gtk_widget_set_tooltip_text (button, _("Enforce a video dot density of 96 DPI"));
@@ -443,13 +445,15 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     INDENTED_ADD (label);
     button = katze_property_proxy (settings, "open-external-pages-in", NULL);
     SPANNED_ADD (button);
+    #if !HAVE_HILDON
     button = katze_property_proxy (settings, "always-show-tabbar", NULL);
     INDENTED_ADD (button);
-    button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
+    button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
     SPANNED_ADD (button);
+    #endif
     button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
     INDENTED_ADD (button);
-    button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
+    button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
     SPANNED_ADD (button);
 
     #if !HAVE_HILDON
index 23b9d7bf43b21cbc5659ebb445a0c6c785dc8212..2f8bedc099e21b1eead1f7d2c38632912cab1aec 100644 (file)
@@ -2017,6 +2017,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
         menuitem = sokoke_action_create_popup_menu_item (
                 gtk_action_group_get_action (actions, "SaveAs"));
         gtk_menu_shell_append (menu_shell, menuitem);
+        #if !HAVE_HILDON
         /* Currently views that don't support source, don't support
            saving either. If that changes, we need to think of something. */
         if (!midori_view_can_view_source (view))
@@ -2024,6 +2025,7 @@ webkit_web_view_populate_popup_cb (WebKitWebView* web_view,
         menuitem = sokoke_action_create_popup_menu_item (
                 gtk_action_group_get_action (actions, "SourceView"));
         gtk_menu_shell_append (menu_shell, menuitem);
+        #endif
     }
 
     gtk_widget_show_all (menu);