GNOME Bugzilla – Bug 629136
Close button activated despite nothing to close
Last modified: 2018-06-29 22:44:24 UTC
Created attachment 169827 [details] Screenshot when I do File->new->new File and 'Abort', the Close button becomes activated again. See attachement
This only happens when you have a book open (which causes the 'Close' button to be sensitive), then hit 'File->New File' and then 'Cancel'. If you start with --nofile then the 'Close' button is not sensitive and remains so after you cancel the 'New File' dialog. I'll see if I can fix it
Created attachment 249852 [details] [review] Proposed fix So, it turns out the sensitivity of the close button is handled by gnc_main_window_switch_page(), which makes it insensitive when the page is immutable. However, that function is obviously not called when you hit 'File -> New File' and cancel it, so the close button sensitivity doesn't get updated. One way to fix this is to move the code responsible for updating the close button sensitiveness to gnc_main_window_generate_title, where the sensitivity of the save button is handled. Having that as a side-effect of an unrelated function is certainly not the most elegant solution, but since the sensitivity of the save button is already handled there, I thought I'd give it a try and see what others think.
Created attachment 249891 [details] [review] Proposed fix Revert a comment change I did because I thought iff was a typo
Comment on attachment 249891 [details] [review] Proposed fix Thanks for the patch and sorry for the delay. The change looks good and it is great that it fixes this bug.
Comment on attachment 249891 [details] [review] Proposed fix r23132, thanks!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=629136. Please update any external references or bookmarks.