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();
|
||||
QStringList arguments;
|
||||
arguments << fileName;
|
||||
if (fileName.isEmpty())
|
||||
{
|
||||
v->startDetached(QCoreApplication::applicationFilePath());
|
||||
}
|
||||
else
|
||||
{
|
||||
v->startDetached(QCoreApplication::applicationFilePath(), arguments);
|
||||
}
|
||||
delete v;
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class VApplication : public QApplication
|
|||
public:
|
||||
VApplication(int &argc, char ** argv);
|
||||
virtual ~VApplication() {}
|
||||
static void NewValentina(const QString &fileName);
|
||||
static void NewValentina(const QString &fileName = QString());
|
||||
static void CheckFactor(qreal &oldFactor, const qreal &Newfactor);
|
||||
virtual bool notify(QObject * receiver, QEvent * event);
|
||||
Unit patternUnit() const;
|
||||
|
|
|
@ -194,16 +194,9 @@ int main(int argc, char *argv[])
|
|||
w.show();
|
||||
|
||||
for (int i=0;i<args.size();++i)
|
||||
{
|
||||
if (i == 0)
|
||||
{
|
||||
w.LoadPattern(args.at(i));
|
||||
}
|
||||
else
|
||||
{
|
||||
VApplication::NewValentina(args.at(i));
|
||||
}
|
||||
}
|
||||
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -1616,12 +1616,7 @@ void MainWindow::UpdateSizesList(const QStringList &list)
|
|||
*/
|
||||
void MainWindow::NewPattern()
|
||||
{
|
||||
if (this->isWindowModified() || curFile.isEmpty() == false)
|
||||
{
|
||||
QProcess *v = new QProcess(this);
|
||||
v->startDetached(QCoreApplication::applicationFilePath ());
|
||||
delete v;
|
||||
}
|
||||
OpenNewValentina();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -2058,6 +2053,15 @@ void MainWindow::PropertyBrowser()
|
|||
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()
|
||||
{
|
||||
|
@ -2166,6 +2170,9 @@ MainWindow::~MainWindow()
|
|||
*/
|
||||
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
|
||||
VAbstractTool::NewSceneRect(sceneDraw, ui->view);
|
||||
VAbstractTool::NewSceneRect(sceneDetails, ui->view);
|
||||
|
|
|
@ -252,6 +252,7 @@ private:
|
|||
|
||||
void AddDocks();
|
||||
void PropertyBrowser();
|
||||
void OpenNewValentina(const QString &fileName = QString())const;
|
||||
};
|
||||
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
Loading…
Reference in New Issue
Block a user