diff options
Diffstat (limited to 'ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp')
-rw-r--r-- | ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp index 5ce903b7..3e440607 100644 --- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp +++ b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp @@ -26,26 +26,14 @@ #include <QDebug> #include <QFileDialog> -//******************************************************************************************************* -// FaceTrackNoIR Client Settings-dialog. -//******************************************************************************************************* - -// -// Constructor for server-settings-dialog -// -FTControls::FTControls() : - QWidget() +FTControls::FTControls() { - QString aFileName; // File Path and Name - ui.setupUi( this ); - // Connect Qt signals to member-functions connect(ui.buttonBox, SIGNAL(accepted()), this, SLOT(doOK())); connect(ui.buttonBox, SIGNAL(rejected()), this, SLOT(doCancel())); connect(ui.bntLocateNPClient, SIGNAL(clicked()), this, SLOT(selectDLL())); - tie_setting(s.useDummyExe, ui.chkStartDummy); tie_setting(s.useTIRViews, ui.chkTIRViews); ui.cbxSelectInterface->addItem("Enable both"); @@ -54,8 +42,8 @@ FTControls::FTControls() : tie_setting(s.intUsedInterface, ui.cbxSelectInterface); - aFileName = QCoreApplication::applicationDirPath() + "/TIRViews.dll"; - if ( !QFile::exists( aFileName ) ) { + QFile memhacks_pathname(QCoreApplication::applicationDirPath() + "/TIRViews.dll"); + if (!memhacks_pathname.exists()) { ui.chkTIRViews->setChecked( false ); ui.chkTIRViews->setEnabled ( false ); } @@ -70,27 +58,21 @@ void FTControls::doOK() { } void FTControls::doCancel() { - s.b->revert(); + s.b->reload(); this->close(); } void FTControls::selectDLL() { - QString fileName = QFileDialog::getOpenFileName( this, tr("Select the desired NPClient DLL"), QCoreApplication::applicationDirPath() + "/NPClient.dll", tr("Dll file (*.dll);;All Files (*)")); - - // - // Write the location of the file in the required Registry-key. - // - if (! fileName.isEmpty() ) { - if (fileName.endsWith("NPClient.dll", Qt::CaseInsensitive) ) { - QSettings settingsTIR("NaturalPoint", "NATURALPOINT\\NPClient Location"); // Registry settings (in HK_USER) - QString aLocation = fileName.left(fileName.length() - 12); // Location of Client DLL + QString filename = QFileDialog::getOpenFileName( this, tr("Select the desired NPClient DLL"), QCoreApplication::applicationDirPath() + "/NPClient.dll", tr("Dll file (*.dll);;All Files (*)")); - settingsTIR.setValue( "Path" , aLocation ); - } + if (! filename.isEmpty() ) { + QSettings node("NaturalPoint", "NATURALPOINT\\NPClient Location"); + QFileInfo dllname(filename); + node.setValue( "Path" , dllname.dir().path() ); } } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocolDialog* CALLING_CONVENTION GetDialog( ) +extern "C" OPENTRACK_EXPORT IProtocolDialog* GetDialog() { return new FTControls; } |