Introduce Open Tabs next to Current

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.
This commit is contained in:
Christian Dywan 2008-08-15 20:38:27 +02:00
parent 3b9abe6306
commit 13dc575968
3 changed files with 35 additions and 9 deletions

View 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);
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);

View 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);

View 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;