79 lines
1.8 KiB
C++
Executable File
79 lines
1.8 KiB
C++
Executable File
/*
|
|
* @RDE_HEADER@
|
|
* <short description>
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Malte Schröder, SLSE, 2016-06-08
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QtWidgets/QMainWindow>
|
|
#include <QtCore/QMap>
|
|
#include <QtGui/QStandardItemModel>
|
|
#include <QtCore/QVector>
|
|
#include <QCloseEvent>
|
|
#include <QProcess>
|
|
#include <QProgressDialog>
|
|
#include <QtWidgets/QMenuBar>
|
|
#include <QSqlDatabase>
|
|
|
|
#include "logger.h"
|
|
#include "databases_model.h"
|
|
|
|
namespace Ui {
|
|
class AarApplication;
|
|
}
|
|
|
|
namespace AARApplication
|
|
{
|
|
class AarApplication : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit AarApplication(QWidget *parent = nullptr);
|
|
~AarApplication();
|
|
|
|
bool init();
|
|
|
|
private slots:
|
|
void onClosedClicked();
|
|
void onRemoveClicked();
|
|
void onActivateClicked();
|
|
void onActivateNetworkClicked();
|
|
void onDropDbFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
void onPsauxFinished();
|
|
void onStartAppFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
void onPsauxStopFinished();
|
|
void onStopAppFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
void onErrorOccured(QProcess::ProcessError error);
|
|
void onStartApp();
|
|
void onStopApp();
|
|
|
|
private:
|
|
void enaDisa();
|
|
void handleProcInit(const QString &program, const QStringList &args);
|
|
void handleProcFinished(int exitCode, QProcess::ExitStatus exitStatus);
|
|
void disableButtons() { enaDisaButtons(false); }
|
|
void enableButtons() { enaDisaButtons(true); }
|
|
void enaDisaButtons(bool bEnable);
|
|
|
|
|
|
private:
|
|
Ui::AarApplication *m_ui;
|
|
DatabasesModel *m_databasesModel;
|
|
DatabasesProxyModel *m_proxyModel;
|
|
QMap<QString, QSqlDatabase> m_dbMap;
|
|
bool m_stopping;
|
|
Exercise m_databaseToRemove;
|
|
QProcess *m_proc;
|
|
QSqlDatabase m_dbPostgres;
|
|
QProgressDialog *m_progressDialog;
|
|
QVector<QWidget*> m_widgets;
|
|
|
|
LOGGER_T m_logger;
|
|
};
|
|
} // namespace AARApplication
|