keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
20.07k stars 1.42k forks source link

MainWindow: move shortcuts from .cpp to .ui file + change Clone Entry shortcut #10903

Closed c4rlo closed 3 weeks ago

c4rlo commented 3 weeks ago

Where possible, move shortcuts from being defined in MainWindow.cpp to being defined in MainWindow.ui. Previously, there was a seemingly random mix of both practices.

The only shortcuts defined in the .cpp file are now ones that can't be defined in the .ui file, because they are in some way conditional.

This also reduces the number of compiler warnings of the kind

warning: arithmetic between different enumeration types ‘Qt::Modifier’ and ‘Qt::Key’ is deprecated [-Wdeprecated-enum-enum-conversion]

with recent GCC versions.

And some minor code cleanups in MainWindow.cpp.

Also, change the shortcut for the Clone Entry shortcut from Ctrl+K to Ctrl+D (see discussion below).

Testing strategy

Type of change

droidmonkey commented 3 weeks ago

You need to mark all the shortcuts in .ui as not translatable

c4rlo commented 3 weeks ago

You need to mark all the shortcuts in .ui as not translatable

Ok, done.