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 699957 - Make unusable menuitems insensitive
Make unusable menuitems insensitive
Status: RESOLVED FIXED
Product: easytag
Classification: Other
Component: general
master
Other Linux
: Normal normal
: 2.1
Assigned To: EasyTAG maintainer(s)
EasyTAG maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-05-08 21:23 UTC by Kat
Modified: 2014-03-15 21:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix Bug 699957 - Make unusable menuitems insensitive (2.39 KB, patch)
2014-03-15 11:12 UTC, ck Lux
needs-work Details | Review
Fix Bug 699957 - Make unusable menuitems insensitive (2.71 KB, patch)
2014-03-15 11:34 UTC, ck Lux
needs-work Details | Review
update code style (2.12 KB, patch)
2014-03-15 12:43 UTC, ck Lux
committed Details | Review

Description Kat 2013-05-08 21:23:14 UTC
When artist and album view is selected, Collapse Tree and Reload Tree should be insensitive.

When no files are selected, Run Audio Player, Find, Remove Tags, Show Scanner, First File, Previous File, Next File and Last File should be insensitive. This should also be reflected in the toolbar.

When the first or last file is selected, First File and Previous File or Next File and Last File should be insensitive.
Comment 1 David King 2013-05-15 23:04:48 UTC
Partially fixed with commit 3a59cafa31c0e6fcfdb1a79c24b12bf740977121, but this only takes into account whether there are files in the file list, not whether any files are selected.
Comment 2 ck Lux 2014-03-15 11:12:50 UTC
Created attachment 271992 [details] [review]
Fix Bug 699957 - Make unusable menuitems insensitive
Comment 3 David King 2014-03-15 11:28:17 UTC
Review of attachment 271992 [details] [review]:

The patch does not apply to master for me, can you rebase against the current master? At the same time, please generate a git-formatted patch with "git format-patch".
Comment 4 ck Lux 2014-03-15 11:34:40 UTC
Created attachment 271994 [details] [review]
Fix Bug 699957 - Make unusable menuitems insensitive
Comment 5 ck Lux 2014-03-15 11:35:18 UTC
Is it worked this time ?
Comment 6 David King 2014-03-15 11:50:29 UTC
Review of attachment 271994 [details] [review]:

Seems to work fine, just some style comments.

::: src/bar.h
@@ +109,3 @@
 #define AM_ALBUM_OPEN_FILE_WITH     "AlbumOpenFile"
 
+#define AM_ARTIST_VIEW_MODE         "ArtistViewMode"

This define already exists in the same file, so you do not need to add it again.

::: src/easytag.c
@@ +3675,3 @@
 void Update_Command_Buttons_Sensivity (void)
 {
+    GtkWidget* artist_radio;

As this variable is only used in a single block (later in the patch), move the declaration to the block.

@@ +3877,3 @@
+
+        artist_radio = gtk_ui_manager_get_widget (UIManager,
+                                              "/ToolBar/ArtistViewMode");

Odd indentation. The quote should be underneath the 'U'.

@@ +3879,3 @@
+                                              "/ToolBar/ArtistViewMode");
+
+        if (gtk_toggle_tool_button_get_active (GTK_TOGGLE_TOOL_BUTTON (artist_radio))) {

Put the brace on the next line, underneath the "if".

@@ +3882,3 @@
+            ui_widget_set_sensitive (MENU_VIEW, AM_COLLAPSE_TREE, FALSE);
+            ui_widget_set_sensitive (MENU_VIEW, AM_INITIALIZE_TREE, FALSE);
+        } else {

Split this into:

}
else
{
Comment 7 ck Lux 2014-03-15 12:43:33 UTC
Created attachment 271999 [details] [review]
update code style
Comment 8 David King 2014-03-15 21:04:16 UTC
Comment on attachment 271999 [details] [review]
update code style

Thanks for the patch, I pushed it to master as commit 61eddd3d0b97c172e6dad193b4626aa2001e49d6.