mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
update: storeprogress dialog
This commit is contained in:
parent
3d819abc5d
commit
06b4ab2745
@ -25,9 +25,10 @@
|
||||
#include <QGridLayout>
|
||||
#include <QDialogButtonBox>
|
||||
#include <QTimer>
|
||||
#include <QLineEdit>
|
||||
#include <QTextEdit>
|
||||
#include <QPushButton>
|
||||
#include <QCheckBox>
|
||||
#include <QRadioButton>
|
||||
#include <QDebug>
|
||||
|
||||
#include "../ui/msgbox.h"
|
||||
#include "../config/appconfig.h"
|
||||
@ -61,16 +62,22 @@ StoreProgress::StoreProgress(SigSession *session, QWidget *parent) :
|
||||
grid->setColumnStretch(2, 1);
|
||||
grid->setColumnStretch(3, 1);
|
||||
|
||||
_fileLab = new QLineEdit();
|
||||
_fileLab->setEnabled(false);
|
||||
_fileLab = new QTextEdit();
|
||||
_fileLab->setReadOnly(true);
|
||||
_fileLab->setObjectName("PathLine");
|
||||
_fileLab->setMaximumHeight(50);
|
||||
|
||||
QPushButton *openButton = new QPushButton(this);
|
||||
openButton->setText(tr("change"));
|
||||
_openButton = new QPushButton(this);
|
||||
_openButton->setText(tr("change"));
|
||||
|
||||
_space = new QWidget(this);
|
||||
_space->setMinimumHeight(80);
|
||||
_space->setVisible(false);
|
||||
|
||||
grid->addWidget(&_progress, 0, 0, 1, 4);
|
||||
grid->addWidget(_fileLab, 1, 0, 1, 3);
|
||||
grid->addWidget(openButton, 1, 3, 1, 1);
|
||||
grid->addWidget(_openButton, 1, 3, 1, 1);
|
||||
grid->addWidget(_space);
|
||||
|
||||
QDialogButtonBox *_button_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel,
|
||||
Qt::Horizontal, this);
|
||||
@ -84,7 +91,9 @@ StoreProgress::StoreProgress(SigSession *session, QWidget *parent) :
|
||||
connect(&_store_session, SIGNAL(progress_updated()),
|
||||
this, SLOT(on_progress_updated()), Qt::QueuedConnection);
|
||||
|
||||
connect(openButton, SIGNAL(clicked()),this, SLOT(on_change_file()));
|
||||
connect(_openButton, SIGNAL(clicked()),this, SLOT(on_change_file()));
|
||||
|
||||
_progress.setVisible(false);
|
||||
}
|
||||
|
||||
StoreProgress::~StoreProgress()
|
||||
@ -94,16 +103,15 @@ StoreProgress::~StoreProgress()
|
||||
|
||||
void StoreProgress::on_change_file()
|
||||
{
|
||||
if (_isExport){
|
||||
QString file = _store_session.MakeExportFile(true);
|
||||
if (file != "")
|
||||
_fileLab->setText(file);
|
||||
}
|
||||
else{
|
||||
QString file = _store_session.MakeSaveFile(true);
|
||||
if (file != "")
|
||||
_fileLab->setText(file);
|
||||
}
|
||||
QString file = "";
|
||||
if (_isExport)
|
||||
file = _store_session.MakeExportFile(true);
|
||||
else
|
||||
file = _store_session.MakeSaveFile(true);
|
||||
|
||||
if (file != ""){
|
||||
_fileLab->setText(file);
|
||||
}
|
||||
}
|
||||
|
||||
void StoreProgress::reject()
|
||||
@ -121,6 +129,18 @@ void StoreProgress::accept()
|
||||
return;
|
||||
}
|
||||
|
||||
_progress.setVisible(true);
|
||||
_fileLab->setVisible(false);
|
||||
_fileLab->setVisible(false);
|
||||
_openButton->setVisible(false);
|
||||
|
||||
if (_ckOrigin != NULL){
|
||||
_ckOrigin->setVisible(false);
|
||||
_ckCompress->setVisible(false);
|
||||
}
|
||||
_space->setVisible(true);
|
||||
|
||||
|
||||
if (_isExport && _store_session.IsLogicDataType()){
|
||||
bool ck = _ckOrigin->isChecked();
|
||||
AppConfig &app = AppConfig::Instance();
|
||||
@ -172,7 +192,7 @@ void StoreProgress::save_run(ISessionDataGetter *getter)
|
||||
_isExport = false;
|
||||
setTitle(tr("Saving..."));
|
||||
QString file = _store_session.MakeSaveFile(false);
|
||||
_fileLab->setText(file);
|
||||
_fileLab->setText(file);
|
||||
_store_session._sessionDataGetter = getter;
|
||||
show();
|
||||
}
|
||||
@ -182,19 +202,29 @@ void StoreProgress::export_run()
|
||||
if (_store_session.IsLogicDataType())
|
||||
{
|
||||
QGridLayout *lay = new QGridLayout();
|
||||
lay->setContentsMargins(15, 0, 0, 0);
|
||||
AppConfig &app = AppConfig::Instance();
|
||||
_ckOrigin = new QCheckBox();
|
||||
_ckOrigin->setChecked(app._appOptions.originalData);
|
||||
_ckOrigin->setText(tr("all original data"));
|
||||
lay->setContentsMargins(5, 0, 0, 0);
|
||||
bool isOrg = AppConfig::Instance()._appOptions.originalData;
|
||||
|
||||
_ckOrigin = new QRadioButton();
|
||||
_ckOrigin->setText(tr("Original data"));
|
||||
_ckOrigin->setChecked(isOrg);
|
||||
|
||||
_ckCompress = new QRadioButton();
|
||||
_ckCompress->setText(tr("Compressed data"));
|
||||
_ckCompress->setChecked(!isOrg);
|
||||
|
||||
lay->addWidget(_ckOrigin);
|
||||
lay->addWidget(_ckCompress);
|
||||
_grid->addLayout(lay, 2, 0, 1, 2);
|
||||
|
||||
connect(_ckOrigin, SIGNAL(clicked(bool)), this, SLOT(on_ck_origin(bool)));
|
||||
connect(_ckCompress, SIGNAL(clicked(bool)), this, SLOT(on_ck_compress(bool)));
|
||||
}
|
||||
|
||||
_isExport = true;
|
||||
setTitle(tr("Exporting..."));
|
||||
QString file = _store_session.MakeExportFile(false);
|
||||
_fileLab->setText(file);
|
||||
_fileLab->setText(file);
|
||||
show();
|
||||
}
|
||||
|
||||
@ -229,5 +259,19 @@ void StoreProgress::on_progress_updated()
|
||||
}
|
||||
}
|
||||
|
||||
void StoreProgress::on_ck_origin(bool ck)
|
||||
{
|
||||
if (ck){
|
||||
_ckCompress->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
void StoreProgress::on_ck_compress(bool ck)
|
||||
{
|
||||
if (ck){
|
||||
_ckOrigin->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
} // dialogs
|
||||
} // pv
|
||||
|
@ -28,9 +28,11 @@
|
||||
#include "../dialogs/dsdialog.h"
|
||||
#include "../interface/icallbacks.h"
|
||||
|
||||
class QLineEdit;
|
||||
class QCheckBox;
|
||||
class QTextEdit;
|
||||
class QRadioButton;
|
||||
class QGridLayout;
|
||||
class QPushButton;
|
||||
class QWidget;
|
||||
|
||||
namespace pv {
|
||||
|
||||
@ -68,15 +70,20 @@ private slots:
|
||||
void on_progress_updated();
|
||||
void timeout();
|
||||
void on_change_file();
|
||||
void on_ck_origin(bool ck);
|
||||
void on_ck_compress(bool ck);
|
||||
|
||||
private:
|
||||
pv::StoreSession _store_session;
|
||||
QProgressBar _progress;
|
||||
bool _done;
|
||||
bool _isExport;
|
||||
QLineEdit *_fileLab;
|
||||
QCheckBox *_ckOrigin;
|
||||
QTextEdit *_fileLab;
|
||||
QRadioButton *_ckOrigin;
|
||||
QRadioButton *_ckCompress;
|
||||
QPushButton *_openButton;
|
||||
QGridLayout *_grid;
|
||||
QWidget *_space;
|
||||
};
|
||||
|
||||
} // dialogs
|
||||
|
@ -359,6 +359,16 @@ QLineEdit
|
||||
color: #eff0f1;
|
||||
}
|
||||
|
||||
QTextEdit
|
||||
{
|
||||
background-color: #202020;
|
||||
padding: 2px;
|
||||
border-style: solid;
|
||||
border: 1px solid #393939;
|
||||
border-radius: 2px;
|
||||
color: #eff0f1;
|
||||
}
|
||||
|
||||
QGroupBox
|
||||
{
|
||||
border: 1px solid #393939;
|
||||
@ -1637,4 +1647,7 @@ QTextBrowser:hover
|
||||
|
||||
QLineEdit#PathLine{
|
||||
color:#eff0f1;
|
||||
}
|
||||
QTextEdit#PathLine{
|
||||
color:#eff0f1;
|
||||
}
|
@ -354,6 +354,16 @@ QLineEdit
|
||||
color: #2A2A2A;
|
||||
}
|
||||
|
||||
QTextEdit
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
padding: 2px;
|
||||
border-style: solid;
|
||||
border: 1px solid #2A2A2A;
|
||||
border-radius: 2px;
|
||||
color: #2A2A2A;
|
||||
}
|
||||
|
||||
QGroupBox
|
||||
{
|
||||
border: 1px solid #2A2A2A;
|
||||
@ -1676,3 +1686,7 @@ QTextBrowser:hover
|
||||
QLineEdit#PathLine{
|
||||
color:#2A2A2A;
|
||||
}
|
||||
|
||||
QTextEdit#PathLine{
|
||||
color:#2A2A2A;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user