Revise legal notice

For GUI and non-daemon console, the legal notice won't ask for user acceptance anymore and only
provide an OK button (or Enter key in console) from now on.
For daemon mode, qbt will print the legal notice and continue to run. It will also notify user
to use command line option `--confirm-legal-notice` to suppress the message. The message will be
printed on every start up unless user specify the command line option once.

PR #20080.
This commit is contained in:
Chocobo1 2023-12-05 03:13:37 +08:00 committed by GitHub
parent 608efc77e8
commit 0dbac78e17
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 169 additions and 93 deletions

View file

@ -57,7 +57,6 @@
#include <QProgressDialog>
#ifdef Q_OS_WIN
#include <QSessionManager>
#include <QSharedMemory>
#endif // Q_OS_WIN
#ifdef Q_OS_MACOS
#include <QFileOpenEvent>
@ -92,7 +91,6 @@
#include "upgrade.h"
#ifndef DISABLE_GUI
#include "gui/guiaddtorrentmanager.h"
#include "gui/desktopintegration.h"
#include "gui/mainwindow.h"
#include "gui/shutdownconfirmdialog.h"
@ -271,17 +269,18 @@ Application::Application(int &argc, char **argv)
SettingsStorage::initInstance();
Preferences::initInstance();
const bool firstTimeUser = !Preferences::instance()->getAcceptedLegal();
if (!firstTimeUser)
const bool firstTimeUser = SettingsStorage::instance()->isEmpty();
if (firstTimeUser)
{
setCurrentMigrationVersion();
handleChangedDefaults(DefaultPreferencesMode::Current);
}
else
{
if (!upgrade())
throw RuntimeError(u"Failed migration of old settings"_s); // Not translatable. Translation isn't configured yet.
handleChangedDefaults(DefaultPreferencesMode::Legacy);
}
else
{
handleChangedDefaults(DefaultPreferencesMode::Current);
}
initializeTranslation();