GNOME Bugzilla – Bug 735260
Print dialogs(!) could be open more than one at the same time
Last modified: 2014-09-15 20:31:54 UTC
The “Print current…” and “Print multiple…” entries should not be activable when one of the dialog is already displayed. We can for now open multiple dialogs of each at the same time (yeah, I know, playing with multiple windows modal/transient/other at the same time is fun; and you could open the about dialog, one time, for more diversity).
Created attachment 284310 [details] [review] Disallow printing actions when the "print current" dialog is shown. Simple patch for when the “Print current…” dialog is shown. I have no idea how to do so with the “Print multiple…” dialog.
Comment on attachment 284310 [details] [review] Disallow printing actions when the "print current" dialog is shown. Pushed as e7faa83 I'm not marking this as 'Fixed' since print multiple should follow the same behaviour
Created attachment 284875 [details] [review] Disallow printing actions when the "print multiple" dialog is shown. Here is the second patch. I used a signal, that’s the easiest way I think, dealing with how the dialog is constructed.
Review of attachment 284875 [details] [review]: This patch fails when a user is on New game screen, and he selects 'Print Multiple Puzzles', prints some puzzles, and closes the dialog. 'Print current puzzle' is then set to active, which shouldn't be, because it's the new game screen. It should be set to its previous value instead.
Created attachment 285030 [details] [review] Disallow printing when the "print multiple" dialog is shown. (In reply to comment #4) > This patch fails when a user is on New game screen, and he selects 'Print > Multiple Puzzles', prints some puzzles, and closes the dialog. > 'Print current puzzle' is then set to active, which shouldn't be, because it's > the new game screen. Yeah, good catch. > It should be set to its previous value instead. Nope, you could do weird things like going from one sudoku to the new-game screen to another sudoku (or back) during the time the dialog is shown… =) I ensured all is working as expected in all cases, see the patch.
Review of attachment 285030 [details] [review]: Works well. ::: src/gnome-sudoku.vala @@ +39,3 @@ private bool show_possibilities = false; + private bool print_multiple_dialog_visible = false; Is this really needed? Can't you simply disable the action when opening the dialog, and reenable the action when closing it? @@ +339,3 @@ undo_redo_box.visible = true; header_bar.set_subtitle (header_bar_subtitle); + print_action.set_enabled (!print_multiple_dialog_visible); Methinks print current puzzle should always be forbidden on the new game screen, right? This looks like an unrelated issue for a different patch, but it should be flipped from always true to always false, right?
(In reply to comment #5) > Nope, you could do weird things like going from one sudoku to the new-game > screen to another sudoku (or back) during the time the dialog is shown… =) I > ensured all is working as expected in all cases, see the patch. The dialog should also be modal (to prevent using the main window at all while it's open); can you fix that too please?
Created attachment 285443 [details] [review] Disallow printing when the "print multiple" dialog is shown. Here is a patch using a modal dialog. Remains some bugs when you first open the about dialog and after one of the print dialogs, but they are probably not important, and are impossible to correct sans a move of many translated strings…
Review of attachment 285443 [details] [review]: Thinking about this some more, I think disabling actions is overaggressive. Other GNOME programs do not do this. I've certainly never seen About disabled before. Instead, let's just make it so that activating the action again when the dialog is already open is a no-op.
(In reply to comment #9) > Thinking about this some more, I think disabling actions is overaggressive. > Other GNOME programs do not do this. I've certainly never seen About disabled > before. Many GNOME programs have bugs because they accept to open multiple modal/transient dialogs at the same time, yeah. That’s a general design issue. > Instead, let's just make it so that activating the action again when the dialog > is already open is a no-op. I don’t see the good thing in having a menu action that does nothing visible. I could only unactivate the two print actions (hidden as submenu entries), if you prefer not touching the about one for now…
I think we should do whatever other GNOME apps are doing, and that's not disabling actions. Let's punt this to usability team since you have a point that it's weird the menu item does nothing.
Created attachment 285516 [details] [review] Disallow printing actions when the "print multiple" dialog is shown. Here is the minimal patch, that should be pushed before the hard code freeze, so that the two printing actions use the same behavior. It doesn’t solve the problems arount the About dialog, and only unactivates the two actions in the "Print…" submenu.
Review of attachment 285516 [details] [review]: I know it's odd that you can open multiple modal dialogs at the same time, and mutter and GTK+ do not handle this very well at all, but I don't think disabling actions when a modal dialog is open is a good solution. So I don't really like this, but IS what we do for the print current puzzle dialog, and it'd be good to be consistent.
Attachment 285516 [details] pushed as ac6c022 - Disallow printing actions when the "print multiple" dialog is shown.