mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Add --disable-telemetry command-line option
This commit is contained in:
parent
0f2561cf13
commit
78276cffb7
3 changed files with 26 additions and 15 deletions
25
main.cpp
25
main.cpp
|
@ -61,6 +61,7 @@ int main(int argc, char *argv[])
|
|||
QQmlApplicationEngine engine;
|
||||
QTranslator translator;
|
||||
QString customQm;
|
||||
QSettings settings;
|
||||
|
||||
/* Parse commandline arguments (if any) */
|
||||
QString customRepo;
|
||||
|
@ -144,7 +145,7 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
else if (args[i] == "--help")
|
||||
{
|
||||
cerr << args[0] << " [--debug] [--version] [--repo <repository URL>] [--qm <custom qm translation file>] [<image file to write>]" << endl;
|
||||
cerr << args[0] << " [--debug] [--version] [--repo <repository URL>] [--qm <custom qm translation file>] [--disable-telemetry] [<image file to write>]" << endl;
|
||||
return 0;
|
||||
}
|
||||
else if (args[i] == "--version")
|
||||
|
@ -153,6 +154,18 @@ int main(int argc, char *argv[])
|
|||
cerr << "Repository: " << imageWriter.constantOsListUrl().toString() << endl;
|
||||
return 0;
|
||||
}
|
||||
else if (args[i] == "--disable-telemetry")
|
||||
{
|
||||
cerr << "Disabled telemetry" << endl;
|
||||
settings.setValue("telemetry", false);
|
||||
settings.sync();
|
||||
}
|
||||
else if (args[i] == "--enable-telemetry")
|
||||
{
|
||||
cerr << "Using default telemetry setting" << endl;
|
||||
settings.remove("telemetry");
|
||||
settings.sync();
|
||||
}
|
||||
else
|
||||
{
|
||||
cerr << "Ignoring unknown argument: " << args[i] << endl;
|
||||
|
@ -193,12 +206,10 @@ int main(int argc, char *argv[])
|
|||
qmlwindow->connect(&imageWriter, SIGNAL(networkOnline()), qmlwindow, SLOT(fetchOSlist()));
|
||||
|
||||
#ifndef QT_NO_WIDGETS
|
||||
QSettings settings;
|
||||
|
||||
/* Set window position */
|
||||
auto screensize = app.primaryScreen()->geometry();
|
||||
int x = settings.value("General/x", -1).toInt();
|
||||
int y = settings.value("General/y", -1).toInt();
|
||||
int x = settings.value("x", -1).toInt();
|
||||
int y = settings.value("y", -1).toInt();
|
||||
int w = qmlwindow->property("width").toInt();
|
||||
int h = qmlwindow->property("height").toInt();
|
||||
|
||||
|
@ -228,8 +239,8 @@ int main(int argc, char *argv[])
|
|||
int newY = qmlwindow->property("y").toInt();
|
||||
if (x != newX || y != newY)
|
||||
{
|
||||
settings.setValue("General/x", newX);
|
||||
settings.setValue("General/y", newY);
|
||||
settings.setValue("x", newX);
|
||||
settings.setValue("y", newY);
|
||||
settings.sync();
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue