mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-08-11 12:15:36 +08:00
refs #209
* open directory of simconnect.cfg file * open directory of settings file menu item * reset settings menu item
This commit is contained in:
@@ -437,6 +437,8 @@ private slots:
|
||||
//! Save a simconnect.cfg file for FSX
|
||||
void saveSimConnectCfg();
|
||||
|
||||
//!Open directoryfor simconnect.cfg (if local)
|
||||
void openSimConnectCfg();
|
||||
};
|
||||
|
||||
#pragma pop_macro("interface")
|
||||
|
||||
@@ -454,7 +454,7 @@ QStatusBar QLabel {
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>7</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="pg_StatusPage">
|
||||
<property name="sizePolicy">
|
||||
@@ -564,8 +564,8 @@ QStatusBar QLabel {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>326</width>
|
||||
<height>267</height>
|
||||
<width>90</width>
|
||||
<height>59</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -607,8 +607,8 @@ QStatusBar QLabel {
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>326</width>
|
||||
<height>267</height>
|
||||
<width>90</width>
|
||||
<height>55</height>
|
||||
</rect>
|
||||
</property>
|
||||
<attribute name="label">
|
||||
@@ -640,7 +640,6 @@ QStatusBar QLabel {
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>-1</pointsize>
|
||||
<weight>75</weight>
|
||||
<italic>false</italic>
|
||||
@@ -1794,7 +1793,7 @@ QStatusBar QLabel {
|
||||
<item>
|
||||
<widget class="QTabWidget" name="Simulator">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tb_SettingsTrafficNetwork">
|
||||
<attribute name="title">
|
||||
@@ -3134,6 +3133,9 @@ QStatusBar QLabel {
|
||||
<property name="title">
|
||||
<string>File</string>
|
||||
</property>
|
||||
<addaction name="menu_FileSettingsDirectory"/>
|
||||
<addaction name="menu_FileResetSettings"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="menu_FileClose"/>
|
||||
</widget>
|
||||
<addaction name="menu_File"/>
|
||||
@@ -3187,6 +3189,16 @@ QStatusBar QLabel {
|
||||
<string>Close</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_FileSettingsDirectory">
|
||||
<property name="text">
|
||||
<string>Settings directory</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="menu_FileResetSettings">
|
||||
<property name="text">
|
||||
<string>Reset settings</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<customwidgets>
|
||||
|
||||
@@ -298,6 +298,8 @@ void MainWindow::initGuiSignals()
|
||||
this->connect(this->ui->menu_TestLocationsEDNX, &QAction::triggered, this, &MainWindow::menuClicked);
|
||||
this->connect(this->ui->menu_TestLocationsEDRY, &QAction::triggered, this, &MainWindow::menuClicked);
|
||||
this->connect(this->ui->menu_FileClose, &QAction::triggered, this, &MainWindow::menuClicked);
|
||||
this->connect(this->ui->menu_FileSettingsDirectory, &QAction::triggered, this, &MainWindow::menuClicked);
|
||||
this->connect(this->ui->menu_FileResetSettings, &QAction::triggered, this, &MainWindow::menuClicked);
|
||||
|
||||
// command line
|
||||
this->connect(this->ui->le_CommandLineInput, &QLineEdit::returnPressed, this, &MainWindow::commandEntered);
|
||||
@@ -357,6 +359,7 @@ void MainWindow::initGuiSignals()
|
||||
// Settings simulator
|
||||
this->connect(this->ui->pb_SettingsSimulatorFsxTestConnection, &QPushButton::clicked, this, &MainWindow::testSimConnectConnection);
|
||||
this->connect(this->ui->pb_SettingsSimulatorFsxSaveSimconnectCfg, &QPushButton::clicked, this, &MainWindow::saveSimConnectCfg);
|
||||
this->connect(this->ui->pb_SettingsSimulatorFsxOpenSimconnectCfg, &QPushButton::clicked, this, &MainWindow::openSimConnectCfg);
|
||||
|
||||
// no warnings in release build
|
||||
Q_UNUSED(connected);
|
||||
|
||||
@@ -45,6 +45,16 @@ void MainWindow::menuClicked()
|
||||
msgs.insert(CStatusMessage::getInfoMessage("Closing"));
|
||||
this->close();
|
||||
}
|
||||
else if (sender == this->ui->menu_FileSettingsDirectory)
|
||||
{
|
||||
QString path = QDir::toNativeSeparators(BlackMisc::Settings::CSettingUtilities::getSettingsDirectory());
|
||||
QDesktopServices::openUrl(QUrl("file:///" + path));
|
||||
}
|
||||
else if (sender == this->ui->menu_FileResetSettings)
|
||||
{
|
||||
Q_ASSERT(this->m_rt->getIContextSettings());
|
||||
msgs.insert(this->m_rt->getIContextSettings()->reset(true));
|
||||
}
|
||||
if (!msgs.isEmpty()) this->displayStatusMessages(msgs);
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
#include "blackmisc/networkutils.h"
|
||||
#include "blacksim/fsx/fsxsimulatorsetup.h"
|
||||
#include "blacksim/fsx/simconnectutilities.h"
|
||||
#include <QDesktopServices>
|
||||
|
||||
using namespace BlackCore;
|
||||
using namespace BlackMisc;
|
||||
@@ -223,3 +224,10 @@ void MainWindow::saveSimConnectCfg()
|
||||
this->displayStatusMessage(CStatusMessage(CStatusMessage::TypeTrafficNetwork, CStatusMessage::SeverityError, m));
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::openSimConnectCfg()
|
||||
{
|
||||
QFileInfo fi(CSimConnectUtilities::getLocalSimConnectCfgFilename());
|
||||
QString path = QDir::toNativeSeparators(fi.absolutePath());
|
||||
QDesktopServices::openUrl(QUrl("file:///" + path ));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user