mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
Ref T705, remember matching script directories
This commit is contained in:
committed by
Mat Sutcliffe
parent
d5a4e3d70d
commit
1f148cf7f8
@@ -170,7 +170,9 @@ namespace BlackGui
|
||||
{
|
||||
const bool nw = (QObject::sender() == ui->pb_MsReverseLookup);
|
||||
QString fn = nw ? ui->le_MsReverseLookup->text() : ui->le_MsMatching->text();
|
||||
fn = QFileDialog::getOpenFileName(nullptr, tr("Matching script"), fn, "Matching script (*.js)");
|
||||
CDirectories swiftDirs = m_directories.get();
|
||||
|
||||
fn = QFileDialog::getOpenFileName(nullptr, tr("Matching script"), fn.isEmpty() ? swiftDirs.getMatchingScriptDirectoryOrDefault() : fn, "Matching script (*.js)");
|
||||
const QFileInfo fi(fn);
|
||||
if (!fi.exists()) { return; }
|
||||
if (nw)
|
||||
@@ -181,6 +183,9 @@ namespace BlackGui
|
||||
{
|
||||
ui->le_MsMatching->setText(fi.absoluteFilePath());
|
||||
}
|
||||
|
||||
swiftDirs.setMatchingScriptDirectory(fi.absolutePath());
|
||||
m_directories.setAndSave(swiftDirs);
|
||||
}
|
||||
|
||||
CAircraftMatcherSetup::MatchingAlgorithm CMatchingForm::algorithm() const
|
||||
|
||||
@@ -13,6 +13,8 @@
|
||||
|
||||
#include "form.h"
|
||||
#include "blackmisc/simulation/aircraftmatchersetup.h"
|
||||
#include "blackmisc/directories.h"
|
||||
|
||||
#include <QScopedPointer>
|
||||
|
||||
namespace Ui { class CMatchingForm; }
|
||||
@@ -77,6 +79,7 @@ namespace BlackGui
|
||||
//! Directory browser
|
||||
void fileDialog();
|
||||
|
||||
BlackMisc::CSetting<BlackMisc::Settings::TDirectorySettings> m_directories { this }; //!< the swift directories
|
||||
QScopedPointer<Ui::CMatchingForm> ui;
|
||||
};
|
||||
} // ns
|
||||
|
||||
@@ -115,7 +115,7 @@
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="lbl_MsMatching">
|
||||
<property name="text">
|
||||
<string>Matching:</string>
|
||||
<string>Matching</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -150,7 +150,7 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="lbl_MsReverseLookup">
|
||||
<property name="text">
|
||||
<string>Lookup:</string>
|
||||
<string>Lookup</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user