X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fmainwin.cpp;h=7b7a2de3e21735497d76b7164a071566e6f5e783;hb=b79146c85ed8f85acc80fe56534f72cd777f0b02;hp=40af9eb4b1ad31e6820a7aa8c5ca266a2c7d6c1a;hpb=e6b7d61963423b7f9cb4c6c24d2befca50328d4f;p=virtualjaguar diff --git a/src/gui/mainwin.cpp b/src/gui/mainwin.cpp index 40af9eb..7b7a2de 100644 --- a/src/gui/mainwin.cpp +++ b/src/gui/mainwin.cpp @@ -30,6 +30,7 @@ #include "glwidget.h" #include "about.h" #include "settings.h" +#include "filepicker.h" // The way BSNES controls things is by setting a timer with a zero // timeout, sleeping if not emulating anything. Seems there has to be a @@ -50,7 +51,11 @@ MainWin::MainWin() setWindowIcon(QIcon(":/res/vj.xpm")); setWindowTitle("Virtual Jaguar v2.0.0"); + ReadSettings(); + setUnifiedTitleAndToolBarOnMac(true); + aboutWin = new AboutWindow(this); + filePickWin = new FilePickerWindow(this); videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); @@ -87,12 +92,12 @@ MainWin::MainWin() tvTypeActs = new QActionGroup(this); ntscAct = new QAction(QIcon(":/res/generic.png"), tr("NTSC"), tvTypeActs); - ntscAct->setStatusTip(tr("Sets OpenGL rendering to GL_NEAREST")); + ntscAct->setStatusTip(tr("Sets Jaguar to NTSC mode")); ntscAct->setCheckable(true); connect(ntscAct, SIGNAL(triggered()), this, SLOT(SetNTSC())); palAct = new QAction(QIcon(":/res/generic.png"), tr("PAL"), tvTypeActs); - palAct->setStatusTip(tr("Sets OpenGL rendering to GL_NEAREST")); + palAct->setStatusTip(tr("Sets Jaguar to PAL mode")); palAct->setCheckable(true); connect(palAct, SIGNAL(triggered()), this, SLOT(SetPAL())); @@ -102,35 +107,39 @@ MainWin::MainWin() connect(blurAct, SIGNAL(triggered()), this, SLOT(ToggleBlur())); aboutAct = new QAction(QIcon(":/res/generic.png"), tr("&About..."), this); - aboutAct->setStatusTip(tr("Shows self-serving credits")); -// aboutAct->setCheckable(true); + aboutAct->setStatusTip(tr("Blatant self-promotion")); connect(aboutAct, SIGNAL(triggered()), this, SLOT(ShowAboutWin())); + filePickAct = new QAction(QIcon(":/res/generic.png"), tr("&Insert Cartridge..."), this); + filePickAct->setStatusTip(tr("Insert a cartridge into Virtual Jaguar")); + connect(filePickAct, SIGNAL(triggered()), this, SLOT(InsertCart())); + // Create menus & toolbars fileMenu = menuBar()->addMenu(tr("&File")); + fileMenu->addAction(filePickAct); fileMenu->addAction(powerAct); fileMenu->addAction(quitAppAct); - fileMenu = menuBar()->addMenu(tr("&Help")); - fileMenu->addAction(aboutAct); + helpMenu = menuBar()->addMenu(tr("&Help")); + helpMenu->addAction(aboutAct); - QToolBar * toolbar = addToolBar(tr("Stuff")); + toolbar = addToolBar(tr("Stuff")); toolbar->addAction(powerAct); + toolbar->addSeparator(); toolbar->addAction(x1Act); toolbar->addAction(x2Act); toolbar->addAction(x3Act); + toolbar->addSeparator(); toolbar->addAction(ntscAct); toolbar->addAction(palAct); + toolbar->addSeparator(); toolbar->addAction(blurAct); // Create status bar statusBar()->showMessage(tr("Ready")); - ReadSettings(); - setUnifiedTitleAndToolBarOnMac(true); - - // Set toolbar button based on setting read in (sync the UI)... + // Set toolbar buttons/menus based on settings read in (sync the UI)... blurAct->setChecked(vjs.glFilter); x1Act->setChecked(zoomLevel == 1); x2Act->setChecked(zoomLevel == 2); @@ -139,7 +148,7 @@ MainWin::MainWin() ntscAct->setChecked(vjs.hardwareTypeNTSC); palAct->setChecked(!vjs.hardwareTypeNTSC); - // Do this in case original size isn't correct + // Do this in case original size isn't correct (mostly for the first-run case) ResizeMainWindow(); // Set up timer based loop for animation... @@ -229,10 +238,11 @@ void MainWin::ToggleBlur(void) void MainWin::ShowAboutWin(void) { aboutWin->show(); -// QMessageBox::about(this, tr("About Application"), -// tr("The Application example demonstrates how to " -// "write modern GUI applications using Qt, with a menu bar, " -// "toolbars, and a status bar.")); +} + +void MainWin::InsertCart(void) +{ + filePickWin->show(); } void MainWin::ResizeMainWindow(void) @@ -269,6 +279,10 @@ void MainWin::ReadSettings(void) vjs.useOpenGL = settings.value("useOpenGL", true).toBool(); vjs.glFilter = settings.value("glFilterType", 0).toInt(); vjs.renderType = settings.value("renderType", 0).toInt(); + + // Hardcoded, !!! FIX !!! +#warning "!!! FIX !!! ROMPath is hardcoded!" + strcpy(vjs.ROMPath, "./software"); } void MainWin::WriteSettings(void)