From a3ab258819cebe707e987b75b74486f159b8fd75 Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Thu, 4 Aug 2011 23:45:57 +0200 Subject: [PATCH] Don't show startup preference in private browsing Introduce sokoke_is_app_or_private helper function. --- midori/midori-preferences.c | 3 +++ midori/midori-view.c | 3 +-- midori/sokoke.c | 6 ++++++ midori/sokoke.h | 3 +++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index de4f30d8..d03b98ee 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -291,6 +291,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences, #define SPANNED_ADD(__widget) \ katze_preferences_add_widget (_preferences, __widget, "spanned") /* Page "General" */ + if (sokoke_is_app_or_private ()) + { PAGE_NEW (GTK_STOCK_HOME, _("Startup")); FRAME_NEW (NULL); label = katze_property_label (settings, "load-on-startup"); @@ -314,6 +316,7 @@ midori_preferences_set_settings (MidoriPreferences* preferences, G_CALLBACK (midori_preferences_homepage_current_clicked_cb), settings); SPANNED_ADD (button); } + } /* Page "Appearance" */ PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Fonts")); diff --git a/midori/midori-view.c b/midori/midori-view.c index b0b163ae..23d86dda 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2589,8 +2589,7 @@ midori_view_populate_popup (MidoriView* view, gtk_action_group_get_action (actions, "BookmarkAdd")); gtk_menu_shell_append (menu_shell, menuitem); - if (!midori_view_is_blank (view) - && strcmp ("/", sokoke_set_config_dir (NULL))) + if (!midori_view_is_blank (view) && sokoke_is_app_or_private ()) { menuitem = sokoke_action_create_popup_menu_item ( gtk_action_group_get_action (actions, "AddSpeedDial")); diff --git a/midori/sokoke.c b/midori/sokoke.c index 9969a869..c60c930e 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -1625,6 +1625,12 @@ sokoke_set_config_dir (const gchar* new_config_dir) return config_dir; } +gboolean +sokoke_is_app_or_private (void) +{ + return strcmp ("/", sokoke_set_config_dir (NULL)); +} + /** * sokoke_remove_path: * @path: an absolute path diff --git a/midori/sokoke.h b/midori/sokoke.h index 2632b14b..350667c8 100644 --- a/midori/sokoke.h +++ b/midori/sokoke.h @@ -217,6 +217,9 @@ sokoke_register_stock_items (void); const gchar* sokoke_set_config_dir (const gchar* new_config_dir); +gboolean +sokoke_is_app_or_private (void); + gboolean sokoke_remove_path (const gchar* path, gboolean ignore_errors); -- 2.39.5