--HG--
branch : feature
This commit is contained in:
BojanKverh 2016-07-03 10:24:25 +02:00
commit 180e1ddc90
4 changed files with 39 additions and 4 deletions

View File

@ -143,7 +143,10 @@ MainWindow::MainWindow(QWidget *parent)
connect(doc, &VPattern::CheckLayout, [this](){ connect(doc, &VPattern::CheckLayout, [this](){
if (pattern->DataDetails()->count() == 0) if (pattern->DataDetails()->count() == 0)
{ {
ActionDraw(true); if(not ui->actionDraw->isChecked())
{
ActionDraw(true);
}
} }
}); });
connect(doc, &VPattern::SetCurrentPP, this, &MainWindow::GlobalChangePP); connect(doc, &VPattern::SetCurrentPP, this, &MainWindow::GlobalChangePP);
@ -688,6 +691,7 @@ void MainWindow::ClosedDialogWithApply(int result)
vtool->FullUpdateFromGuiApply(); vtool->FullUpdateFromGuiApply();
} }
} }
SCASSERT(dialogTool != nullptr);
QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(dialogTool->GetAssociatedTool()); QGraphicsItem *tool = dynamic_cast<QGraphicsItem *>(dialogTool->GetAssociatedTool());
ui->view->itemClicked(tool); ui->view->itemClicked(tool);
if (dialogTool->GetAssociatedTool() != nullptr) if (dialogTool->GetAssociatedTool() != nullptr)

View File

@ -85,7 +85,7 @@ DialogDetail::DialogDetail(const VContainer *data, const quint32 &toolId, QWidge
connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams); connect(ui.checkBoxSeams, &QCheckBox::clicked, this, &DialogDetail::ClickedSeams);
connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed); connect(ui.checkBoxClosed, &QCheckBox::clicked, this, &DialogDetail::ClickedClosed);
connect(ui.checkBoxReverse, &QCheckBox::clicked, this, &DialogDetail::ClickedReverse); connect(ui.checkBoxReverse, &QCheckBox::clicked, this, &DialogDetail::ClickedReverse);
connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NamePointChanged); connect(ui.lineEditNameDetail, &QLineEdit::textChanged, this, &DialogDetail::NameDetailChanged);
connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem); connect(ui.toolButtonDelete, &QToolButton::clicked, this, &DialogDetail::DeleteItem);
connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp); connect(ui.toolButtonUp, &QToolButton::clicked, this, &DialogDetail::ScrollUp);
@ -245,6 +245,27 @@ void DialogDetail::Remove()
SetAddMode(); SetAddMode();
} }
//---------------------------------------------------------------------------------------------------------------------
void DialogDetail::NameDetailChanged()
{
SCASSERT(labelEditNamePoint != nullptr);
QLineEdit* edit = qobject_cast<QLineEdit*>(sender());
if (edit)
{
if (edit->text().isEmpty())
{
flagName = false;
ChangeColor(labelEditNamePoint, Qt::red);
}
else
{
flagName = true;
ChangeColor(labelEditNamePoint, okColor);
}
}
CheckState();
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
/** /**
* @brief NewItem add new object (point, arc, spline or spline path) to list * @brief NewItem add new object (point, arc, spline or spline path) to list

View File

@ -70,6 +70,8 @@ protected slots:
void Cancel(); void Cancel();
void Remove(); void Remove();
private slots:
void NameDetailChanged();
private: private:
/** @brief ui keeps information about user interface */ /** @brief ui keeps information about user interface */

View File

@ -928,8 +928,16 @@ void DialogTool::Build(const Tool &type)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogTool::SetAssociatedTool(VAbstractTool *tool) void DialogTool::SetAssociatedTool(VAbstractTool *tool)
{ {
this->associatedTool=tool; if (tool != nullptr)
SetToolId(tool->getId()); {
associatedTool = tool;
SetToolId(tool->getId());
}
else
{
associatedTool = nullptr;
SetToolId(NULL_ID);
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------