]> spindle.queued.net Git - midori/commitdiff
Introduce Open Tabs next to Current
authorChristian Dywan <christian@twotoasts.de>
Fri, 15 Aug 2008 18:38:27 +0000 (20:38 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 15 Aug 2008 18:38:27 +0000 (20:38 +0200)
At the same time make Open popups in tabs readonly
and hide it in the Preferences, as well as
Open new pages in and the whole Privacy page.

midori/midori-browser.c
midori/midori-preferences.c
midori/midori-websettings.c

index 596915038d867c4613197e959611d6ad529735bd..c0ae46d2ab7a8765f1483379408c410b140cf53f 100644 (file)
@@ -1032,9 +1032,16 @@ _midori_browser_add_tab (MidoriBrowser* browser,
     g_signal_connect (close_button, "clicked",
         G_CALLBACK (midori_browser_tab_close_clicked), widget);
 
-    n = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
-    gtk_notebook_insert_page (GTK_NOTEBOOK (browser->notebook), scrolled,
-                              event_box, n + 1);
+    if (sokoke_object_get_boolean (browser->settings, "open-tabs-next-to-current"))
+    {
+        n = gtk_notebook_get_current_page (GTK_NOTEBOOK (browser->notebook));
+        gtk_notebook_insert_page (GTK_NOTEBOOK (browser->notebook), scrolled,
+                                  event_box, n + 1);
+    }
+    else
+        gtk_notebook_append_page (GTK_NOTEBOOK (browser->notebook), scrolled,
+                                  event_box);
+
     #if GTK_CHECK_VERSION(2, 10, 0)
     gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (browser->notebook),
                                       scrolled, TRUE);
index 5b86cd9910e709056893cdf16c0484ad577dfc80..c9035dc2cab2a568894220255989546cc2df1985 100644 (file)
@@ -386,15 +386,17 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     SPANNED_ADD (button, 1, 2, 2, 3);
     FRAME_NEW(_("Browsing"));
     TABLE_NEW (3, 2);
-    label = katze_property_label (settings, "open-new-pages-in");
+    /* label = katze_property_label (settings, "open-new-pages-in");
     INDENTED_ADD (label, 0, 1, 0, 1);
     button = katze_property_proxy (settings, "open-new-pages-in", NULL);
-    FILLED_ADD (button, 1, 2, 0, 1);
+    FILLED_ADD (button, 1, 2, 0, 1); */
     button = katze_property_proxy (settings, "middle-click-opens-selection", NULL);
     INDENTED_ADD (button, 0, 1, 1, 2);
     button = katze_property_proxy (settings, "open-tabs-in-the-background", NULL);
     SPANNED_ADD (button, 1, 2, 1, 2);
-    button = katze_property_proxy (settings, "open-popups-in-tabs", NULL);
+    /* button = katze_property_proxy (settings, "open-popups-in-tabs", NULL);
+    SPANNED_ADD (button, 0, 1, 2, 3);*/
+    button = katze_property_proxy (settings, "open-tabs-next-to-current", NULL);
     SPANNED_ADD (button, 0, 1, 2, 3);
     button = katze_property_proxy (settings, "close-buttons-on-tabs", NULL);
     SPANNED_ADD (button, 1, 2, 2, 3);
@@ -417,7 +419,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     FILLED_ADD (hbox, 1, 2, 1, 2);
 
     /* Page "Privacy" */
-    PAGE_NEW (_("Privacy"));
+    /* PAGE_NEW (_("Privacy"));
     FRAME_NEW (_("Web Cookies"));
     TABLE_NEW (3, 2);
     label = katze_property_label (settings, "accept-cookies");
@@ -447,7 +449,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     button = katze_property_proxy (settings, "remember-last-form-inputs", NULL);
     SPANNED_ADD (button, 0, 2, 1, 2);
     button = katze_property_proxy (settings, "remember-last-downloaded-files", NULL);
-    SPANNED_ADD (button, 0, 2, 2, 3);
+    SPANNED_ADD (button, 0, 2, 2, 3); */
 
     gtk_box_pack_start (GTK_BOX (GTK_DIALOG (preferences)->vbox),
                         preferences->notebook, FALSE, FALSE, 4);
index 5d83ed4683b3706dd1199e744a1dc016ee96ef51..21146ebeb04b5cbed097b0715b194f62b5794620 100644 (file)
@@ -51,6 +51,7 @@ struct _MidoriWebSettings
     MidoriNewPage open_new_pages_in;
     gboolean middle_click_opens_selection;
     gboolean open_tabs_in_the_background;
+    gboolean open_tabs_next_to_current;
     gboolean open_popups_in_tabs;
 
     MidoriAcceptCookies accept_cookies;
@@ -103,6 +104,7 @@ enum
     PROP_OPEN_NEW_PAGES_IN,
     PROP_MIDDLE_CLICK_OPENS_SELECTION,
     PROP_OPEN_TABS_IN_THE_BACKGROUND,
+    PROP_OPEN_TABS_NEXT_TO_CURRENT,
     PROP_OPEN_POPUPS_IN_TABS,
 
     PROP_ACCEPT_COOKIES,
@@ -487,6 +489,15 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      FALSE,
                                      flags));
 
+    g_object_class_install_property (gobject_class,
+                                     PROP_OPEN_TABS_NEXT_TO_CURRENT,
+                                     g_param_spec_boolean (
+                                     "open-tabs-next-to-current",
+                                     _("Open Tabs next to Current"),
+                                     _("Whether to open new tabs next to the current tab or after the last one"),
+                                     TRUE,
+                                     flags));
+
     g_object_class_install_property (gobject_class,
                                      PROP_OPEN_POPUPS_IN_TABS,
                                      g_param_spec_boolean (
@@ -494,7 +505,7 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      _("Open popups in tabs"),
                                      _("Whether to open popup windows in tabs"),
                                      TRUE,
-                                     flags));
+                                     G_PARAM_READABLE));
 
 
 
@@ -736,6 +747,9 @@ midori_web_settings_set_property (GObject*      object,
     case PROP_OPEN_TABS_IN_THE_BACKGROUND:
         web_settings->open_tabs_in_the_background = g_value_get_boolean (value);
         break;
+    case PROP_OPEN_TABS_NEXT_TO_CURRENT:
+        web_settings->open_tabs_next_to_current = g_value_get_boolean (value);
+        break;
     case PROP_OPEN_POPUPS_IN_TABS:
         web_settings->open_popups_in_tabs = g_value_get_boolean (value);
         break;
@@ -871,6 +885,9 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_OPEN_TABS_IN_THE_BACKGROUND:
         g_value_set_boolean (value, web_settings->open_tabs_in_the_background);
         break;
+    case PROP_OPEN_TABS_NEXT_TO_CURRENT:
+        g_value_set_boolean (value, web_settings->open_tabs_next_to_current);
+        break;
     case PROP_OPEN_POPUPS_IN_TABS:
         g_value_set_boolean (value, web_settings->open_popups_in_tabs);
         break;