mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2025-12-20 10:45:33 -05:00
Add button to hide pre-release warning for this release.
This commit is contained in:
parent
e367c6df95
commit
3dc8b7a5d0
4 changed files with 40 additions and 39 deletions
|
|
@ -202,7 +202,8 @@ static const QHash<Config::ConfigKey, ConfigDirective> configStrings = {
|
||||||
|
|
||||||
// Messages
|
// Messages
|
||||||
{Config::Messages_NoLegacyKeyFileWarning, {QS("Messages/NoLegacyKeyFileWarning"), Roaming, false}},
|
{Config::Messages_NoLegacyKeyFileWarning, {QS("Messages/NoLegacyKeyFileWarning"), Roaming, false}},
|
||||||
{Config::Messages_Qt55CompatibilityWarning, {QS("Messages/Messages_Qt55CompatibilityWarning"), Local, false}}};
|
{Config::Messages_Qt55CompatibilityWarning, {QS("Messages/Qt55CompatibilityWarning"), Local, false}},
|
||||||
|
{Config::Messages_HidePreReleaseWarning, {QS("Messages/HidePreReleaseWarning"), Local, {}}}};
|
||||||
|
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,7 @@ public:
|
||||||
|
|
||||||
Messages_NoLegacyKeyFileWarning,
|
Messages_NoLegacyKeyFileWarning,
|
||||||
Messages_Qt55CompatibilityWarning,
|
Messages_Qt55CompatibilityWarning,
|
||||||
|
Messages_HidePreReleaseWarning,
|
||||||
|
|
||||||
// Special internal value
|
// Special internal value
|
||||||
Deleted
|
Deleted
|
||||||
|
|
|
||||||
|
|
@ -185,12 +185,8 @@ MainWindow::MainWindow()
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setWindowIcon(resources()->applicationIcon());
|
setWindowIcon(resources()->applicationIcon());
|
||||||
m_ui->globalMessageWidget->setHidden(true);
|
m_ui->globalMessageWidget->hideMessage();
|
||||||
// clang-format off
|
|
||||||
connect(m_ui->globalMessageWidget, &MessageWidget::linkActivated, &MessageWidget::openHttpUrl);
|
connect(m_ui->globalMessageWidget, &MessageWidget::linkActivated, &MessageWidget::openHttpUrl);
|
||||||
connect(m_ui->globalMessageWidget, SIGNAL(showAnimationStarted()), m_ui->globalMessageWidgetContainer, SLOT(show()));
|
|
||||||
connect(m_ui->globalMessageWidget, SIGNAL(hideAnimationFinished()), m_ui->globalMessageWidgetContainer, SLOT(hide()));
|
|
||||||
// clang-format on
|
|
||||||
|
|
||||||
m_clearHistoryAction = new QAction(tr("Clear history"), m_ui->menuFile);
|
m_clearHistoryAction = new QAction(tr("Clear history"), m_ui->menuFile);
|
||||||
m_lastDatabasesActions = new QActionGroup(m_ui->menuRecentDatabases);
|
m_lastDatabasesActions = new QActionGroup(m_ui->menuRecentDatabases);
|
||||||
|
|
@ -508,19 +504,37 @@ MainWindow::MainWindow()
|
||||||
MessageWidget::Error);
|
MessageWidget::Error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(KEEPASSXC_BUILD_TYPE_SNAPSHOT) || defined(KEEPASSXC_BUILD_TYPE_PRE_RELEASE)
|
||||||
|
auto* hidePreRelWarn = new QAction(tr("Don't show again for this version"), m_ui->globalMessageWidget);
|
||||||
|
m_ui->globalMessageWidget->addAction(hidePreRelWarn);
|
||||||
|
auto hidePreRelWarnConn = QSharedPointer<QMetaObject::Connection>::create();
|
||||||
|
*hidePreRelWarnConn = connect(m_ui->globalMessageWidget, &KMessageWidget::hideAnimationFinished, [=] {
|
||||||
|
m_ui->globalMessageWidget->removeAction(hidePreRelWarn);
|
||||||
|
disconnect(*hidePreRelWarnConn);
|
||||||
|
hidePreRelWarn->deleteLater();
|
||||||
|
});
|
||||||
|
connect(hidePreRelWarn, &QAction::triggered, [=] {
|
||||||
|
m_ui->globalMessageWidget->animatedHide();
|
||||||
|
config()->set(Config::Messages_HidePreReleaseWarning, KEEPASSXC_VERSION);
|
||||||
|
});
|
||||||
|
#endif
|
||||||
#if defined(KEEPASSXC_BUILD_TYPE_SNAPSHOT)
|
#if defined(KEEPASSXC_BUILD_TYPE_SNAPSHOT)
|
||||||
m_ui->globalMessageWidget->showMessage(
|
if (config()->get(Config::Messages_HidePreReleaseWarning) != KEEPASSXC_VERSION) {
|
||||||
tr("WARNING: You are using an unstable build of KeePassXC!\n"
|
m_ui->globalMessageWidget->showMessage(
|
||||||
"There is a high risk of corruption, maintain a backup of your databases.\n"
|
tr("WARNING: You are using an unstable build of KeePassXC!\n"
|
||||||
"This version is not meant for production use."),
|
"There is a high risk of corruption, maintain a backup of your databases.\n"
|
||||||
MessageWidget::Warning,
|
"This version is not meant for production use."),
|
||||||
-1);
|
MessageWidget::Warning,
|
||||||
|
-1);
|
||||||
|
}
|
||||||
#elif defined(KEEPASSXC_BUILD_TYPE_PRE_RELEASE)
|
#elif defined(KEEPASSXC_BUILD_TYPE_PRE_RELEASE)
|
||||||
m_ui->globalMessageWidget->showMessage(
|
if (config()->get(Config::Messages_HidePreReleaseWarning) != KEEPASSXC_VERSION) {
|
||||||
tr("NOTE: You are using a pre-release version of KeePassXC!\n"
|
m_ui->globalMessageWidget->showMessage(
|
||||||
"Expect some bugs and minor issues, this version is not meant for production use."),
|
tr("NOTE: You are using a pre-release version of KeePassXC!\n"
|
||||||
MessageWidget::Information,
|
"Expect some bugs and minor issues, this version is not meant for production use."),
|
||||||
15000);
|
MessageWidget::Information,
|
||||||
|
-1);
|
||||||
|
}
|
||||||
#elif (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) && QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
|
#elif (QT_VERSION >= QT_VERSION_CHECK(5, 5, 0) && QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
|
||||||
if (!config()->get(Config::Messages_Qt55CompatibilityWarning).toBool()) {
|
if (!config()->get(Config::Messages_Qt55CompatibilityWarning).toBool()) {
|
||||||
m_ui->globalMessageWidget->showMessage(
|
m_ui->globalMessageWidget->showMessage(
|
||||||
|
|
|
||||||
|
|
@ -37,28 +37,13 @@
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QWidget" name="globalMessageWidgetContainer" native="true">
|
<widget class="MessageWidget" name="globalMessageWidget" native="true">
|
||||||
<layout class="QVBoxLayout" name="globalMessageWidgetLayout">
|
<property name="sizePolicy">
|
||||||
<property name="spacing">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<number>0</number>
|
<horstretch>0</horstretch>
|
||||||
</property>
|
<verstretch>0</verstretch>
|
||||||
<property name="bottomMargin">
|
</sizepolicy>
|
||||||
<number>0</number>
|
</property>
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<widget class="MessageWidget" name="globalMessageWidget" native="true">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="styleSheet">
|
|
||||||
<string notr="true">MessageWidget {margin: 90px}</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue