2017-03-05 21:23:36 +01:00
|
|
|
|
#ifndef BACKUPDIALOG_H
|
2017-02-01 18:01:02 +01:00
|
|
|
|
#define BACKUPDIALOG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QDialog>
|
2019-08-23 09:43:48 +02:00
|
|
|
|
#include <QTextCharFormat>
|
2017-03-05 21:23:36 +01:00
|
|
|
|
#include "ConnectionConfig.h"
|
|
|
|
|
|
#include <QProcess>
|
2017-02-01 18:01:02 +01:00
|
|
|
|
|
2017-03-05 21:23:36 +01:00
|
|
|
|
|
2019-07-13 08:45:32 +02:00
|
|
|
|
class QLabel;
|
|
|
|
|
|
class QPushButton;
|
|
|
|
|
|
class QTabWidget;
|
|
|
|
|
|
class QVBoxLayout;
|
|
|
|
|
|
class QHBoxLayout;
|
|
|
|
|
|
class QComboBox;
|
|
|
|
|
|
class QSpinBox;
|
|
|
|
|
|
class QCheckBox;
|
|
|
|
|
|
class QPlainTextEdit;
|
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
|
class QFormLayout;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
class QStackedLayout;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
2017-02-01 18:01:02 +01:00
|
|
|
|
class BackupDialog : public QDialog
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
|
|
public:
|
2018-11-04 11:26:20 +01:00
|
|
|
|
explicit BackupDialog(QWidget *parent = nullptr);
|
2017-02-01 18:01:02 +01:00
|
|
|
|
~BackupDialog();
|
|
|
|
|
|
|
2017-03-05 21:23:36 +01:00
|
|
|
|
void ConnectTo(QProcess *process);
|
|
|
|
|
|
|
|
|
|
|
|
void disconnectCurrentProcess();
|
|
|
|
|
|
void setConfig(const ConnectionConfig &cfg);
|
2019-07-13 08:45:32 +02:00
|
|
|
|
void retranslateUi();
|
2017-02-01 18:01:02 +01:00
|
|
|
|
private:
|
2019-07-13 08:45:32 +02:00
|
|
|
|
|
2017-03-05 21:23:36 +01:00
|
|
|
|
QProcess *m_process = nullptr;
|
|
|
|
|
|
ConnectionConfig m_config;
|
|
|
|
|
|
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QLabel *labelFileName;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
QLineEdit *editFilename;
|
|
|
|
|
|
QPushButton *selectDestination;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QHBoxLayout *layoutDestination;
|
|
|
|
|
|
QWidget *widgetDestination;
|
|
|
|
|
|
|
|
|
|
|
|
QPushButton *btnStart;
|
|
|
|
|
|
QWidget *optionsView;
|
|
|
|
|
|
|
|
|
|
|
|
QLabel *labelFormat;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
QComboBox *backupFormat;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QLabel *labelJobs;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
QSpinBox *jobs;
|
|
|
|
|
|
QCheckBox *chkbxVerbose;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QLabel *labelCompression;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
QSpinBox *compression;
|
|
|
|
|
|
QCheckBox *chkbxIncludeBlobs;
|
|
|
|
|
|
QCheckBox *chkbxClean;
|
|
|
|
|
|
QCheckBox *chkbxCreate;
|
|
|
|
|
|
QCheckBox *noOwner;
|
|
|
|
|
|
QCheckBox *oids;
|
|
|
|
|
|
QComboBox *what;
|
|
|
|
|
|
QCheckBox *noAcl;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QWidget *progressView;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
QPlainTextEdit *stdOutput;
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QTextCharFormat m_OutputOkFormat;
|
|
|
|
|
|
QTextCharFormat m_OutputErrorFormat;
|
|
|
|
|
|
|
|
|
|
|
|
QLabel *labelDataOrSchema;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
|
2019-08-23 09:43:48 +02:00
|
|
|
|
QPushButton *btnBack;
|
|
|
|
|
|
QPushButton *btnClose;
|
|
|
|
|
|
QStackedLayout *viewStack;
|
2019-07-13 08:45:32 +02:00
|
|
|
|
|
2019-08-23 09:43:48 +02:00
|
|
|
|
enum class Format {
|
|
|
|
|
|
Normal, Success, Error
|
|
|
|
|
|
};
|
|
|
|
|
|
void writeOutput(const QString &s, Format f = Format::Normal);
|
2017-03-05 21:23:36 +01:00
|
|
|
|
|
|
|
|
|
|
void setParams(QStringList &args);
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
|
2019-08-23 09:43:48 +02:00
|
|
|
|
void process_readyRead();
|
|
|
|
|
|
void process_errorOccurred(QProcess::ProcessError error);
|
|
|
|
|
|
void process_finished(int exitCode, QProcess::ExitStatus exitStatus);
|
2017-03-05 21:23:36 +01:00
|
|
|
|
void on_btnStart_clicked();
|
|
|
|
|
|
void on_backupFormat_currentIndexChanged(int index);
|
|
|
|
|
|
void on_selectDestination_clicked();
|
2019-08-23 09:43:48 +02:00
|
|
|
|
void on_btnBack_clicked();
|
2017-02-01 18:01:02 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // BACKUPDIALOG_H
|