diff --git a/midori/midori-browser.c b/midori/midori-browser.c index 59691503..c0ae46d2 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -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); diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 5b86cd99..c9035dc2 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -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); diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c index 5d83ed46..21146ebe 100644 --- a/midori/midori-websettings.c +++ b/midori/midori-websettings.c @@ -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;