Resolved issue #569. Tape app. Options that open new file open new instance
even if a user doesn't want this. --HG-- branch : release
This commit is contained in:
parent
913d60148f
commit
e69bae1578
|
@ -20,6 +20,7 @@
|
||||||
- [#548] Bug Detail tool. Case when seam allowance is wrong.
|
- [#548] Bug Detail tool. Case when seam allowance is wrong.
|
||||||
- Called the main app in console mode doesn't show opening file error in some cases.
|
- Called the main app in console mode doesn't show opening file error in some cases.
|
||||||
- [#553] Tape.exe crash. Issue with the Search field.
|
- [#553] Tape.exe crash. Issue with the Search field.
|
||||||
|
- [#569] Tape app. Options that open new file open new instance even if a user doesn't want this.
|
||||||
|
|
||||||
# Version 0.4.4 April 12, 2016
|
# Version 0.4.4 April 12, 2016
|
||||||
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.
|
- Updated measurement templates with all measurements. Added new template Aldrich/Women measurements.
|
||||||
|
|
|
@ -371,46 +371,31 @@ void TMainWindow::FileNew()
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::OpenIndividual()
|
void TMainWindow::OpenIndividual()
|
||||||
{
|
|
||||||
if (m == nullptr)
|
|
||||||
{
|
{
|
||||||
const QString filter = tr("Individual measurements (*.vit);;Standard measurements (*.vst);;All files (*.*)");
|
const QString filter = tr("Individual measurements (*.vit);;Standard measurements (*.vst);;All files (*.*)");
|
||||||
//Use standard path to individual measurements
|
//Use standard path to individual measurements
|
||||||
const QString pathTo = qApp->TapeSettings()->GetPathIndividualMeasurements();
|
const QString pathTo = qApp->TapeSettings()->GetPathIndividualMeasurements();
|
||||||
|
|
||||||
Open(pathTo, filter);
|
Open(pathTo, filter);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
qApp->NewMainWindow();
|
|
||||||
qApp->MainWindow()->OpenIndividual();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::OpenStandard()
|
void TMainWindow::OpenStandard()
|
||||||
{
|
|
||||||
if (m == nullptr)
|
|
||||||
{
|
{
|
||||||
const QString filter = tr("Standard measurements (*.vst);;Individual measurements (*.vit);;All files (*.*)");
|
const QString filter = tr("Standard measurements (*.vst);;Individual measurements (*.vit);;All files (*.*)");
|
||||||
//Use standard path to standard measurements
|
//Use standard path to standard measurements
|
||||||
const QString pathTo = qApp->TapeSettings()->GetPathStandardMeasurements();
|
const QString pathTo = qApp->TapeSettings()->GetPathStandardMeasurements();
|
||||||
|
|
||||||
Open(pathTo, filter);
|
Open(pathTo, filter);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
qApp->NewMainWindow();
|
|
||||||
qApp->MainWindow()->OpenStandard();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::OpenTemplate()
|
void TMainWindow::OpenTemplate()
|
||||||
{
|
|
||||||
if (m == nullptr)
|
|
||||||
{
|
{
|
||||||
const QString filter = tr("Measurements (*.vst *.vit);;All files (*.*)");
|
const QString filter = tr("Measurements (*.vst *.vit);;All files (*.*)");
|
||||||
//Use standard path to template files
|
//Use standard path to template files
|
||||||
const QString pathTo = qApp->TapeSettings()->GetPathTemplate();
|
const QString pathTo = qApp->TapeSettings()->GetPathTemplate();
|
||||||
|
|
||||||
Open(pathTo, filter);
|
Open(pathTo, filter);
|
||||||
|
|
||||||
if (m != nullptr)
|
if (m != nullptr)
|
||||||
|
@ -419,17 +404,9 @@ void TMainWindow::OpenTemplate()
|
||||||
lock.reset();// remove lock from template
|
lock.reset();// remove lock from template
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
qApp->NewMainWindow();
|
|
||||||
qApp->MainWindow()->OpenTemplate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
void TMainWindow::CreateFromExisting()
|
void TMainWindow::CreateFromExisting()
|
||||||
{
|
|
||||||
if (m == nullptr)
|
|
||||||
{
|
{
|
||||||
const QString filter = tr("Individual measurements (*.vit)");
|
const QString filter = tr("Individual measurements (*.vit)");
|
||||||
//Use standard path to standard measurements
|
//Use standard path to standard measurements
|
||||||
|
@ -437,14 +414,15 @@ void TMainWindow::CreateFromExisting()
|
||||||
const QString mPath = QFileDialog::getOpenFileName(this, tr("Select file"), pathTo, filter);
|
const QString mPath = QFileDialog::getOpenFileName(this, tr("Select file"), pathTo, filter);
|
||||||
|
|
||||||
if (not mPath.isEmpty())
|
if (not mPath.isEmpty())
|
||||||
|
{
|
||||||
|
if (m == nullptr)
|
||||||
{
|
{
|
||||||
LoadFromExistingFile(mPath);
|
LoadFromExistingFile(mPath);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qApp->NewMainWindow();
|
qApp->NewMainWindow()->CreateFromExisting();
|
||||||
qApp->MainWindow()->CreateFromExisting();
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2337,13 +2315,16 @@ void TMainWindow::Open(const QString &pathTo, const QString &filter)
|
||||||
{
|
{
|
||||||
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), pathTo, filter);
|
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), pathTo, filter);
|
||||||
|
|
||||||
if (mPath.isEmpty())
|
if (not mPath.isEmpty())
|
||||||
{
|
{
|
||||||
return;
|
if (m == nullptr)
|
||||||
|
{
|
||||||
|
LoadFile(mPath);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoadFile(mPath);
|
qApp->NewMainWindow()->LoadFile(mPath);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user