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