Puzzle app. Open new window only if current already has been used.
This commit is contained in:
parent
97d4e6378a
commit
a138352d1c
|
@ -3552,12 +3552,20 @@ void VPMainWindow::on_actionOpen_triggered()
|
||||||
|
|
||||||
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), pathTo, filter, nullptr,
|
const QString mPath = QFileDialog::getOpenFileName(this, tr("Open file"), pathTo, filter, nullptr,
|
||||||
VAbstractApplication::VApp()->NativeFileDialog());
|
VAbstractApplication::VApp()->NativeFileDialog());
|
||||||
|
if (mPath.isEmpty())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (not mPath.isEmpty())
|
if (curFile.isEmpty() && !this->isWindowModified())
|
||||||
|
{
|
||||||
|
VPApplication::VApp()->MainWindow()->LoadFile(mPath);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
VPApplication::VApp()->NewMainWindow()->LoadFile(mPath);
|
VPApplication::VApp()->NewMainWindow()->LoadFile(mPath);
|
||||||
VPApplication::VApp()->PuzzleSettings()->SetPathManualLayouts(QFileInfo(mPath).absolutePath());
|
|
||||||
}
|
}
|
||||||
|
VPApplication::VApp()->PuzzleSettings()->SetPathManualLayouts(QFileInfo(mPath).absolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------------------------------------------------
|
//---------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue
Block a user