cutter
cutter copied to clipboard
Tab management using keyboard and mouse shortcuts
Is your feature request related to a problem? Please describe.
Currently, there is no easy way to control the tabs in Cutter from the keyboard
Describe the solution you'd like
I want to apply a set of keyboard shortcuts to manage tabs in Cutter:
- Ctrl+Tab - Jump to the next open tab
- Ctrl+Shift+Tab -J ump to the previous open tab
- Ctrl+W - Close the current tab
- Ctrl+T - Duplicate current tab
- Ctrl+Shift+T - Reopen previously closed tabs in the order they were closed
Mouse shortcut - Mouse middle click on a tab will close it
Hello, I would like to pick up this issue if possible. Thanks.
Sure thing! Go ahead :) Let us know how you progress and if you have any questions. You can discuss it with us here or on our Telegram or IRC channels.
Hi, as a part of this issue I have made some changes to make it easier to develop using Docker. Shall I create a new issue for these changes or just create a separate pull request?
Just create a separate pull request.
@0x24D Your commits for docker look very good. Please open a separated Pull Request for it.
p.s don't forget to sign up for Hacktoberfest and get a neat T-shirt for your PRs :)
Hey @0x24d :) do you have any progress yet? want us to have a look?
I haven't really had much time to work on this after making the Docker changes. Am I correct in thinking it is the CutterDockWidget class where I should be catching the keyPress and mousePress events?
Am I correct in thinking it is the CutterDockWidget class where I should be catching the keyPress and mousePress events?
For most of them probably yes. Reopening closed tab would better be done at global level.
Okay, great. I was going to do the reopening closed tabs one last as I wasn't sure how it should be done.
I have updated CutterDockWidget to catch the QKeyEvent on keyPress and keyRelease but in the respective methods event
seems to be uninitialised, see: https://github.com/0x24D/cutter/commit/2072fb335b6f0810b162cb8b7847695f0b1688f8#diff-16c4d34007c0d4874105b8a5329706abR96-R97
After building Cutter, whenever I press a key with the dock widget in focus and line 97 uncommented, the program segfaults. I ran the program with Valgrind and it states that event is uninitialised. Any thoughts?
Did you checked the callstack? Qt shouldn't be doing that. Maybe one of CutterDockWidget subclasses is calling parent method with incorrect argument.
Even if it didn't crash I don't think you should be handling keypress events in this situation manually but use QAction or QShortcut instead which already implement the logic for handling multikey shortcuts. Even more - when possible you should use methods that accept StandardKey like void QAction::setShortcuts(QKeySequence::StandardKey key) instead of specifying keys explicitly.
Hi,
Apologies that this has taken as long as it has done. I have just finished implementing the first three keyboard shortcuts and would like some feedback on what I have done, what could be improved, etc.
Please find my changes here: https://github.com/radareorg/cutter/compare/master...0x24D:issue-1730-tab-management. Some of the changes are due to running AStyle.
I have currently got an issue with the 'jump to previous tab' shortcut, as the QAction shortcut is not being caught when pressed - although the other two shortcuts are fine.
HEy 0x24d, thanks for the follow-up! I appreciate it highly.
Would you mind sending this as a work-in-progress PR? Also, it would be easier for us to reveiew before applying astyle
Yes I can do. Do you want me to revert the AStyle commit first?
yeah, please, this should be the final commit :)
Bumping this issue, special thanks @0x24D for making working solution, I had to compile against it to make work with cutter easier. Can we revive this issue?
upd. unfortunately it stops working, when you get rid of all unnecessary windows from info section.