sigviewer icon indicating copy to clipboard operation
sigviewer copied to clipboard

Hotkeydialog

Open Yida-Lin opened this issue 7 years ago • 9 comments

Fix #98

Yida-Lin avatar Jul 01 '17 21:07 Yida-Lin

@cbrnr Ready! Please let me know what do you think! :)

Yida-Lin avatar Jul 01 '17 22:07 Yida-Lin

Thanks @Yida-Lin.

  • I would call the dialog "Keyboard and Mouse Shortcuts"
  • There should be a new menu entry in the Help menu
  • The action should always be enabled, not just if a file is open
  • The keyboard shortcuts are currently hard-coded in the dialog - can you extract them directly from the actions?
  • Zoom in/out all channels is missing
  • The help icon in the toolbar should be the rightmost icon

cbrnr avatar Jul 03 '17 07:07 cbrnr

@cbrnr Hi Clemens,

Ready, except 2 issues:

  • I don't know how to extract mouse wheel event from QKeySequence
  • I don't know how to enable it when not opening a file

Yida-Lin avatar Jul 29 '17 19:07 Yida-Lin

Extracting the key sequences doesn't work like that - the dialog still shows Windows shortcuts on a Mac. I think you could use the shortcut and text methods of a QAction to extract the keyboard shortcut and the name of the action.

cbrnr avatar Jul 31 '17 06:07 cbrnr

@cbrnr hmm QActions are scattered everywhere... It would be difficult to include a bunch of headers just for the dialog. :/ Plus GuiActionCommand::getQActions () is abstract... which makes it even more complicated (need to instantiate a bunch of objects to get all actions, I assume).

I currently use:

#if defined(Q_OS_MACOS)
    QString ctrl = "Cmd";
    QString alt = "Option";
#else
    QString ctrl = "Ctrl";
    QString alt = "Alt";
#endif

Could you please let me know whether it works on a mac?

Yida-Lin avatar Aug 30 '17 05:08 Yida-Lin

Yes, this works on a Mac. Can you please fix these final issues before I merge:

  • "Scale all channels up" and "Scale all channels down" are missing (Shift+Mousewheel Up/Down)
  • Decrease the dialog width and make sure everything fits into the dialog without having to scroll. Currently, there is a horizontal scrollbar because the table view is too wide.
  • The "Close File" shortcut is missing (Cmd+W on a Mac).
  • "Undo" and "Redo" shortcuts are missing (Cmd+Z, Shift+Cmd+Z).
  • The "Exit" shortcut is Cmd+Q on a Mac and not Cmd+F4.
  • Selection in the dialog should be disabled (no need to highlight anything).
  • The dialog should be always enabled (even when there is no file open).

cbrnr avatar Sep 13 '17 07:09 cbrnr

@cbrnr Hi Clemens! :)

All finished and ready to merge! Right before the Graz BCI Conference :)

Yida-Lin avatar Sep 17 '17 03:09 Yida-Lin

Thanks @Yida-Lin. I think we shouldn't make the dialogs fixed size though (see my comment in #104).

cbrnr avatar Sep 18 '17 07:09 cbrnr

@cbrnr Hi Clemens,

Sure. I didn't realize they weren't resizable. Just fixed the problem.

Yida-Lin avatar Sep 18 '17 14:09 Yida-Lin