After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 721797 - Hide menu items when unavailable
Hide menu items when unavailable
Status: RESOLVED FIXED
Product: totem
Classification: Core
Component: Movie player
unspecified
Other All
: Normal normal
: ---
Assigned To: General Totem maintainer(s)
General Totem maintainer(s)
Depends on: 688421
Blocks:
 
 
Reported: 2014-01-08 16:03 UTC by Bastien Nocera
Modified: 2014-01-14 19:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: Hide DVD menu items when unavailable (1.84 KB, patch)
2014-01-08 16:03 UTC, Bastien Nocera
committed Details | Review
disc-recorder: Hide menu items when unavailable (2.02 KB, patch)
2014-01-08 16:03 UTC, Bastien Nocera
committed Details | Review
screenshot: Hide menu items when unavailable (1.48 KB, patch)
2014-01-08 16:03 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2014-01-08 16:03:36 UTC
.
Comment 1 Bastien Nocera 2014-01-08 16:03:39 UTC
Created attachment 265716 [details] [review]
main: Hide DVD menu items when unavailable
Comment 2 Bastien Nocera 2014-01-08 16:03:48 UTC
Created attachment 265717 [details] [review]
disc-recorder: Hide menu items when unavailable
Comment 3 Bastien Nocera 2014-01-08 16:03:52 UTC
Created attachment 265718 [details] [review]
screenshot: Hide menu items when unavailable
Comment 4 Philip Withnall 2014-01-10 18:50:23 UTC
Review of attachment 265716 [details] [review]:

::: data/totem.ui
@@ +128,3 @@
 			<attribute name="action">app.eject</attribute>
 			<attribute name="accel">&lt;Ctrl&gt;E</attribute>
+			<attribute name="hidden-when">disabled</attribute>

Shouldn’t that be ‘action-disabled’?
Comment 5 Philip Withnall 2014-01-10 18:52:58 UTC
Review of attachment 265717 [details] [review]:

::: src/plugins/brasero-disc-recorder/totem-disc-recorder.c
@@ +345,3 @@
+	g_menu_item_set_attribute_value (item, "hidden-when",
+					 g_variant_new_string ("action-disabled"));
+	g_menu_append_item (menu, item);

I think you should unref the GMenuItem after appending it.
Comment 6 Philip Withnall 2014-01-10 18:54:30 UTC
Review of attachment 265718 [details] [review]:

::: src/plugins/screenshot/totem-screenshot-plugin.c
@@ +347,1 @@
 	g_menu_append_item (G_MENU (menu), item);

I think the GMenuItems here also need to be unreffed after being appended.
Comment 7 Bastien Nocera 2014-01-14 19:21:18 UTC
Pushed after fixing the review comments.

Attachment 265716 [details] pushed as 803509d - main: Hide DVD menu items when unavailable
Attachment 265717 [details] pushed as 895e533 - disc-recorder: Hide menu items when unavailable
Attachment 265718 [details] pushed as bd01c10 - screenshot: Hide menu items when unavailable