Merged develop into feature

--HG--
branch : feature
This commit is contained in:
Bojan Kverh 2016-07-19 23:00:37 +02:00
commit 608b566006
9 changed files with 27 additions and 10 deletions

View File

@ -50,7 +50,8 @@ DialogAboutTape::DialogAboutTape(QWidget *parent)
//mApp->Settings()->GetOsSeparator() ? setLocale(QLocale::system()) : setLocale(QLocale(QLocale::C));
RetranslateUi();
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this](){
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
qWarning() << tr("Cannot open your default browser");

View File

@ -61,7 +61,8 @@ DialogAboutApp::DialogAboutApp(QWidget *parent) :
ui->pushButton_Web_Site->setText(tr("Web site : %1").arg(VER_COMPANYDOMAIN_STR));
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this](){
connect(ui->pushButton_Web_Site, &QPushButton::clicked, [this]()
{
if ( QDesktopServices::openUrl(QUrl(VER_COMPANYDOMAIN_STR)) == false)
{
qWarning() << tr("Cannot open your default browser");

View File

@ -140,7 +140,8 @@ MainWindow::MainWindow(QWidget *parent)
connect(doc, &VPattern::patternChanged, this, &MainWindow::PatternChangesWereSaved);
connect(doc, &VPattern::UndoCommand, this, &MainWindow::FullParseFile);
connect(doc, &VPattern::SetEnabledGUI, this, &MainWindow::SetEnabledGUI);
connect(doc, &VPattern::CheckLayout, [this](){
connect(doc, &VPattern::CheckLayout, [this]()
{
if (pattern->DataDetails()->count() == 0)
{
if(not ui->actionDraw->isChecked())

View File

@ -1157,6 +1157,18 @@ void VAbstractPattern::haveLiteChange()
emit patternChanged(false);
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::NeedFullParsing()
{
emit UndoCommand();
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::ClearScene()
{
emit ClearMainWindow();
}
//---------------------------------------------------------------------------------------------------------------------
void VAbstractPattern::ToolExists(const quint32 &id) const
{

View File

@ -281,6 +281,8 @@ signals:
public slots:
virtual void LiteParseTree(const Document &parse)=0;
void haveLiteChange();
void NeedFullParsing();
void ClearScene();
protected:
/** @brief nameActivDraw name current pattern peace. */

View File

@ -143,8 +143,8 @@ void VToolBasePoint::AddToFile()
patternPiece.appendChild(doc->createElement(VAbstractPattern::TagDetails));
AddPatternPiece *addPP = new AddPatternPiece(patternPiece, doc, namePP);
connect(addPP, &AddPatternPiece::ClearScene, [this](){emit doc->ClearMainWindow();});
connect(addPP, &AddPatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(addPP, &AddPatternPiece::ClearScene, doc, &VAbstractPattern::ClearScene);
connect(addPP, &AddPatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(addPP);
}
@ -233,7 +233,7 @@ void VToolBasePoint::DeleteTool(bool ask)
qCDebug(vTool, "Begin deleting.");
DeletePatternPiece *deletePP = new DeletePatternPiece(doc, nameActivDraw);
connect(deletePP, &DeletePatternPiece::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(deletePP, &DeletePatternPiece::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(deletePP);
// Throw exception, this will help prevent case when we forget to immediately quit function.

View File

@ -372,7 +372,7 @@ qreal VDrawTool::CheckFormula(const quint32 &toolId, QString &formula, VContaine
void VDrawTool::AddToCalculation(const QDomElement &domElement)
{
AddToCalc *addToCal = new AddToCalc(domElement, doc);
connect(addToCal, &AddToCalc::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(addToCal, &AddToCalc::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(addToCal);
}

View File

@ -88,7 +88,7 @@ void VAbstractTool::DeleteTool(bool ask)
qCDebug(vTool, "Begin deleting.");
DelTool *delTool = new DelTool(doc, id);
connect(delTool, &DelTool::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(delTool, &DelTool::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(delTool);
// Throw exception, this will help prevent case when we forget to immediately quit function.

View File

@ -387,7 +387,7 @@ void VToolDetail::AddToFile()
}
AddDet *addDet = new AddDet(domElement, doc, detail, drawName);
connect(addDet, &AddDet::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(addDet, &AddDet::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
qApp->getUndoStack()->push(addDet);
}
@ -1084,7 +1084,7 @@ void VToolDetail::DeleteTool(bool ask)
return;
}
/* If UnionDetails tool delete detail no need emit FullParsing.*/
connect(delDet, &DeleteDetail::NeedFullParsing, [this](){emit doc->UndoCommand();});
connect(delDet, &DeleteDetail::NeedFullParsing, doc, &VAbstractPattern::NeedFullParsing);
}
qApp->getUndoStack()->push(delDet);