Skip to content

Add auto hide functionality to inline message widget (#1006)#1059

Merged
phoerious merged 2 commits intokeepassxreboot:developfrom
frostasm:add-auto-hide-functionality-to-inline-message-widget
Oct 21, 2017
Merged

Add auto hide functionality to inline message widget (#1006)#1059
phoerious merged 2 commits intokeepassxreboot:developfrom
frostasm:add-auto-hide-functionality-to-inline-message-widget

Conversation

@frostasm
Copy link
Copy Markdown
Contributor

Add ability to hide inline message widget after a set period of time (#1006)

Description

Done:

  • Add the auto hide functionality to the KMessageWidget class
  • Add ability to change the auto-hide settings for inline messages via gui

Possible improvements:

  • Display the time through which the message will be closed
  • Change the default setting (currently auto-hide disabled by default)

Motivation and context

fix opened issue #1006

How has this been tested?

Manually

Screenshots (if appropriate):

add-auto-hide-functionality-to-inline-message-widget

Types of changes

  • ✅ New feature (non-breaking change which adds functionality)

Checklist:

  • ✅ I have read the CONTRIBUTING document. [REQUIRED]
  • ✅ My code follows the code style of this project. [REQUIRED]
  • ✅ All new and existing tests passed. [REQUIRED]
  • ✅ I have compiled and verified my code with -DWITH_ASAN=ON. [REQUIRED]

Copy link
Copy Markdown
Member

@droidmonkey droidmonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see comments

m_generalUi->autoTypeEntryURLMatchCheckBox->setChecked(config()->get("AutoTypeEntryURLMatch").toBool());
m_generalUi->ignoreGroupExpansionCheckBox->setChecked(config()->get("IgnoreGroupExpansion").toBool());
m_generalUi->autoHideInternalMessagesCheckBox->setChecked(config()->get("AutoHideInternalMessages", false).toBool());
m_generalUi->autoHideInternalMessagesTimeoutSpinBox->setValue(
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in seconds not milliseconds.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok 👌

@louib
Copy link
Copy Markdown
Member

louib commented Oct 11, 2017

@frostasm would it be possible to add the timeout code to our own message widget implementation (MessageWidget)? That would leave the original KMessageWidget class intact.

@frostasm
Copy link
Copy Markdown
Contributor Author

@louib yes of course. I will make the appropriate changes in the near future.

Copy link
Copy Markdown
Member

@phoerious phoerious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really necessary to make the timeout configurable? Can't we just have a default timeout? I find it unnecessary to bloat our settings with that.

@spaetz
Copy link
Copy Markdown

spaetz commented Oct 12, 2017

I agree a message timeout setting seems quite excessive. Just make it 5 secs or whatever and stick with it.

@frostasm frostasm force-pushed the add-auto-hide-functionality-to-inline-message-widget branch from 72c60f3 to eabd830 Compare October 12, 2017 19:59
@frostasm
Copy link
Copy Markdown
Contributor Author

Changes:

  • Move code from KMessageWidget to MessageWidget
  • Remove timeout from config
  • Enable auto hide by default
  • Set timeout to 6 secs

@phoerious
Copy link
Copy Markdown
Member

I still prefer you get rid of the setting. It's quite unnecessary.

@phoerious phoerious added this to the v2.3.0 milestone Oct 13, 2017
@droidmonkey
Copy link
Copy Markdown
Member

droidmonkey commented Oct 13, 2017

Also i am not sure we want to hide all notifications automatically. Is there a simple function to call that disables the timeout for the next show event? Or directly embedded in the show function call (default to true) to toggle autohide?

@frostasm
Copy link
Copy Markdown
Contributor Author

Is there a simple function to call that disables the timeout for the next show event?

@droidmonkey yes. We have two function showMessage. One of them has parameter autoHideTimeout, which is used only for current event. If we want to disable auto-hide functionality we can pass 0 or -1 as timeout.

showMessage(text, type, 0);
// or
showMessage(text, type, -1);

@droidmonkey
Copy link
Copy Markdown
Member

ok cool

@frostasm
Copy link
Copy Markdown
Contributor Author

@phoerious I still prefer you get rid of the setting. It's quite unnecessary.

@droidmonkey, @louib, @spaetz what do you think about auto-hide option in the settings?

@phoerious
Copy link
Copy Markdown
Member

Just remove it.

@frostasm
Copy link
Copy Markdown
Contributor Author

@phoerious ok

@frostasm frostasm force-pushed the add-auto-hide-functionality-to-inline-message-widget branch from eabd830 to 0059a8d Compare October 15, 2017 07:41
@spaetz
Copy link
Copy Markdown

spaetz commented Oct 15, 2017

Yep agreed, remove it

@frostasm frostasm force-pushed the add-auto-hide-functionality-to-inline-message-widget branch from 0059a8d to af6517d Compare October 15, 2017 16:46
@frostasm
Copy link
Copy Markdown
Contributor Author

I think I'm done. Please test the changes :)

Copy link
Copy Markdown
Member

@phoerious phoerious left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to add an infinite timeout here:

displayGlobalMessage(tr("Please touch the button on your YubiKey!"), MessageWidget::Information, false);
Otherwise the YubiKey touch prompt gets hidden after 6 seconds.

@phoerious
Copy link
Copy Markdown
Member

@frostasm Could you rebase to the current develop HEAD please?

@frostasm
Copy link
Copy Markdown
Contributor Author

@phoerious I need a few minutes

@frostasm frostasm force-pushed the add-auto-hide-functionality-to-inline-message-widget branch from ef30677 to f38fe5a Compare October 19, 2017 19:22
@phoerious phoerious merged commit 7cc6f6f into keepassxreboot:develop Oct 21, 2017
@frostasm frostasm deleted the add-auto-hide-functionality-to-inline-message-widget branch October 22, 2017 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants