[gtk+] gtkplacessidebar: Fix new tab/window handling for cloud accounts
- From: Carlos Soriano <csoriano src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtkplacessidebar: Fix new tab/window handling for cloud accounts
- Date: Mon, 13 Nov 2017 15:58:45 +0000 (UTC)
commit 1b1cb8295b680772ce1eb17e8584fcab93ef5388
Author: Carlos Soriano <csoriano gnome org>
Date: Mon Oct 30 21:47:07 2017 +0100
gtkplacessidebar: Fix new tab/window handling for cloud accounts
It wasn't taking into account whether the sidebar had support for them
or not, resulting in a file chooser with open in new tab/window menu
items when it's not supported.
To fix it, do as with the other menus and check for the availability of
new tab/window flags.
https://bugzilla.gnome.org/show_bug.cgi?id=786123
gtk/gtkplacessidebar.c | 20 ++++++++++++--------
1 files changed, 12 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 92b3806..247d1b4 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -3568,14 +3568,18 @@ build_popup_menu_using_gmenu (GtkSidebarRow *row)
g_menu_item_set_action_and_target_value (item, "row.open",
g_variant_new_int32 (GTK_PLACES_OPEN_NORMAL));
g_menu_append_item (menu, item);
- item = g_menu_item_new (_("Open in New _Tab"), "row.open-other");
- g_menu_item_set_action_and_target_value (item, "row.open-other",
- g_variant_new_int32 (GTK_PLACES_OPEN_NEW_TAB));
- g_menu_append_item (menu, item);
- item = g_menu_item_new (_("Open in New _Window"), "row.open-other");
- g_menu_item_set_action_and_target_value (item, "row.open-other",
- g_variant_new_int32 (GTK_PLACES_OPEN_NEW_WINDOW));
- g_menu_append_item (menu, item);
+ if (sidebar->open_flags & GTK_PLACES_OPEN_NEW_TAB)
+ {
+ item = g_menu_item_new (_("Open in New _Tab"), "row.open-other");
+ g_menu_item_set_action_and_target_value (item, "row.open-other",
g_variant_new_int32(GTK_PLACES_OPEN_NEW_TAB));
+ g_menu_append_item (menu, item);
+ }
+ if (sidebar->open_flags & GTK_PLACES_OPEN_NEW_WINDOW)
+ {
+ item = g_menu_item_new (_("Open in New _Window"), "row.open-other");
+ g_menu_item_set_action_and_target_value (item, "row.open-other",
g_variant_new_int32(GTK_PLACES_OPEN_NEW_WINDOW));
+ g_menu_append_item (menu, item);
+ }
cloud_provider_menu = cloud_providers_account_get_menu_model (cloud_provider_account);
cloud_provider_action_group = cloud_providers_account_get_action_group (cloud_provider_account);
if (cloud_provider_menu != NULL && cloud_provider_action_group != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]