X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=c700976d798c4ff8498286dc7f3df52d5b75b24c;hb=f24ae2128609d5ab8c9a57dfd9dbb46afb7302a9;hp=66faffce9a31d62e2b77f8ea3194e67eaf73ead2;hpb=67a95fc0511260daf0a92709e8a835a090b467d8;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 66faffc..c700976 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -31,6 +31,7 @@ #include "settings.h" #include "filepicker.h" #include "configdialog.h" +#include "generaltab.h" #include "version.h" #include "jaguar.h" @@ -39,6 +40,11 @@ #include "file.h" #include "joystick.h" +#ifdef __GCCWIN32__ +// Apparently on win32, usleep() is not pulled in by the usual suspects. +#include +#endif + // Uncomment this to use built-in BIOS/CD-ROM BIOS // You'll need a copy of jagboot.h & jagcd.h for this to work...! //#define USE_BUILT_IN_BIOS @@ -75,7 +81,6 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); - ReadSettings(); setUnifiedTitleAndToolBarOnMac(true); // Create actions @@ -179,6 +184,8 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit // Create status bar statusBar()->showMessage(tr("Ready")); + ReadSettings(); + // Set toolbar buttons/menus based on settings read in (sync the UI)... blurAct->setChecked(vjs.glFilter); x1Act->setChecked(zoomLevel == 1); @@ -217,6 +224,8 @@ MainWin::MainWin(): running(false), powerButtonOn(false), showUntunedTankCircuit CDBIOSLoaded = (JaguarLoadROM(jaguarCDBootROM, vjs.CDBootPath) == 0x40000 ? true : false); WriteLog("VJ: CD BIOS is %savailable...\n", (CDBIOSLoaded ? "" : "not ")); #endif + + filePickWin->ScanSoftwareFolder(allowUnknownSoftware); } void MainWin::closeEvent(QCloseEvent * event) @@ -274,11 +283,27 @@ void MainWin::Configure(void) { // Call the configuration dialog and update settings ConfigDialog dlg(this); + //ick. + dlg.generalTab->useUnknownSoftware->setChecked(allowUnknownSoftware); if (dlg.exec() == false) return; + QString before = vjs.ROMPath; dlg.UpdateVJSettings(); + QString after = vjs.ROMPath; + + bool allowOld = allowUnknownSoftware; + //ick. + allowUnknownSoftware = dlg.generalTab->useUnknownSoftware->isChecked(); + + // We rescan the "software" folder if the user either changed the path or + // checked/unchecked the "Allow unknown files" option in the config dialog. + if ((before != after) || (allowOld != allowUnknownSoftware)) + filePickWin->ScanSoftwareFolder(allowUnknownSoftware); + + // Just in case we crash before a clean exit... + WriteSettings(); } // @@ -567,6 +592,7 @@ void MainWin::ReadSettings(void) filePickWin->move(pos); zoomLevel = settings.value("zoom", 1).toInt(); + allowUnknownSoftware = settings.value("showUnknownSoftware", false).toBool(); vjs.useJoystick = settings.value("useJoystick", false).toBool(); vjs.joyport = settings.value("joyport", 0).toInt(); @@ -643,6 +669,7 @@ void MainWin::WriteSettings(void) settings.setValue("cartLoadPos", filePickWin->pos()); settings.setValue("zoom", zoomLevel); + settings.setValue("showUnknownSoftware", allowUnknownSoftware); settings.setValue("useJoystick", vjs.useJoystick); settings.setValue("joyport", vjs.joyport);