X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fconfigdialog.cpp;h=1fd8be49c5230ed1a66f53e3f954777f51cd02e3;hb=3bfba0b6be74e6eff2854c779bdb9a958385068e;hp=4107e6b6748020d9c9cff6f9bc3e199da8346b23;hpb=62b541c6c09933ea0daf800ecd86467f6f15b584;p=virtualjaguar diff --git a/src/gui/configdialog.cpp b/src/gui/configdialog.cpp index 4107e6b..1fd8be4 100644 --- a/src/gui/configdialog.cpp +++ b/src/gui/configdialog.cpp @@ -1,22 +1,24 @@ // // configdialog.cpp - Configuration dialog // -// by James L. Hammons +// by James Hammons // (C) 2010 Underground Software // -// JLH = James L. Hammons +// JLH = James Hammons // // Who When What // --- ---------- ------------------------------------------------------------- // JLH 01/29/2010 Created this file // JLH 06/23/2011 Added initial implementation +// JLH 10/14/2011 Fixed possibly missing final slash in paths // #include "configdialog.h" -#include "generaltab.h" -#include "controllertab.h" #include "alpinetab.h" +#include "controllertab.h" +#include "controllerwidget.h" +#include "generaltab.h" #include "settings.h" @@ -50,8 +52,8 @@ ConfigDialog::ConfigDialog(QWidget * parent/*= 0*/): QDialog(parent) setWindowTitle(tr("Virtual Jaguar Settings")); LoadDialogFromSettings(); - controllerTab1->UpdateLabel(); // Now it's safe to do this... ;-) - controllerTab2->UpdateLabel(); // Now it's safe to do this... ;-) +// controllerTab1->UpdateLabel(); // Now it's safe to do this... ;-) +// controllerTab2->UpdateLabel(); // Now it's safe to do this... ;-) } ConfigDialog::~ConfigDialog() @@ -66,8 +68,9 @@ void ConfigDialog::LoadDialogFromSettings(void) generalTab->edit4->setText(vjs.ROMPath); generalTab->useBIOS->setChecked(vjs.useJaguarBIOS); + generalTab->useGPU->setChecked(vjs.GPUEnabled); generalTab->useDSP->setChecked(vjs.DSPEnabled); - generalTab->useHostAudio->setChecked(vjs.audioEnabled); +// generalTab->useHostAudio->setChecked(vjs.audioEnabled); if (vjs.hardwareTypeAlpine) { @@ -78,8 +81,8 @@ void ConfigDialog::LoadDialogFromSettings(void) for(int i=0; i<21; i++) { - controllerTab1->p1Keys[i] = vjs.p1KeyBindings[i]; - controllerTab2->p1Keys[i] = vjs.p2KeyBindings[i]; + controllerTab1->controllerWidget->keys[i] = vjs.p1KeyBindings[i]; + controllerTab2->controllerWidget->keys[i] = vjs.p2KeyBindings[i]; } } @@ -87,12 +90,15 @@ void ConfigDialog::UpdateVJSettings(void) { strcpy(vjs.jagBootPath, generalTab->edit1->text().toAscii().data()); strcpy(vjs.CDBootPath, generalTab->edit2->text().toAscii().data()); - strcpy(vjs.EEPROMPath, generalTab->edit3->text().toAscii().data()); - strcpy(vjs.ROMPath, generalTab->edit4->text().toAscii().data()); + strcpy(vjs.EEPROMPath, CheckForTrailingSlash( + generalTab->edit3->text()).toAscii().data()); + strcpy(vjs.ROMPath, CheckForTrailingSlash( + generalTab->edit4->text()).toAscii().data()); vjs.useJaguarBIOS = generalTab->useBIOS->isChecked(); + vjs.GPUEnabled = generalTab->useGPU->isChecked(); vjs.DSPEnabled = generalTab->useDSP->isChecked(); - vjs.audioEnabled = generalTab->useHostAudio->isChecked(); +// vjs.audioEnabled = generalTab->useHostAudio->isChecked(); if (vjs.hardwareTypeAlpine) { @@ -103,7 +109,15 @@ void ConfigDialog::UpdateVJSettings(void) for(int i=0; i<21; i++) { - vjs.p1KeyBindings[i] = controllerTab1->p1Keys[i]; - vjs.p2KeyBindings[i] = controllerTab2->p1Keys[i]; + vjs.p1KeyBindings[i] = controllerTab1->controllerWidget->keys[i]; + vjs.p2KeyBindings[i] = controllerTab2->controllerWidget->keys[i]; } } + +QString ConfigDialog::CheckForTrailingSlash(QString s) +{ + if (!s.endsWith('/') && !s.endsWith('\\')) + s.append('/'); + + return s; +}