summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-12-28 00:39:25 +0100
committerStanislaw Halik <sthalik@misaki.pl>2013-12-28 00:39:25 +0100
commite7877ebef831f1cb36f911e2784af8268c26b5bb (patch)
treeca61551c7797380013390f2ec036b4004c5d2293
parenta4fe36ce7b86fbc9527da067a14682b82ef62e7a (diff)
simconnect: allow for multiple manifest attempts
-rw-r--r--ftnoir_protocol_sc/ftnoir-protocol-sc.rc3
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc.cpp10
-rw-r--r--ftnoir_protocol_sc/ftnoir_protocol_sc_dialog.cpp19
-rw-r--r--ftnoir_protocol_sc/ftnoir_sccontrols.ui146
-rw-r--r--ftnoir_protocol_sc/scserver-sp2.manifest13
5 files changed, 61 insertions, 130 deletions
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 <winuser.h>
-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 @@
<rect>
<x>0</x>
<y>0</y>
- <width>346</width>
- <height>104</height>
+ <width>258</width>
+ <height>61</height>
</rect>
</property>
<property name="windowTitle">
@@ -26,132 +26,34 @@
<property name="autoFillBackground">
<bool>false</bool>
</property>
- <layout class="QVBoxLayout" name="_vertical_layout">
- <item>
- <layout class="QHBoxLayout">
- <item>
- <widget class="QLabel" name="textLabel2">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>There are no setting necessary for SimConnect</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- <property name="wordWrap">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <spacer name="verticalSpacer">
- <property name="orientation">
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>20</width>
- <height>40</height>
- </size>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>FSX version</string>
</property>
- </spacer>
+ </widget>
</item>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
+ <item row="0" column="1">
+ <widget class="QComboBox" name="comboBox">
<item>
- <spacer name="horizontalSpacer_2">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>40</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
+ <property name="text">
+ <string>Acceleration</string>
+ </property>
</item>
<item>
- <layout class="QHBoxLayout" name="horizontalLayout_2">
- <property name="sizeConstraint">
- <enum>QLayout::SetDefaultConstraint</enum>
- </property>
- <item>
- <widget class="QPushButton" name="btnOK">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>OK</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="btnCancel">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>100</width>
- <height>16777215</height>
- </size>
- </property>
- <property name="text">
- <string>Cancel</string>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="text">
+ <string>SP2</string>
+ </property>
</item>
- <item>
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType">
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>10</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- </layout>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
</item>
</layout>
</widget>
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 @@
+<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
+<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.FlightSimulator.SimConnect ' version='10.0.60905.0' processorArchitecture='x86' publicKeyToken='67c7c14424d61b5b' />
+ </dependentAssembly>
+ </dependency>
+ <dependency>
+ <dependentAssembly>
+ <assemblyIdentity type='win32' name='Microsoft.VC80.CRT' version='8.0.50608.0' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b' />
+ </dependentAssembly>
+ </dependency>
+</assembly>