-
-
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
KeePassX PR Migration: #78 Inline Messages #162
Conversation
e56727e
to
d5e2aa5
Compare
wow this looks amazing! |
d5e2aa5
to
bbddd3f
Compare
cbd172c
to
15e25a9
Compare
src/CMakeLists.txt
Outdated
@@ -86,9 +86,11 @@ set(keepassx_SOURCES | |||
gui/FileDialog.cpp | |||
gui/IconModels.cpp | |||
gui/KeePass1OpenWidget.cpp | |||
gui/kmessagewidget.cpp |
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.
Shouldn't the filename also be PascalCase, even though this is the original filename?
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.
I think it should, but I left it as is, because that was the original file name. I guess I'll change it.
src/gui/MainWindow.cpp
Outdated
|
||
void MainWindow::displayTabMessage(const QString& text, MessageWidget::MessageType type) | ||
{ | ||
//if (m_ui->stackedWidget->currentIndex() == 0) { |
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.
This condition could be removed if no longer used.
|
||
void DatabaseWidget::hideMessage() | ||
{ | ||
if (m_messageWidget->isVisible()) { |
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.
Why not add the isVisible()
condition in MessageWidget::hide
and call m_messageWidget->hide()
directly? This code is also repeated in EditWidget.cpp
@@ -104,6 +104,7 @@ MainWindow::MainWindow() | |||
#endif | |||
|
|||
setWindowIcon(filePath()->applicationIcon()); | |||
m_ui->globalMessageWidget->setHidden(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.
Looks like most of the time the MessageWidget instances are hidden when initialized. The setHidden(true)
could be moved in the MessageWidget's constructor (since there is no .ui file for the widget).
Tested this branch locally (global message, tab message and entry message). Works great! Good job @pgalves! I think there's a Don't know how much work that would imply, but it could be cool to hide the message after a certain amount of time. |
Thanks for the review @louib! Before we merge this, I will also have a look if all former MessageBoxes are still covered in develop. |
b988968
to
8ffb86c
Compare
(https://github.com/torvalds/subsurface, commit: 82a946152b7f1da177344937acbc9d3cb5b0ccbf). Added MessageWidget class.
DatabaseOpenWidget.
inline MessageWidget in ChangeMasterKeyWidget.
EditWidget and in UnlockDatabaseWidget. Add missing method to show Information Message.
Chnage to one method to set MessageWidget text passing type as parameter. Only messages with questions requiring user input reamin using MessageBox dialog. Use signal/slots to set message in MessageWidget and hide message, signal/slots only used when required.Maybe need to change all calls to signals/slots in the future.
8ffb86c
to
83b9cc4
Compare
@louib I fixed a few things, but I think I'll leave the rest as is. I don't want to touch the widget's source code much, since those changes would be gone when we update it in the future. |
@phoerious do you want to address the remaining MessageBox in |
83b9cc4
to
94f8650
Compare
I was thinking about it. But a) I would need to get a reference to the MainWindow somehow and b) nobody will ever see that error message except for when either you have no Internet connection or Google ist down. I figured it wasn't really worth the effort right now. Besides, it would shift the whole UI down which can be unpleasant. |
COPYING
Outdated
@@ -198,3 +198,9 @@ Files: src/zxcvbn/zxcvbn.* | |||
Copyright: 2015, Tony Evans | |||
2016, KeePassXC Team | |||
License: BSD 3-clause | |||
|
|||
Files: src/gui/kmessagewidget.h | |||
src/gui/kmessagewidget.cpp |
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.
@phoerious we might want to update those also.
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.
Things your refactoring tools don't find. Good catch!
- Added YubiKey 2FA integration for unlocking databases [#127] - Added TOTP support [#519] - Added CSV import tool [#146, #490] - Added KeePassXC CLI tool [#254] - Added diceware password generator [#373] - Added support for entry references [#370, #378] - Added support for Twofish encryption [#167] - Enabled DEP and ASLR for in-memory protection [#371] - Enabled single instance mode [#510] - Enabled portable mode [#645] - Enabled database lock on screensaver and session lock [#545] - Redesigned welcome screen with common features and recent databases [#292] - Multiple updates to search behavior [#168, #213, #374, #471, #603, #654] - Added auto-type fields {CLEARFIELD}, {SPACE}, {{}, {}} [#267, #427, #480] - Fixed auto-type errors on Linux [#550] - Prompt user prior to executing a cmd:// URL [#235] - Entry attributes can be protected (hidden) [#220] - Added extended ascii to password generator [#538] - Added new database icon to toolbar [#289] - Added context menu entry to empty recycle bin in databases [#520] - Added "apply" button to entry and group edit windows [#624] - Added macOS tray icon and enabled minimize on close [#583] - Fixed issues with unclean shutdowns [#170, #580] - Changed keyboard shortcut to create new database to CTRL+SHIFT+N [#515] - Compare window title to entry URLs [#556] - Implemented inline error messages [#162] - Ignore group expansion and other minor changes when making database "dirty" [#464] - Updated license and copyright information on souce files [#632] - Added contributors list to about dialog [#629]
Description
This pull request is a rebased and updated version of the original KeePassX pull request keepassx/keepassx#78 by @pgalves.
It uses the stripped down KMessageWidget from the Subsurface project to show error messages instead of modal dialogs.
Motivation and Context
Inline messages are less obtrusive than modal dialogs.
How Has This Been Tested?
I tried to create situations in which the modified error messages are shown. Not all situations could be tested, but the most common error messages appear to work as expected.
No existing unit tests fail.
Screenshots (if appropriate):
Types of changes
Checklist: