added the ability to work with an online repository

* added a command line argument for the application, when called, cached profiles will be cleared
This commit is contained in:
vladimir.kuznetsov 2023-03-18 06:06:29 +03:00
parent 6f53abbae3
commit 03599e4da7
10 changed files with 96 additions and 36 deletions

View file

@ -197,16 +197,27 @@ bool AmneziaApplication::parseCommands()
m_parser.addHelpOption();
m_parser.addVersionOption();
QCommandLineOption c_autostart {{"a", "autostart"}, "System autostart"};
m_parser.addOption(c_autostart);
QCommandLineOption c_cleanup {{"c", "cleanup"}, "Cleanup logs"};
m_parser.addOption(c_cleanup);
m_parser.addOption(m_autoStartOption);
m_parser.addOption(m_cleanUpOption);
m_parser.addOption(m_clearProfilesOption);
m_parser.process(*this);
if (m_parser.isSet(c_cleanup)) {
if (m_parser.isSet(m_cleanUpOption)) {
Logger::cleanUp();
QTimer::singleShot(100, this, [this]{
quit();
});
exec();
return false;
} else if (m_parser.isSet(m_clearProfilesOption)) {
for (int i = 0; i < m_settings->serversCount(); i++) {
const auto &containers = m_settings->containers(i).keys();
for (DockerContainer container : containers) {
m_settings->clearLastConnectionConfig(i, container);
}
}
QTimer::singleShot(100, this, [this]{
quit();
});