Resolved issue #282. Add dialog for File/New, update Create Pattern Piece
dialog. --HG-- branch : develop
This commit is contained in:
parent
d83b8b2e68
commit
350cc90ced
|
@ -148,114 +148,49 @@ MainWindow::MainWindow(QWidget *parent)
|
||||||
/**
|
/**
|
||||||
* @brief ActionNewPP add to scene new pattern piece.
|
* @brief ActionNewPP add to scene new pattern piece.
|
||||||
*/
|
*/
|
||||||
void MainWindow::ActionNewPP()
|
void MainWindow::NewPP()
|
||||||
{
|
{
|
||||||
qCDebug(vMainWindow, "New PP.");
|
qCDebug(vMainWindow, "New PP.");
|
||||||
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
||||||
qCDebug(vMainWindow, "Generated PP name: %s", patternPieceName.toUtf8().constData());
|
qCDebug(vMainWindow, "Generated PP name: %s", patternPieceName.toUtf8().constData());
|
||||||
QString path;
|
|
||||||
if (comboBoxDraws->count() == 0)
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "First PP");
|
|
||||||
DialogMeasurements measurements(this);
|
|
||||||
if (measurements.exec() == QDialog::Rejected)
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "Creation PP was canceled");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (measurements.type() == MeasurementsType::Standard)
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "PP with standard measurements");
|
|
||||||
qApp->setPatternType(MeasurementsType::Standard);
|
|
||||||
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
|
|
||||||
if (stMeasurements.exec() == QDialog::Accepted)
|
|
||||||
{
|
|
||||||
patternPieceName = stMeasurements.name();
|
|
||||||
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
|
||||||
path = stMeasurements.tablePath();
|
|
||||||
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
|
|
||||||
VStandardMeasurements m(pattern);
|
|
||||||
m.setXMLContent(path);
|
|
||||||
m.SetSize();
|
|
||||||
m.SetHeight();
|
|
||||||
m.Measurements();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "Selection standard measurements canceled.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "PP with individual measurements.");
|
|
||||||
QMessageBox::StandardButton ret;
|
|
||||||
ret = QMessageBox::question(this, tr("Individual measurements is under development"),
|
|
||||||
tr("There is no way create individual measurements file independent on the "
|
|
||||||
"pattern file.\nFor opening pattern need keep both files: pattern and "
|
|
||||||
"measurements. Do you want continue?"),
|
|
||||||
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
|
||||||
if (ret == QMessageBox::No)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
qApp->setPatternType(MeasurementsType::Individual);
|
qCDebug(vMainWindow, "PP count %d", comboBoxDraws->count());
|
||||||
DialogIndividualMeasurements indMeasurements(pattern, patternPieceName, this);
|
patternPieceName = PatternPieceName(patternPieceName);
|
||||||
if (indMeasurements.exec() == QDialog::Accepted)
|
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
||||||
{
|
if (patternPieceName.isEmpty())
|
||||||
patternPieceName = indMeasurements.name();
|
{
|
||||||
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
qCDebug(vMainWindow, "Name empty.");
|
||||||
path = indMeasurements.tablePath();
|
return;
|
||||||
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
|
}
|
||||||
VIndividualMeasurements m(pattern);
|
|
||||||
m.setXMLContent(path);
|
|
||||||
m.Measurements();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "Selection individual measurements canceled.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//Set scene size to size scene view
|
AddPP(patternPieceName, doc->MPath());
|
||||||
VAbstractTool::NewSceneRect(sceneDraw, ui->view);
|
}
|
||||||
VAbstractTool::NewSceneRect(sceneDetails, ui->view);
|
|
||||||
ToolBarOption();
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
}
|
void MainWindow::AddPP(const QString &PPName, const QString &path)
|
||||||
else
|
{
|
||||||
|
if (doc->appendPP(PPName) == false)
|
||||||
{
|
{
|
||||||
qCDebug(vMainWindow, "PP count %d", comboBoxDraws->count());
|
qCDebug(vMainWindow, "Error creating pattern piece with the name %s.", PPName.toUtf8().constData());
|
||||||
patternPieceName = PatternPieceName(patternPieceName);
|
|
||||||
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
|
||||||
if (patternPieceName.isEmpty())
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "Name empty.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
path = doc->MPath();
|
|
||||||
}
|
|
||||||
if (doc->appendPP(patternPieceName) == false)
|
|
||||||
{
|
|
||||||
qCDebug(vMainWindow, "Error creating pattern piece with the name %s.", patternPieceName.toUtf8().constData());
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
comboBoxDraws->blockSignals(true);
|
comboBoxDraws->blockSignals(true);
|
||||||
comboBoxDraws->addItem(patternPieceName);
|
comboBoxDraws->addItem(PPName);
|
||||||
|
|
||||||
pattern->ClearGObjects();
|
pattern->ClearGObjects();
|
||||||
//Create single point
|
//Create single point
|
||||||
ui->view->itemClicked(nullptr);//hide options previous tool
|
ui->view->itemClicked(nullptr);//hide options previous tool
|
||||||
QString label = doc->GenerateLabel(LabelType::NewPatternPiece);
|
const QString label = doc->GenerateLabel(LabelType::NewPatternPiece);
|
||||||
const quint32 id = pattern->AddGObject(new VPointF(30+comboBoxDraws->count()*5, 40, label, 5, 10));
|
const quint32 id = pattern->AddGObject(new VPointF(30+comboBoxDraws->count()*5, 40, label, 5, 10));
|
||||||
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, patternPieceName, path);
|
VToolSinglePoint *spoint = new VToolSinglePoint(doc, pattern, id, Source::FromGui, PPName, path);
|
||||||
sceneDraw->addItem(spoint);
|
sceneDraw->addItem(spoint);
|
||||||
ui->view->itemClicked(spoint);
|
ui->view->itemClicked(spoint);
|
||||||
|
|
||||||
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
connect(spoint, &VToolPoint::ChoosedTool, sceneDraw, &VMainGraphicsScene::ChoosedItem);
|
||||||
connect(sceneDraw, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable);
|
connect(sceneDraw, &VMainGraphicsScene::DisableItem, spoint, &VToolSinglePoint::Disable);
|
||||||
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor);
|
connect(sceneDraw, &VMainGraphicsScene::NewFactor, spoint, &VToolSinglePoint::SetFactor);
|
||||||
connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove);
|
connect(sceneDraw, &VMainGraphicsScene::EnableToolMove, spoint, &VToolSinglePoint::EnableToolMove);
|
||||||
|
|
||||||
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
QHash<quint32, VDataTool*>* tools = doc->getTools();
|
||||||
SCASSERT(tools != nullptr);
|
SCASSERT(tools != nullptr);
|
||||||
tools->insert(id, spoint);
|
tools->insert(id, spoint);
|
||||||
|
@ -263,7 +198,7 @@ void MainWindow::ActionNewPP()
|
||||||
SetEnableTool(true);
|
SetEnableTool(true);
|
||||||
SetEnableWidgets(true);
|
SetEnableWidgets(true);
|
||||||
|
|
||||||
const qint32 index = comboBoxDraws->findText(patternPieceName);
|
const qint32 index = comboBoxDraws->findText(PPName);
|
||||||
if ( index != -1 )
|
if ( index != -1 )
|
||||||
{ // -1 for not found
|
{ // -1 for not found
|
||||||
comboBoxDraws->setCurrentIndex(index);
|
comboBoxDraws->setCurrentIndex(index);
|
||||||
|
@ -273,13 +208,15 @@ void MainWindow::ActionNewPP()
|
||||||
comboBoxDraws->setCurrentIndex(0);
|
comboBoxDraws->setCurrentIndex(0);
|
||||||
}
|
}
|
||||||
comboBoxDraws->blockSignals(false);
|
comboBoxDraws->blockSignals(false);
|
||||||
|
|
||||||
|
ui->actionNewDraw->setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief OptionDraw help change name of pattern piece.
|
* @brief OptionDraw help change name of pattern piece.
|
||||||
*/
|
*/
|
||||||
void MainWindow::OptionDraw()
|
void MainWindow::DrawOption()
|
||||||
{
|
{
|
||||||
const QString activDraw = doc->GetNameActivPP();
|
const QString activDraw = doc->GetNameActivPP();
|
||||||
const QString nameDraw = PatternPieceName(activDraw);
|
const QString nameDraw = PatternPieceName(activDraw);
|
||||||
|
@ -935,27 +872,18 @@ void MainWindow::SetDefaultSize(int value)
|
||||||
*/
|
*/
|
||||||
void MainWindow::ToolBarDraws()
|
void MainWindow::ToolBarDraws()
|
||||||
{
|
{
|
||||||
QLabel *labelPtternPieceName = new QLabel(tr("Pattern Piece: "));
|
ui->toolBarDraws->addWidget(new QLabel(tr("Pattern Piece: ")));
|
||||||
ui->toolBarDraws->addWidget(labelPtternPieceName);
|
|
||||||
|
|
||||||
|
// By using Qt UI Designer we can't add QComboBox to toolbar
|
||||||
comboBoxDraws = new QComboBox;
|
comboBoxDraws = new QComboBox;
|
||||||
ui->toolBarDraws->addWidget(comboBoxDraws);
|
ui->toolBarDraws->addWidget(comboBoxDraws);
|
||||||
comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
comboBoxDraws->setSizeAdjustPolicy(QComboBox::AdjustToContents);
|
||||||
|
comboBoxDraws->setEnabled(false);
|
||||||
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
connect(comboBoxDraws, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
|
||||||
this, &MainWindow::currentPPChanged);
|
this, &MainWindow::currentPPChanged);
|
||||||
|
|
||||||
ui->toolBarDraws->addAction(ui->actionOptionDraw);
|
ui->toolBarDraws->addAction(ui->actionOptionDraw);
|
||||||
ui->actionOptionDraw->setEnabled(false);
|
connect(ui->actionOptionDraw, &QAction::triggered, this, &MainWindow::DrawOption);
|
||||||
|
|
||||||
// Don't add to toolbar!
|
|
||||||
ui->actionTable->setEnabled(false);
|
|
||||||
|
|
||||||
// Don't add to toolbar!
|
|
||||||
ui->actionHistory->setEnabled(false);
|
|
||||||
connect(ui->actionHistory, &QAction::triggered, this, &MainWindow::ActionHistory);
|
|
||||||
|
|
||||||
connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout);
|
|
||||||
ui->actionLayout->setEnabled(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::ToolBarTools()
|
void MainWindow::ToolBarTools()
|
||||||
|
@ -1601,14 +1529,7 @@ void MainWindow::FullParseFile()
|
||||||
|
|
||||||
GlobalChangePP(patternPiece);
|
GlobalChangePP(patternPiece);
|
||||||
|
|
||||||
if (comboBoxDraws->count() > 0)
|
SetEnableTool(comboBoxDraws->count() > 0);
|
||||||
{
|
|
||||||
SetEnableTool(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
SetEnableTool(false);
|
|
||||||
}
|
|
||||||
SetEnableWidgets(true);
|
SetEnableWidgets(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1651,38 +1572,10 @@ void MainWindow::SetEnabledGUI(bool enabled)
|
||||||
ArrowTool();
|
ArrowTool();
|
||||||
qApp->getUndoStack()->clear();
|
qApp->getUndoStack()->clear();
|
||||||
}
|
}
|
||||||
comboBoxDraws->setEnabled(enabled);
|
SetEnableWidgets(enabled);
|
||||||
ui->actionOptionDraw->setEnabled(enabled);
|
|
||||||
ui->actionSave->setEnabled(enabled);
|
|
||||||
ui->actionSaveAs->setEnabled(enabled);
|
|
||||||
ui->actionPattern_properties->setEnabled(enabled);
|
|
||||||
ui->actionEdit_pattern_code->setEnabled(enabled);
|
|
||||||
ui->actionZoomIn->setEnabled(enabled);
|
|
||||||
ui->actionZoomOut->setEnabled(enabled);
|
|
||||||
ui->actionArrowTool->setEnabled(enabled);
|
|
||||||
ui->actionHistory->setEnabled(enabled);
|
|
||||||
ui->actionNewDraw->setEnabled(enabled);
|
|
||||||
ui->actionDraw->setEnabled(enabled);
|
|
||||||
ui->actionTable->setEnabled(enabled);
|
|
||||||
ui->actionZoomFitBest->setEnabled(enabled);
|
|
||||||
ui->actionZoomOriginal->setEnabled(enabled);
|
|
||||||
ui->actionShowCurveDetails->setEnabled(enabled);
|
|
||||||
|
|
||||||
if (enabled)
|
|
||||||
{
|
|
||||||
Layout();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ui->actionDetails->setEnabled(enabled);
|
|
||||||
ui->actionLayout->setEnabled(enabled);
|
|
||||||
}
|
|
||||||
|
|
||||||
guiEnabled = enabled;
|
guiEnabled = enabled;
|
||||||
|
|
||||||
sceneDraw->SetDisable(!enabled);
|
|
||||||
ui->view->setEnabled(enabled);
|
|
||||||
|
|
||||||
SetEnableTool(enabled);
|
SetEnableTool(enabled);
|
||||||
ui->toolBarOption->setEnabled(enabled);
|
ui->toolBarOption->setEnabled(enabled);
|
||||||
#ifndef QT_NO_CURSOR
|
#ifndef QT_NO_CURSOR
|
||||||
|
@ -1691,6 +1584,48 @@ void MainWindow::SetEnabledGUI(bool enabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief SetEnableWidgets enable action button.
|
||||||
|
* @param enable enable value.
|
||||||
|
*/
|
||||||
|
void MainWindow::SetEnableWidgets(bool enable)
|
||||||
|
{
|
||||||
|
comboBoxDraws->setEnabled(enable);
|
||||||
|
ui->actionOptionDraw->setEnabled(enable);
|
||||||
|
if (enable && not curFile.isEmpty())
|
||||||
|
{
|
||||||
|
ui->actionSave->setEnabled(enable);
|
||||||
|
}
|
||||||
|
ui->actionSaveAs->setEnabled(enable);
|
||||||
|
ui->actionPattern_properties->setEnabled(enable);
|
||||||
|
ui->actionEdit_pattern_code->setEnabled(enable);
|
||||||
|
ui->actionZoomIn->setEnabled(enable);
|
||||||
|
ui->actionZoomOut->setEnabled(enable);
|
||||||
|
ui->actionArrowTool->setEnabled(enable);
|
||||||
|
ui->actionHistory->setEnabled(enable);
|
||||||
|
ui->actionNewDraw->setEnabled(enable);
|
||||||
|
ui->actionDraw->setEnabled(enable);
|
||||||
|
ui->actionTable->setEnabled(enable);
|
||||||
|
ui->actionZoomFitBest->setEnabled(enable);
|
||||||
|
ui->actionZoomOriginal->setEnabled(enable);
|
||||||
|
ui->actionShowCurveDetails->setEnabled(enable);
|
||||||
|
|
||||||
|
if (enable)
|
||||||
|
{
|
||||||
|
Layout();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ui->actionDetails->setEnabled(enable);
|
||||||
|
ui->actionLayout->setEnabled(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Now we want allow user call context menu
|
||||||
|
sceneDraw->SetDisable(!enable);
|
||||||
|
ui->view->setEnabled(enable);
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::ClickEndVisualization()
|
void MainWindow::ClickEndVisualization()
|
||||||
{
|
{
|
||||||
|
@ -1774,9 +1709,89 @@ void MainWindow::UpdateSizesList(const QStringList &list)
|
||||||
/**
|
/**
|
||||||
* @brief NewPattern create new empty pattern.
|
* @brief NewPattern create new empty pattern.
|
||||||
*/
|
*/
|
||||||
void MainWindow::NewPattern()
|
void MainWindow::New()
|
||||||
{
|
{
|
||||||
OpenNewValentina();
|
if (comboBoxDraws->count() == 0)
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "New PP.");
|
||||||
|
QString patternPieceName = QString(tr("Pattern piece %1")).arg(comboBoxDraws->count()+1);
|
||||||
|
qCDebug(vMainWindow, "Generated PP name: %s", patternPieceName.toUtf8().constData());
|
||||||
|
QString path;
|
||||||
|
|
||||||
|
qCDebug(vMainWindow, "First PP");
|
||||||
|
DialogMeasurements measurements(this);
|
||||||
|
if (measurements.exec() == QDialog::Rejected)
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "Creation PP was canceled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (measurements.type() == MeasurementsType::Standard)
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "PP with standard measurements");
|
||||||
|
qApp->setPatternType(MeasurementsType::Standard);
|
||||||
|
DialogStandardMeasurements stMeasurements(pattern, patternPieceName, this);
|
||||||
|
if (stMeasurements.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
patternPieceName = stMeasurements.name();
|
||||||
|
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
||||||
|
path = stMeasurements.tablePath();
|
||||||
|
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
|
||||||
|
VStandardMeasurements m(pattern);
|
||||||
|
m.setXMLContent(path);
|
||||||
|
m.SetSize();
|
||||||
|
m.SetHeight();
|
||||||
|
m.Measurements();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "Selection standard measurements canceled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "PP with individual measurements.");
|
||||||
|
QMessageBox::StandardButton ret;
|
||||||
|
ret = QMessageBox::question(this, tr("Individual measurements is under development"),
|
||||||
|
tr("There is no way create individual measurements file independent on the "
|
||||||
|
"pattern file.\nFor opening pattern need keep both files: pattern and "
|
||||||
|
"measurements. Do you want continue?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::Yes);
|
||||||
|
if (ret == QMessageBox::No)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
qApp->setPatternType(MeasurementsType::Individual);
|
||||||
|
DialogIndividualMeasurements indMeasurements(pattern, patternPieceName, this);
|
||||||
|
if (indMeasurements.exec() == QDialog::Accepted)
|
||||||
|
{
|
||||||
|
patternPieceName = indMeasurements.name();
|
||||||
|
qCDebug(vMainWindow, "PP name: %s", patternPieceName.toUtf8().constData());
|
||||||
|
path = indMeasurements.tablePath();
|
||||||
|
qCDebug(vMainWindow, "Table path: %s", path.toUtf8().constData());
|
||||||
|
VIndividualMeasurements m(pattern);
|
||||||
|
m.setXMLContent(path);
|
||||||
|
m.Measurements();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
qCDebug(vMainWindow, "Selection individual measurements canceled.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Set scene size to size scene view
|
||||||
|
VAbstractTool::NewSceneRect(sceneDraw, ui->view);
|
||||||
|
VAbstractTool::NewSceneRect(sceneDetails, ui->view);
|
||||||
|
ToolBarOption();
|
||||||
|
|
||||||
|
AddPP(patternPieceName, path);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
OpenNewValentina();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -1814,34 +1829,6 @@ void MainWindow::ChangedHeight(const QString &text)
|
||||||
doc->LiteParseTree(Document::LiteParse);
|
doc->LiteParseTree(Document::LiteParse);
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief SetEnableWidgets enable action button.
|
|
||||||
* @param enable enable value.
|
|
||||||
*/
|
|
||||||
void MainWindow::SetEnableWidgets(bool enable)
|
|
||||||
{
|
|
||||||
ui->actionSaveAs->setEnabled(enable);
|
|
||||||
ui->actionDraw->setEnabled(enable);
|
|
||||||
ui->actionOptionDraw->setEnabled(enable);
|
|
||||||
if (enable == true && curFile.isEmpty() == false)
|
|
||||||
{
|
|
||||||
ui->actionSave->setEnabled(enable);
|
|
||||||
}
|
|
||||||
Layout();
|
|
||||||
ui->actionTable->setEnabled(enable);
|
|
||||||
ui->actionHistory->setEnabled(enable);
|
|
||||||
ui->actionPattern_properties->setEnabled(enable);
|
|
||||||
ui->actionEdit_pattern_code->setEnabled(enable);
|
|
||||||
ui->actionZoomIn->setEnabled(enable);
|
|
||||||
ui->actionZoomOut->setEnabled(enable);
|
|
||||||
ui->actionZoomFitBest->setEnabled(enable);
|
|
||||||
ui->actionZoomOriginal->setEnabled(enable);
|
|
||||||
ui->actionShowCurveDetails->setEnabled(enable);
|
|
||||||
//Now we want allow user call context menu
|
|
||||||
ui->view->setEnabled(enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief ActionTable show table with variables.
|
* @brief ActionTable show table with variables.
|
||||||
|
@ -1896,7 +1883,7 @@ void MainWindow::ActionHistory(bool checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::ActionDetailsMode(bool checked)
|
void MainWindow::ActionCurveDetailsMode(bool checked)
|
||||||
{
|
{
|
||||||
ui->view->itemClicked(nullptr);
|
ui->view->itemClicked(nullptr);
|
||||||
sceneDraw->EnableDetailsMode(checked);
|
sceneDraw->EnableDetailsMode(checked);
|
||||||
|
@ -2371,12 +2358,13 @@ void MainWindow::CreateActions()
|
||||||
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ArrowTool);
|
connect(ui->actionArrowTool, &QAction::triggered, this, &MainWindow::ArrowTool);
|
||||||
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
|
connect(ui->actionDraw, &QAction::triggered, this, &MainWindow::ActionDraw);
|
||||||
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
|
connect(ui->actionDetails, &QAction::triggered, this, &MainWindow::ActionDetails);
|
||||||
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::ActionNewPP);
|
connect(ui->actionLayout, &QAction::triggered, this, &MainWindow::ActionLayout);
|
||||||
connect(ui->actionOptionDraw, &QAction::triggered, this, &MainWindow::OptionDraw);
|
connect(ui->actionHistory, &QAction::triggered, this, &MainWindow::ActionHistory);
|
||||||
|
connect(ui->actionNewDraw, &QAction::triggered, this, &MainWindow::NewPP);
|
||||||
connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::SaveAs);
|
connect(ui->actionSaveAs, &QAction::triggered, this, &MainWindow::SaveAs);
|
||||||
connect(ui->actionSave, &QAction::triggered, this, &MainWindow::Save);
|
connect(ui->actionSave, &QAction::triggered, this, &MainWindow::Save);
|
||||||
connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::Open);
|
connect(ui->actionOpen, &QAction::triggered, this, &MainWindow::Open);
|
||||||
connect(ui->actionNew, &QAction::triggered, this, &MainWindow::NewPattern);
|
connect(ui->actionNew, &QAction::triggered, this, &MainWindow::New);
|
||||||
connect(ui->actionTable, &QAction::triggered, this, &MainWindow::ActionTable);
|
connect(ui->actionTable, &QAction::triggered, this, &MainWindow::ActionTable);
|
||||||
connect(ui->actionAbout_Qt, &QAction::triggered, this, &MainWindow::AboutQt);
|
connect(ui->actionAbout_Qt, &QAction::triggered, this, &MainWindow::AboutQt);
|
||||||
connect(ui->actionAbout_Valentina, &QAction::triggered, this, &MainWindow::About);
|
connect(ui->actionAbout_Valentina, &QAction::triggered, this, &MainWindow::About);
|
||||||
|
@ -2389,7 +2377,7 @@ void MainWindow::CreateActions()
|
||||||
ui->actionPattern_properties->setEnabled(false);
|
ui->actionPattern_properties->setEnabled(false);
|
||||||
connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode);
|
connect(ui->actionEdit_pattern_code, &QAction::triggered, this, &MainWindow::EditPatternCode);
|
||||||
connect(ui->actionCloseWindow, &QAction::triggered, this, &MainWindow::ResetWindow);
|
connect(ui->actionCloseWindow, &QAction::triggered, this, &MainWindow::ResetWindow);
|
||||||
connect(ui->actionShowCurveDetails, &QAction::triggered, this, &MainWindow::ActionDetailsMode);
|
connect(ui->actionShowCurveDetails, &QAction::triggered, this, &MainWindow::ActionCurveDetailsMode);
|
||||||
ui->actionEdit_pattern_code->setEnabled(false);
|
ui->actionEdit_pattern_code->setEnabled(false);
|
||||||
|
|
||||||
//Actions for recent files loaded by a main window application.
|
//Actions for recent files loaded by a main window application.
|
||||||
|
|
|
@ -63,30 +63,36 @@ public slots:
|
||||||
|
|
||||||
void ActionDraw(bool checked);
|
void ActionDraw(bool checked);
|
||||||
void ActionDetails(bool checked);
|
void ActionDetails(bool checked);
|
||||||
void ActionNewPP();
|
|
||||||
void ActionLayout(bool checked);
|
void ActionLayout(bool checked);
|
||||||
|
|
||||||
void ActionTable(bool checked);
|
void ActionTable(bool checked);
|
||||||
void ActionHistory(bool checked);
|
void ActionHistory(bool checked);
|
||||||
void ActionDetailsMode(bool checked);
|
void ActionCurveDetailsMode(bool checked);
|
||||||
|
void DrawOption();
|
||||||
|
|
||||||
void tableClosed();
|
void tableClosed();
|
||||||
void ClosedActionTable();
|
void ClosedActionTable();
|
||||||
void ClosedActionHistory();
|
void ClosedActionHistory();
|
||||||
|
|
||||||
|
void New();
|
||||||
bool SaveAs();
|
bool SaveAs();
|
||||||
bool Save();
|
bool Save();
|
||||||
void Open();
|
void Open();
|
||||||
|
void NewPP();
|
||||||
|
|
||||||
void Preferences();
|
void Preferences();
|
||||||
void RepotBug();
|
void RepotBug();
|
||||||
void OnlineHelp();
|
void OnlineHelp();
|
||||||
void NewPattern();
|
void About();
|
||||||
|
void AboutQt();
|
||||||
|
void PatternProperties();
|
||||||
void ShowToolTip(const QString &toolTip);
|
void ShowToolTip(const QString &toolTip);
|
||||||
void OpenRecentFile();
|
void OpenRecentFile();
|
||||||
void Clear();
|
void Clear();
|
||||||
void ResetWindow();
|
void ResetWindow();
|
||||||
|
|
||||||
void currentPPChanged(int index);
|
void currentPPChanged(int index);
|
||||||
void OptionDraw();
|
|
||||||
void ChangedSize(const QString &text);
|
void ChangedSize(const QString &text);
|
||||||
void ChangedHeight(const QString & text);
|
void ChangedHeight(const QString & text);
|
||||||
|
|
||||||
|
@ -117,10 +123,6 @@ public slots:
|
||||||
void ClosedDialogDetail(int result);
|
void ClosedDialogDetail(int result);
|
||||||
void ClosedDialogUnionDetails(int result);
|
void ClosedDialogUnionDetails(int result);
|
||||||
|
|
||||||
void About();
|
|
||||||
void AboutQt();
|
|
||||||
void PatternProperties();
|
|
||||||
|
|
||||||
//tmp
|
//tmp
|
||||||
void LastUsedTool();
|
void LastUsedTool();
|
||||||
|
|
||||||
|
@ -129,7 +131,9 @@ public slots:
|
||||||
*/
|
*/
|
||||||
void EditPatternCode();
|
void EditPatternCode();
|
||||||
void FullParseFile();
|
void FullParseFile();
|
||||||
|
|
||||||
void SetEnabledGUI(bool enabled);
|
void SetEnabledGUI(bool enabled);
|
||||||
|
|
||||||
void ClickEndVisualization();
|
void ClickEndVisualization();
|
||||||
void Layout();
|
void Layout();
|
||||||
void UpdateGradation();
|
void UpdateGradation();
|
||||||
|
@ -225,8 +229,10 @@ private:
|
||||||
void ToolBarTools();
|
void ToolBarTools();
|
||||||
void InitToolButtons();
|
void InitToolButtons();
|
||||||
void CancelTool();
|
void CancelTool();
|
||||||
|
|
||||||
void SetEnableWidgets(bool enable);
|
void SetEnableWidgets(bool enable);
|
||||||
void SetEnableTool(bool enable);
|
void SetEnableTool(bool enable);
|
||||||
|
|
||||||
void SaveCurrentScene();
|
void SaveCurrentScene();
|
||||||
void RestoreCurrentScene();
|
void RestoreCurrentScene();
|
||||||
void MinimumScrollBar();
|
void MinimumScrollBar();
|
||||||
|
@ -276,6 +282,8 @@ private:
|
||||||
void FileClosedCorrect();
|
void FileClosedCorrect();
|
||||||
QStringList GetUnlokedRestoreFileList()const;
|
QStringList GetUnlokedRestoreFileList()const;
|
||||||
void ToolBarStyle(QToolBar *bar);
|
void ToolBarStyle(QToolBar *bar);
|
||||||
|
|
||||||
|
void AddPP(const QString &PPName, const QString &path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
|
@ -887,6 +887,9 @@
|
||||||
<addaction name="actionLayout"/>
|
<addaction name="actionLayout"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QToolBar" name="toolBarDraws">
|
<widget class="QToolBar" name="toolBarDraws">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>10</pointsize>
|
<pointsize>10</pointsize>
|
||||||
|
@ -1127,6 +1130,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionNewDraw">
|
<action name="actionNewDraw">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="share/resources/icon.qrc">
|
<iconset resource="share/resources/icon.qrc">
|
||||||
<normaloff>:/icon/32x32/new_draw.png</normaloff>:/icon/32x32/new_draw.png</iconset>
|
<normaloff>:/icon/32x32/new_draw.png</normaloff>:/icon/32x32/new_draw.png</iconset>
|
||||||
|
@ -1142,6 +1148,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionOptionDraw">
|
<action name="actionOptionDraw">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="share/resources/icon.qrc">
|
<iconset resource="share/resources/icon.qrc">
|
||||||
<normaloff>:/icon/32x32/option_draw.png</normaloff>:/icon/32x32/option_draw.png</iconset>
|
<normaloff>:/icon/32x32/option_draw.png</normaloff>:/icon/32x32/option_draw.png</iconset>
|
||||||
|
@ -1157,6 +1166,9 @@
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="share/resources/icon.qrc">
|
<iconset resource="share/resources/icon.qrc">
|
||||||
<normaloff>:/icon/32x32/table.png</normaloff>:/icon/32x32/table.png</iconset>
|
<normaloff>:/icon/32x32/table.png</normaloff>:/icon/32x32/table.png</iconset>
|
||||||
|
@ -1175,6 +1187,9 @@
|
||||||
<property name="checkable">
|
<property name="checkable">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="share/resources/icon.qrc">
|
<iconset resource="share/resources/icon.qrc">
|
||||||
<normaloff>:/icon/32x32/history.png</normaloff>:/icon/32x32/history.png</iconset>
|
<normaloff>:/icon/32x32/history.png</normaloff>:/icon/32x32/history.png</iconset>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user