-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable merge button when db is locked. #1881
Disable merge button when db is locked. #1881
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one comment
bool inDatabaseTabWidget = (currentIndex == DatabaseTabScreen); | ||
bool inWelcomeWidget = (currentIndex == WelcomeScreen); | ||
bool inDatabaseTabWidgetOrWelcomeWidget = inDatabaseTabWidget || inWelcomeWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this condition always true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we have 4 option for the currentIndex
keepassxc/src/gui/MainWindow.h
Line 50 in dd246f1
enum StackedWidgetIndex |
@droidmonkey I managed to add a unit test after all! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
@louib can you rebase this? |
@TheZ3ro will do! |
@TheZ3ro looks like it's already up-to-date with |
@louib github tells me that |
Related to #1875
Description
This patch disables the merge button when the current database is locked.
Motivation and context
Attempting to merge the database when the db is locked can cause database corruption, as stated in #1875
How has this been tested?
Locally. Had a hard time writing unit tests for the GUI.
Types of changes
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]