From e7877ebef831f1cb36f911e2784af8268c26b5bb Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 28 Dec 2013 00:39:25 +0100 Subject: simconnect: allow for multiple manifest attempts --- ftnoir_protocol_sc/ftnoir-protocol-sc.rc | 3 +- ftnoir_protocol_sc/ftnoir_protocol_sc.cpp | 10 +- ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp | 19 ++- ftnoir_protocol_sc/ftnoir_sccontrols.ui | 146 ++++------------------- ftnoir_protocol_sc/scserver-sp2.manifest | 13 ++ 5 files changed, 61 insertions(+), 130 deletions(-) create mode 100644 ftnoir_protocol_sc/scserver-sp2.manifest (limited to 'ftnoir_protocol_sc') diff --git a/ftnoir_protocol_sc/ftnoir-protocol-sc.rc b/ftnoir_protocol_sc/ftnoir-protocol-sc.rc index 3b43715e..693aa12e 100644 --- a/ftnoir_protocol_sc/ftnoir-protocol-sc.rc +++ b/ftnoir_protocol_sc/ftnoir-protocol-sc.rc @@ -1,2 +1,3 @@ #include -142 RT_MANIFEST scserver.manifest \ No newline at end of file +142 RT_MANIFEST scserver.manifest +143 RT_MANIFEST scserver-sp2.manifest diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp index e5d427dd..8449f6ce 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc.cpp @@ -76,7 +76,6 @@ FTNoIR_Protocol::~FTNoIR_Protocol() // Load the current Settings from the currently 'active' INI-file. // void FTNoIR_Protocol::loadSettings() { -// None yet... } // @@ -186,9 +185,14 @@ bool FTNoIR_Protocol::checkServerInstallationOK() { qDebug() << "SCCheckClientDLL says: Starting Function"; - SCClientLib.setFileName("SimConnect.DLL"); + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + iniFile.beginGroup ( "FSX" ); + int act = iniFile.value("version", 0).toInt(); + iniFile.endGroup(); - ActivationContext ctx(142); + ActivationContext ctx(142 + act); if (!SCClientLib.load()) { qDebug() << "SC load" << SCClientLib.errorString(); diff --git a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp index c2ddb72a..fb822145 100644 --- a/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp +++ b/ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp @@ -39,8 +39,8 @@ QWidget() ui.setupUi( this ); // Connect Qt signals to member-functions - connect(ui.btnOK, SIGNAL(clicked()), this, SLOT(doOK())); - connect(ui.btnCancel, SIGNAL(clicked()), this, SLOT(doCancel())); + connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); + connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); //connect(ui.cbxSelectPPJoyNumber, SIGNAL(currentIndexChanged(int)), this, SLOT(virtualJoystickSelected( int ))); theProtocol = NULL; @@ -118,7 +118,13 @@ void SCControls::doCancel() { // Load the current Settings from the currently 'active' INI-file. // void SCControls::loadSettings() { - + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + iniFile.beginGroup ( "FSX" ); + int act = iniFile.value("version", 0).toInt(); + iniFile.endGroup(); + ui.comboBox->setCurrentIndex(act); settingsDirty = false; } @@ -126,7 +132,12 @@ void SCControls::loadSettings() { // Save the current Settings to the currently 'active' INI-file. // void SCControls::save() { - + QSettings settings("opentrack"); + QString currentFile = settings.value ( "SettingsFile", QCoreApplication::applicationDirPath() + "/settings/default.ini" ).toString(); + QSettings iniFile( currentFile, QSettings::IniFormat ); // Application settings (in INI-file) + iniFile.beginGroup ( "FSX" ); + iniFile.setValue("version", ui.comboBox->currentIndex()); + iniFile.endGroup(); settingsDirty = false; } diff --git a/ftnoir_protocol_sc/ftnoir_sccontrols.ui b/ftnoir_protocol_sc/ftnoir_sccontrols.ui index be42072c..17e94c4b 100644 --- a/ftnoir_protocol_sc/ftnoir_sccontrols.ui +++ b/ftnoir_protocol_sc/ftnoir_sccontrols.ui @@ -9,8 +9,8 @@ 0 0 - 346 - 104 + 258 + 61 @@ -26,132 +26,34 @@ false - - - - - - - - 0 - 0 - - - - There are no setting necessary for SimConnect - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - false - - - - - - - - - Qt::Vertical - - - - 20 - 40 - + + + + + FSX version - + - - + + - - - Qt::Horizontal - - - - 40 - 20 - - - + + Acceleration + - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - OK - - - - - - - - 0 - 0 - - - - - 100 - 0 - - - - - 100 - 16777215 - - - - Cancel - - - - + + SP2 + - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 10 - 20 - - - - - + + + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + diff --git a/ftnoir_protocol_sc/scserver-sp2.manifest b/ftnoir_protocol_sc/scserver-sp2.manifest new file mode 100644 index 00000000..19b123ba --- /dev/null +++ b/ftnoir_protocol_sc/scserver-sp2.manifest @@ -0,0 +1,13 @@ + + + + + + + + + + + + + -- cgit v1.2.3