Switching pattern pieces do not require lite parse enough will be to set

current data set.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-01-29 17:29:23 +02:00
parent a693f9e57d
commit de4267c3c3

View File

@ -1870,7 +1870,6 @@ void MainWindow::ActionDraw(bool checked)
drawMode = true; drawMode = true;
SetEnableTool(true); SetEnableTool(true);
doc->setCurrentData();
ui->toolBox->setCurrentIndex(currentToolBoxIndex); ui->toolBox->setCurrentIndex(currentToolBoxIndex);
ui->actionHistory->setEnabled(true); ui->actionHistory->setEnabled(true);
@ -1913,10 +1912,18 @@ void MainWindow::ActionDetails(bool checked)
if (checked) if (checked)
{ {
ArrowTool(); ArrowTool();
const QHash<quint32, VDetail> *details = pattern->DataDetails();
if(drawMode)
{
currentDrawIndex = comboBoxDraws->currentIndex();//save current pattern peace
drawMode = false;
}
comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1);// Need to get data about all details
comboBoxDraws->setEnabled(false);
if(not qApp->getOpeningPattern()) if(not qApp->getOpeningPattern())
{ {
if (details->count() == 0) if (pattern->DataDetails()->count() == 0)
{ {
QMessageBox::information(this, tr("Detail mode"), tr("You can't use now the Detail mode. " QMessageBox::information(this, tr("Detail mode"), tr("You can't use now the Detail mode. "
"Please, create at least one workpiece."), "Please, create at least one workpiece."),
@ -1942,14 +1949,6 @@ void MainWindow::ActionDetails(bool checked)
disconnect(ui->view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor); disconnect(ui->view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
RestoreCurrentScene(); RestoreCurrentScene();
if(drawMode)
{
currentDrawIndex = comboBoxDraws->currentIndex();//save current pattern peace
drawMode = false;
}
comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1);
comboBoxDraws->setEnabled(false);
if (mode == Draw::Calculation) if (mode == Draw::Calculation)
{ {
currentToolBoxIndex = ui->toolBox->currentIndex(); currentToolBoxIndex = ui->toolBox->currentIndex();
@ -2000,6 +1999,15 @@ void MainWindow::ActionLayout(bool checked)
if (checked) if (checked)
{ {
ArrowTool(); ArrowTool();
if(drawMode)
{
currentDrawIndex = comboBoxDraws->currentIndex();//save current pattern peace
drawMode = false;
}
comboBoxDraws->setCurrentIndex(comboBoxDraws->count()-1);// Need to get data about all details
comboBoxDraws->setEnabled(false);
const QHash<quint32, VDetail> *details = pattern->DataDetails(); const QHash<quint32, VDetail> *details = pattern->DataDetails();
if(not qApp->getOpeningPattern()) if(not qApp->getOpeningPattern())
{ {
@ -2013,6 +2021,8 @@ void MainWindow::ActionLayout(bool checked)
} }
} }
comboBoxDraws->setCurrentIndex(-1);// Hide pattern pieces
qCDebug(vMainWindow, "Show layout scene"); qCDebug(vMainWindow, "Show layout scene");
leftGoToStage->setPixmap(QPixmap("://icon/24x24/right_to_left_arrow.png")); leftGoToStage->setPixmap(QPixmap("://icon/24x24/right_to_left_arrow.png"));
@ -2030,14 +2040,6 @@ void MainWindow::ActionLayout(bool checked)
ui->view->setScene(currentScene); ui->view->setScene(currentScene);
disconnect(ui->view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor); disconnect(ui->view, &VMainGraphicsView::NewFactor, sceneDraw, &VMainGraphicsScene::SetFactor);
if(drawMode)
{
currentDrawIndex = comboBoxDraws->currentIndex();//save current pattern peace
drawMode = false;
}
comboBoxDraws->setCurrentIndex(-1);
comboBoxDraws->setEnabled(false);
if (mode == Draw::Calculation) if (mode == Draw::Calculation)
{ {
currentToolBoxIndex = ui->toolBox->currentIndex(); currentToolBoxIndex = ui->toolBox->currentIndex();
@ -3912,7 +3914,7 @@ void MainWindow::ChangePP(int index, bool zoomBestFit)
if (index != -1) if (index != -1)
{ {
doc->ChangeActivPP(comboBoxDraws->itemText(index)); doc->ChangeActivPP(comboBoxDraws->itemText(index));
doc->LiteParseTree(Document::LiteParse); doc->setCurrentData();
emit RefreshHistory(); emit RefreshHistory();
if (drawMode) if (drawMode)
{ {