Improved working of BackupDialog
- improved layout - automatically switch to output component when start is clicked - coloured output for succes/error message - highlighter for pg_dump output that highlights error lines Note: all output of pg_dump goes to stderr because stdout is reserved for output of the backup data.
This commit is contained in:
parent
221cc33bb4
commit
1792f42dac
6 changed files with 274 additions and 150 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#define BACKUPDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
#include <QTextCharFormat>
|
||||
#include "ConnectionConfig.h"
|
||||
#include <QProcess>
|
||||
|
||||
|
|
@ -18,6 +19,7 @@ class QCheckBox;
|
|||
class QPlainTextEdit;
|
||||
class QLineEdit;
|
||||
class QFormLayout;
|
||||
class QStackedLayout;
|
||||
|
||||
|
||||
class BackupDialog : public QDialog
|
||||
|
|
@ -38,18 +40,21 @@ private:
|
|||
QProcess *m_process = nullptr;
|
||||
ConnectionConfig m_config;
|
||||
|
||||
QPushButton *btnStart;
|
||||
QTabWidget *tabWidget;
|
||||
QWidget *tab;
|
||||
QVBoxLayout *verticalLayout;
|
||||
QFormLayout *formLayout;
|
||||
QWidget *widget;
|
||||
QHBoxLayout *horizontalLayout;
|
||||
QLabel *labelFileName;
|
||||
QLineEdit *editFilename;
|
||||
QPushButton *selectDestination;
|
||||
QHBoxLayout *layoutDestination;
|
||||
QWidget *widgetDestination;
|
||||
|
||||
QPushButton *btnStart;
|
||||
QWidget *optionsView;
|
||||
|
||||
QLabel *labelFormat;
|
||||
QComboBox *backupFormat;
|
||||
QLabel *labelJobs;
|
||||
QSpinBox *jobs;
|
||||
QCheckBox *chkbxVerbose;
|
||||
QLabel *labelCompression;
|
||||
QSpinBox *compression;
|
||||
QCheckBox *chkbxIncludeBlobs;
|
||||
QCheckBox *chkbxClean;
|
||||
|
|
@ -58,27 +63,32 @@ private:
|
|||
QCheckBox *oids;
|
||||
QComboBox *what;
|
||||
QCheckBox *noAcl;
|
||||
QWidget *tab_2;
|
||||
QVBoxLayout *verticalLayout_2;
|
||||
QWidget *progressView;
|
||||
QPlainTextEdit *stdOutput;
|
||||
QLabel *label;
|
||||
QLabel *label_2;
|
||||
QLabel *label_3;
|
||||
QLabel *label_4;
|
||||
QLabel *label_5;
|
||||
QTextCharFormat m_OutputOkFormat;
|
||||
QTextCharFormat m_OutputErrorFormat;
|
||||
|
||||
QLabel *labelDataOrSchema;
|
||||
|
||||
void writeOutput(const QString &s);
|
||||
QPushButton *btnBack;
|
||||
QPushButton *btnClose;
|
||||
QStackedLayout *viewStack;
|
||||
|
||||
enum class Format {
|
||||
Normal, Success, Error
|
||||
};
|
||||
void writeOutput(const QString &s, Format f = Format::Normal);
|
||||
|
||||
void setParams(QStringList &args);
|
||||
private slots:
|
||||
|
||||
void on_process_readyRead();
|
||||
void on_process_errorOccurred(QProcess::ProcessError error);
|
||||
void on_process_finished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void process_readyRead();
|
||||
void process_errorOccurred(QProcess::ProcessError error);
|
||||
void process_finished(int exitCode, QProcess::ExitStatus exitStatus);
|
||||
void on_btnStart_clicked();
|
||||
void on_backupFormat_currentIndexChanged(int index);
|
||||
void on_selectDestination_clicked();
|
||||
void on_btnBack_clicked();
|
||||
};
|
||||
|
||||
#endif // BACKUPDIALOG_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue