Refactoring changed word 'Mask' to 'File Name' when saving the layout.
--HG-- branch : develop
This commit is contained in:
parent
245c6f522b
commit
57c4813255
|
@ -35,7 +35,7 @@
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
DialogSaveLayout::DialogSaveLayout(const QMap<QString, QString> &formates, int count, const QString &mask,
|
DialogSaveLayout::DialogSaveLayout(const QMap<QString, QString> &formates, int count, const QString &fileName,
|
||||||
QWidget *parent)
|
QWidget *parent)
|
||||||
:QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count)
|
:QDialog(parent), ui(new Ui::DialogSaveLAyout), count(count)
|
||||||
{
|
{
|
||||||
|
@ -46,8 +46,8 @@ DialogSaveLayout::DialogSaveLayout(const QMap<QString, QString> &formates, int c
|
||||||
bOk->setEnabled(false);
|
bOk->setEnabled(false);
|
||||||
|
|
||||||
QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this);
|
QRegExpValidator *validator = new QRegExpValidator(QRegExp("^[\\w\\-. ]+$"), this);
|
||||||
ui->lineEditMask->setValidator(validator);
|
ui->lineEditFileName->setValidator(validator);
|
||||||
ui->lineEditMask->setText(mask);
|
ui->lineEditFileName->setText(fileName);
|
||||||
|
|
||||||
QMap<QString, QString>::const_iterator i = formates.constBegin();
|
QMap<QString, QString>::const_iterator i = formates.constBegin();
|
||||||
while (i != formates.constEnd())
|
while (i != formates.constEnd())
|
||||||
|
@ -57,7 +57,7 @@ DialogSaveLayout::DialogSaveLayout(const QMap<QString, QString> &formates, int c
|
||||||
}
|
}
|
||||||
|
|
||||||
connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save);
|
connect(bOk, &QPushButton::clicked, this, &DialogSaveLayout::Save);
|
||||||
connect(ui->lineEditMask, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample);
|
connect(ui->lineEditFileName, &QLineEdit::textChanged, this, &DialogSaveLayout::ShowExample);
|
||||||
connect(ui->comboBoxFormat, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
connect(ui->comboBoxFormat, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this,
|
||||||
&DialogSaveLayout::ShowExample);
|
&DialogSaveLayout::ShowExample);
|
||||||
connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse);
|
connect(ui->pushButtonBrowse, &QPushButton::clicked, this, &DialogSaveLayout::Browse);
|
||||||
|
@ -79,9 +79,9 @@ QString DialogSaveLayout::Path() const
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
QString DialogSaveLayout::Mask() const
|
QString DialogSaveLayout::FileName() const
|
||||||
{
|
{
|
||||||
return ui->lineEditMask->text();
|
return ui->lineEditFileName->text();
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -95,7 +95,7 @@ void DialogSaveLayout::Save()
|
||||||
{
|
{
|
||||||
for (int i=0; i < count; ++i)
|
for (int i=0; i < count; ++i)
|
||||||
{
|
{
|
||||||
const QString name = Path()+"/"+Mask()+QString::number(i+1)+Formate();
|
const QString name = Path()+"/"+FileName()+QString::number(i+1)+Formate();
|
||||||
if (QFile::exists(name))
|
if (QFile::exists(name))
|
||||||
{
|
{
|
||||||
QMessageBox::StandardButton res = QMessageBox::question(this, tr("Name conflict"),
|
QMessageBox::StandardButton res = QMessageBox::question(this, tr("Name conflict"),
|
||||||
|
@ -117,7 +117,7 @@ void DialogSaveLayout::Save()
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void DialogSaveLayout::ShowExample()
|
void DialogSaveLayout::ShowExample()
|
||||||
{
|
{
|
||||||
ui->labelExample->setText(tr("Example:") + Mask() + "1" + Formate());
|
ui->labelExample->setText(tr("Example:") + FileName() + "1" + Formate());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
|
@ -41,12 +41,12 @@ class DialogSaveLayout : public QDialog
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DialogSaveLayout(const QMap<QString, QString> &formates, int count, const QString &mask = QString(),
|
DialogSaveLayout(const QMap<QString, QString> &formates, int count, const QString &fileName = QString(),
|
||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
~DialogSaveLayout();
|
~DialogSaveLayout();
|
||||||
|
|
||||||
QString Path() const;
|
QString Path() const;
|
||||||
QString Mask() const;
|
QString FileName() const;
|
||||||
QString Formate() const;
|
QString Formate() const;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Mask:</string>
|
<string>File name:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -73,7 +73,7 @@
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QLineEdit" name="lineEditMask"/>
|
<widget class="QLineEdit" name="lineEditFileName"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="2">
|
<item row="2" column="2">
|
||||||
<widget class="QLabel" name="labelExample">
|
<widget class="QLabel" name="labelExample">
|
||||||
|
|
|
@ -71,7 +71,7 @@ TableWindow::TableWindow(QWidget *parent)
|
||||||
connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn);
|
connect(ui->actionZoomIn, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomIn);
|
||||||
connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut);
|
connect(ui->actionZoomOut, &QAction::triggered, ui->view, &VTableGraphicsView::ZoomOut);
|
||||||
connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable);
|
connect(ui->actionStop, &QAction::triggered, this, &TableWindow::StopTable);
|
||||||
connect(ui->actionSave, &QAction::triggered, this, &TableWindow::saveScene);
|
connect(ui->actionSave, &QAction::triggered, this, &TableWindow::SaveLayout);
|
||||||
connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout);
|
connect(ui->actionLayout, &QAction::triggered, this, &TableWindow::Layout);
|
||||||
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper);
|
connect(ui->listWidget, &QListWidget::currentRowChanged, this, &TableWindow::ShowPaper);
|
||||||
}
|
}
|
||||||
|
@ -161,7 +161,7 @@ void TableWindow::StopTable()
|
||||||
/**
|
/**
|
||||||
* @brief saveScene save created layout.
|
* @brief saveScene save created layout.
|
||||||
*/
|
*/
|
||||||
void TableWindow::saveScene()
|
void TableWindow::SaveLayout()
|
||||||
{
|
{
|
||||||
QMap<QString, QString> extByMessage = InitFormates();
|
QMap<QString, QString> extByMessage = InitFormates();
|
||||||
DialogSaveLayout dialog(extByMessage, scenes.size(), fileName, this);
|
DialogSaveLayout dialog(extByMessage, scenes.size(), fileName, this);
|
||||||
|
@ -175,7 +175,7 @@ void TableWindow::saveScene()
|
||||||
suf.replace(".", "");
|
suf.replace(".", "");
|
||||||
|
|
||||||
QString path = dialog.Path();
|
QString path = dialog.Path();
|
||||||
QString mask = dialog.Mask();
|
QString mask = dialog.FileName();
|
||||||
|
|
||||||
for (int i=0; i < scenes.size(); ++i)
|
for (int i=0; i < scenes.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ public slots:
|
||||||
const QString &description);
|
const QString &description);
|
||||||
void Layout();
|
void Layout();
|
||||||
void StopTable();
|
void StopTable();
|
||||||
void saveScene();
|
void SaveLayout();
|
||||||
void ShowPaper(int index);
|
void ShowPaper(int index);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user