Set expiration time to Now when enabling entry expiration

* Fixes #3940
This commit is contained in:
Jonathan White 2020-03-07 09:52:51 -05:00
parent ab9856ee88
commit 7b25fe9cc6

View File

@ -158,7 +158,13 @@ void EditEntryWidget::setupMain()
connect(m_mainUi->urlEdit, SIGNAL(textChanged(QString)), m_iconsWidget, SLOT(setUrl(QString)));
m_mainUi->urlEdit->enableVerifyMode();
#endif
connect(m_mainUi->expireCheck, SIGNAL(toggled(bool)), m_mainUi->expireDatePicker, SLOT(setEnabled(bool)));
connect(m_mainUi->expireCheck, &QCheckBox::toggled, [&](bool enabled) {
m_mainUi->expireDatePicker->setEnabled(enabled);
if (enabled) {
m_mainUi->expireDatePicker->setDateTime(Clock::currentDateTime());
}
});
connect(m_mainUi->notesEnabled, SIGNAL(toggled(bool)), this, SLOT(toggleHideNotes(bool)));
m_mainUi->expirePresets->setMenu(createPresetsMenu());