From: Christian Dywan Date: Tue, 11 Oct 2011 00:48:47 +0000 (+0200) Subject: Only show close in speed dial if it can be saved X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2f40eee0a504be86a1d2dd106f23db5c8f957426;p=midori Only show close in speed dial if it can be saved And un-negate return value of sokoke_is_app_or_private(). --- diff --git a/midori/midori-preferences.c b/midori/midori-preferences.c index 4d4a771d..59ade73c 100644 --- a/midori/midori-preferences.c +++ b/midori/midori-preferences.c @@ -296,7 +296,7 @@ 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 ()) + if (!sokoke_is_app_or_private ()) { PAGE_NEW (GTK_STOCK_HOME, _("Startup")); FRAME_NEW (NULL); diff --git a/midori/midori-view.c b/midori/midori-view.c index 80fd9d24..8e2086ca 100644 --- a/midori/midori-view.c +++ b/midori/midori-view.c @@ -2609,7 +2609,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) && sokoke_is_app_or_private ()) + 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")); @@ -3332,6 +3332,12 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings, view->middle_click_opens_selection = g_value_get_boolean (&value); else if (name == g_intern_string ("open-tabs-in-the-background")) view->open_tabs_in_the_background = g_value_get_boolean (&value); + else if (name == g_intern_string ("enable-scripts")) + { + /* Speed dial is only editable with scripts, so regenerate it */ + if (midori_view_is_blank (view)) + midori_view_reload (view, FALSE); + } g_value_unset (&value); } @@ -3740,8 +3746,12 @@ prepare_speed_dial_html (MidoriView* view) /* percent width size of one slot */ slot_size = (100 / grid_index); + /* No editing in private/ app mode or without scripts */ g_string_append_printf (markup, + "%s%s" "\n", + sokoke_is_app_or_private () ? "" : "", slot_size + 1, slot_size - 4); while (slot <= slot_count) diff --git a/midori/sokoke.c b/midori/sokoke.c index 1ed09cc6..707490a9 100644 --- a/midori/sokoke.c +++ b/midori/sokoke.c @@ -1633,7 +1633,7 @@ sokoke_set_config_dir (const gchar* new_config_dir) gboolean sokoke_is_app_or_private (void) { - return strcmp ("/", sokoke_set_config_dir (NULL)); + return !strcmp ("/", sokoke_set_config_dir (NULL)); } /**