GNOME Bugzilla – Bug 699957
Make unusable menuitems insensitive
Last modified: 2014-03-15 21:05:03 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.
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.
Created attachment 271992 [details] [review] Fix Bug 699957 - Make unusable menuitems insensitive
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".
Created attachment 271994 [details] [review] Fix Bug 699957 - Make unusable menuitems insensitive
Is it worked this time ?
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 {
Created attachment 271999 [details] [review] update code style
Comment on attachment 271999 [details] [review] update code style Thanks for the patch, I pushed it to master as commit 61eddd3d0b97c172e6dad193b4626aa2001e49d6.