Removed maintenance mode
This commit is contained in:
parent
e0a68a35f4
commit
2fd1053bf9
22
main.cpp
22
main.cpp
@ -20,6 +20,7 @@
|
|||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QCommandLineParser>
|
#include <QCommandLineParser>
|
||||||
#include <QStandardPaths>
|
#include <QStandardPaths>
|
||||||
|
#include <QMainWindow>
|
||||||
|
|
||||||
#include "update.h"
|
#include "update.h"
|
||||||
#include "git/git_client.h"
|
#include "git/git_client.h"
|
||||||
@ -27,6 +28,8 @@
|
|||||||
#include "apism/apism_client.h"
|
#include "apism/apism_client.h"
|
||||||
#include "worker_thread.h"
|
#include "worker_thread.h"
|
||||||
#include "worker.h"
|
#include "worker.h"
|
||||||
|
#include "mainwindow.h"
|
||||||
|
#include "utils.h"
|
||||||
|
|
||||||
#include <QThread>
|
#include <QThread>
|
||||||
|
|
||||||
@ -80,10 +83,6 @@ int main(int argc, char *argv[]) {
|
|||||||
workingDirectoryOption.setDefaultValue(workingDirectoryDefault);
|
workingDirectoryOption.setDefaultValue(workingDirectoryDefault);
|
||||||
parser.addOption(workingDirectoryOption);
|
parser.addOption(workingDirectoryOption);
|
||||||
|
|
||||||
QCommandLineOption maintenanceOption(QStringList() << "m" << "maintenance",
|
|
||||||
QCoreApplication::translate("main", "Maintenance mode for underlying script"));
|
|
||||||
parser.addOption(maintenanceOption);
|
|
||||||
|
|
||||||
QCommandLineOption dryRunOption(QStringList() << "d" << "dry-run",
|
QCommandLineOption dryRunOption(QStringList() << "d" << "dry-run",
|
||||||
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
QCoreApplication::translate("main", "Start ATBUpdateTool in dry-run-mode. No actual actions."));
|
||||||
parser.addOption(dryRunOption);
|
parser.addOption(dryRunOption);
|
||||||
@ -101,7 +100,6 @@ int main(int argc, char *argv[]) {
|
|||||||
QString plugInDir = parser.value(pluginDirectoryOption);
|
QString plugInDir = parser.value(pluginDirectoryOption);
|
||||||
QString plugInName = parser.value(pluginNameOption);
|
QString plugInName = parser.value(pluginNameOption);
|
||||||
QString workingDir = parser.value(workingDirectoryOption);
|
QString workingDir = parser.value(workingDirectoryOption);
|
||||||
bool maintenanceMode = parser.isSet(maintenanceOption);
|
|
||||||
bool dryRun = parser.isSet(dryRunOption);
|
bool dryRun = parser.isSet(dryRunOption);
|
||||||
QString const rtPath = QCoreApplication::applicationDirPath();
|
QString const rtPath = QCoreApplication::applicationDirPath();
|
||||||
|
|
||||||
@ -118,7 +116,6 @@ int main(int argc, char *argv[]) {
|
|||||||
qInfo() << "plugInDir ........." << plugInDir;
|
qInfo() << "plugInDir ........." << plugInDir;
|
||||||
qInfo() << "plugInName ........" << plugInName;
|
qInfo() << "plugInName ........" << plugInName;
|
||||||
qInfo() << "workingDir ........" << workingDir;
|
qInfo() << "workingDir ........" << workingDir;
|
||||||
qInfo() << "maintenanceMode ..." << maintenanceMode;
|
|
||||||
qInfo() << "dryRun ............" << dryRun;
|
qInfo() << "dryRun ............" << dryRun;
|
||||||
|
|
||||||
// before loading the library, delete all possible shared memory segments
|
// before loading the library, delete all possible shared memory segments
|
||||||
@ -131,11 +128,9 @@ int main(int argc, char *argv[]) {
|
|||||||
hwinf *hw = Update::loadDCPlugin(QDir(plugInDir), plugInName);
|
hwinf *hw = Update::loadDCPlugin(QDir(plugInDir), plugInName);
|
||||||
// hw->dc_autoRequest(false);
|
// hw->dc_autoRequest(false);
|
||||||
|
|
||||||
QString const update_ctrl_file = "/opt/app/tools/atbupdate/update_log.csv";
|
int machineNr = Utils::read1stLineOfFile("/etc/machine_nr");
|
||||||
|
int customerNr = Utils::read1stLineOfFile("/etc/cust_nr");
|
||||||
int machineNr = Worker::read1stLineOfFile("/etc/machine_nr");
|
int zoneNr = Utils::read1stLineOfFile("/etc/zone_nr");
|
||||||
int customerNr = Worker::read1stLineOfFile("/etc/cust_nr");
|
|
||||||
int zoneNr = Worker::read1stLineOfFile("/etc/zone_nr");
|
|
||||||
QString const branchName = (zoneNr != 0)
|
QString const branchName = (zoneNr != 0)
|
||||||
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
? QString("zg1/zone%1").arg(zoneNr) : "master";
|
||||||
|
|
||||||
@ -148,8 +143,11 @@ int main(int argc, char *argv[]) {
|
|||||||
zoneNr,
|
zoneNr,
|
||||||
branchName,
|
branchName,
|
||||||
workingDir,
|
workingDir,
|
||||||
maintenanceMode,
|
|
||||||
dryRun);
|
dryRun);
|
||||||
|
|
||||||
|
MainWindow mw(&worker);
|
||||||
|
mw.setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
|
||||||
|
mw.show();
|
||||||
|
|
||||||
return a.exec();
|
return a.exec();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user