Don't show startup preference in private browsing

Introduce sokoke_is_app_or_private helper function.
This commit is contained in:
Christian Dywan 2011-08-04 23:45:57 +02:00
parent 761ef8c4e6
commit a3ab258819
4 changed files with 13 additions and 2 deletions

View file

@ -291,6 +291,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
#define SPANNED_ADD(__widget) \ #define SPANNED_ADD(__widget) \
katze_preferences_add_widget (_preferences, __widget, "spanned") katze_preferences_add_widget (_preferences, __widget, "spanned")
/* Page "General" */ /* Page "General" */
if (sokoke_is_app_or_private ())
{
PAGE_NEW (GTK_STOCK_HOME, _("Startup")); PAGE_NEW (GTK_STOCK_HOME, _("Startup"));
FRAME_NEW (NULL); FRAME_NEW (NULL);
label = katze_property_label (settings, "load-on-startup"); 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); G_CALLBACK (midori_preferences_homepage_current_clicked_cb), settings);
SPANNED_ADD (button); SPANNED_ADD (button);
} }
}
/* Page "Appearance" */ /* Page "Appearance" */
PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Fonts")); PAGE_NEW (GTK_STOCK_SELECT_FONT, _("Fonts"));

View file

@ -2589,8 +2589,7 @@ midori_view_populate_popup (MidoriView* view,
gtk_action_group_get_action (actions, "BookmarkAdd")); gtk_action_group_get_action (actions, "BookmarkAdd"));
gtk_menu_shell_append (menu_shell, menuitem); gtk_menu_shell_append (menu_shell, menuitem);
if (!midori_view_is_blank (view) if (!midori_view_is_blank (view) && sokoke_is_app_or_private ())
&& strcmp ("/", sokoke_set_config_dir (NULL)))
{ {
menuitem = sokoke_action_create_popup_menu_item ( menuitem = sokoke_action_create_popup_menu_item (
gtk_action_group_get_action (actions, "AddSpeedDial")); gtk_action_group_get_action (actions, "AddSpeedDial"));

View file

@ -1625,6 +1625,12 @@ sokoke_set_config_dir (const gchar* new_config_dir)
return config_dir; return config_dir;
} }
gboolean
sokoke_is_app_or_private (void)
{
return strcmp ("/", sokoke_set_config_dir (NULL));
}
/** /**
* sokoke_remove_path: * sokoke_remove_path:
* @path: an absolute path * @path: an absolute path

View file

@ -217,6 +217,9 @@ sokoke_register_stock_items (void);
const gchar* const gchar*
sokoke_set_config_dir (const gchar* new_config_dir); sokoke_set_config_dir (const gchar* new_config_dir);
gboolean
sokoke_is_app_or_private (void);
gboolean gboolean
sokoke_remove_path (const gchar* path, sokoke_remove_path (const gchar* path,
gboolean ignore_errors); gboolean ignore_errors);