summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2014-09-17 12:54:58 +0200
committerStanislaw Halik <sthalik@misaki.pl>2014-09-17 12:54:58 +0200
commitdf84ea6740236bd377de7fefc90764831ce663b4 (patch)
treed2a6fa89e64fd090050988539d0afce713ad73d0 /ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
parent2b50200ca979cbf33d8e67503db341a6f62d1604 (diff)
ft proto: cleanup
Diffstat (limited to 'ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp')
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp35
1 files changed, 9 insertions, 26 deletions
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
index 5ce903b7..98d61675 100644
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
+++ b/ftnoir_protocol_ft/ftnoir_protocol_ft_dialog.cpp
@@ -26,21 +26,10 @@
#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()));
@@ -54,8 +43,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 );
}
@@ -75,22 +64,16 @@ void FTControls::doCancel() {
}
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" FTNOIR_PROTOCOL_BASE_EXPORT IProtocolDialog* CALLING_CONVENTION GetDialog()
{
return new FTControls;
}