Create new process when you open new pattern and have usaved chages in current.
--HG-- branch : develop
This commit is contained in:
parent
a5e980e369
commit
5545eafb6e
|
@ -80,7 +80,14 @@ void VApplication::NewValentina(const QString &fileName)
|
||||||
QProcess *v = new QProcess();
|
QProcess *v = new QProcess();
|
||||||
QStringList arguments;
|
QStringList arguments;
|
||||||
arguments << fileName;
|
arguments << fileName;
|
||||||
v->startDetached(QCoreApplication::applicationFilePath(), arguments);
|
if (fileName.isEmpty())
|
||||||
|
{
|
||||||
|
v->startDetached(QCoreApplication::applicationFilePath());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
v->startDetached(QCoreApplication::applicationFilePath(), arguments);
|
||||||
|
}
|
||||||
delete v;
|
delete v;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ class VApplication : public QApplication
|
||||||
public:
|
public:
|
||||||
VApplication(int &argc, char ** argv);
|
VApplication(int &argc, char ** argv);
|
||||||
virtual ~VApplication() {}
|
virtual ~VApplication() {}
|
||||||
static void NewValentina(const QString &fileName);
|
static void NewValentina(const QString &fileName = QString());
|
||||||
static void CheckFactor(qreal &oldFactor, const qreal &Newfactor);
|
static void CheckFactor(qreal &oldFactor, const qreal &Newfactor);
|
||||||
virtual bool notify(QObject * receiver, QEvent * event);
|
virtual bool notify(QObject * receiver, QEvent * event);
|
||||||
Unit patternUnit() const;
|
Unit patternUnit() const;
|
||||||
|
|
|
@ -195,14 +195,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
for (int i=0;i<args.size();++i)
|
for (int i=0;i<args.size();++i)
|
||||||
{
|
{
|
||||||
if (i == 0)
|
w.LoadPattern(args.at(i));
|
||||||
{
|
|
||||||
w.LoadPattern(args.at(i));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
VApplication::NewValentina(args.at(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|
|
@ -1616,12 +1616,7 @@ void MainWindow::UpdateSizesList(const QStringList &list)
|
||||||
*/
|
*/
|
||||||
void MainWindow::NewPattern()
|
void MainWindow::NewPattern()
|
||||||
{
|
{
|
||||||
if (this->isWindowModified() || curFile.isEmpty() == false)
|
OpenNewValentina();
|
||||||
{
|
|
||||||
QProcess *v = new QProcess(this);
|
|
||||||
v->startDetached(QCoreApplication::applicationFilePath ());
|
|
||||||
delete v;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
@ -2058,6 +2053,15 @@ void MainWindow::PropertyBrowser()
|
||||||
connect(doc, &VPattern::FullUpdateFromFile, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions);
|
connect(doc, &VPattern::FullUpdateFromFile, toolOptions, &VToolOptionsPropertyBrowser::UpdateOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
void MainWindow::OpenNewValentina(const QString &fileName) const
|
||||||
|
{
|
||||||
|
if (this->isWindowModified() || curFile.isEmpty() == false)
|
||||||
|
{
|
||||||
|
VApplication::NewValentina(fileName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void MainWindow::CreateActions()
|
void MainWindow::CreateActions()
|
||||||
{
|
{
|
||||||
|
@ -2166,6 +2170,9 @@ MainWindow::~MainWindow()
|
||||||
*/
|
*/
|
||||||
void MainWindow::LoadPattern(const QString &fileName)
|
void MainWindow::LoadPattern(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
//We have unsaved changes or load more then one file per time
|
||||||
|
OpenNewValentina(fileName);
|
||||||
|
|
||||||
// On this stage scene empty. Fit scene size to view size
|
// On this stage scene empty. Fit scene size to view size
|
||||||
VAbstractTool::NewSceneRect(sceneDraw, ui->view);
|
VAbstractTool::NewSceneRect(sceneDraw, ui->view);
|
||||||
VAbstractTool::NewSceneRect(sceneDetails, ui->view);
|
VAbstractTool::NewSceneRect(sceneDetails, ui->view);
|
||||||
|
|
|
@ -252,6 +252,7 @@ private:
|
||||||
|
|
||||||
void AddDocks();
|
void AddDocks();
|
||||||
void PropertyBrowser();
|
void PropertyBrowser();
|
||||||
|
void OpenNewValentina(const QString &fileName = QString())const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MAINWINDOW_H
|
#endif // MAINWINDOW_H
|
||||||
|
|
Loading…
Reference in New Issue
Block a user