Add 'Last open tabs' option to Clear Private Data

Fixes: https://bugs.launchpad.net/midori/+bug/814739
This commit is contained in:
Christian Dywan 2011-07-24 21:41:47 +02:00
parent c277857ea4
commit 22a7862654
3 changed files with 16 additions and 0 deletions

View file

@ -2571,6 +2571,7 @@ main (int argc,
GList* data_items = sokoke_register_privacy_item (NULL, NULL, NULL);
gchar* clear_data = katze_object_get_string (settings, "clear-data");
midori_remove_config_file (clear_prefs, MIDORI_CLEAR_SESSION, "session.xbel");
midori_remove_config_file (clear_prefs, MIDORI_CLEAR_HISTORY, "history.db");
midori_remove_config_file (clear_prefs, MIDORI_CLEAR_TRASH, "tabtrash.xbel");

View file

@ -4293,6 +4293,15 @@ midori_browser_clear_private_data_response_cb (GtkWidget* dialog,
GString* clear_data = g_string_new (NULL);
g_object_get (browser->settings, "clear-private-data", &saved_prefs, NULL);
button = g_object_get_data (G_OBJECT (dialog), "session");
if (gtk_toggle_button_get_active (button))
{
GList* tabs = gtk_container_get_children (GTK_CONTAINER (browser->notebook));
for (; tabs != NULL; tabs = g_list_next (tabs))
gtk_widget_destroy (tabs->data);
g_list_free (tabs);
clear_prefs |= MIDORI_CLEAR_SESSION;
}
button = g_object_get_data (G_OBJECT (dialog), "history");
if (gtk_toggle_button_get_active (button))
{
@ -4394,6 +4403,11 @@ _action_clear_private_data_activate (GtkAction* action,
vbox = gtk_vbox_new (TRUE, 4);
alignment = gtk_alignment_new (0, 0, 1, 1);
gtk_alignment_set_padding (GTK_ALIGNMENT (alignment), 0, 6, 12, 0);
button = gtk_check_button_new_with_mnemonic (_("Last open _tabs"));
if ((clear_prefs & MIDORI_CLEAR_SESSION) == MIDORI_CLEAR_SESSION)
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
g_object_set_data (G_OBJECT (dialog), "session", button);
gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, TRUE, 0);
/* i18n: Browsing history, visited web pages */
button = gtk_check_button_new_with_mnemonic (_("_History"));
if ((clear_prefs & MIDORI_CLEAR_HISTORY) == MIDORI_CLEAR_HISTORY)

View file

@ -44,6 +44,7 @@ enum
MIDORI_CLEAR_TRASH = 16,
MIDORI_CLEAR_ON_QUIT = 32,
MIDORI_CLEAR_WEB_CACHE = 64, /* deprecated */
MIDORI_CLEAR_SESSION = 128,
};
typedef enum