- setWindowIcon(QIcon(":/res/vj.xpm"));
- setWindowTitle("Virtual Jaguar v2.0.0");
-
- QMenu * menu = menuBar()->addMenu(tr("&File"));
- QToolBar * toolbar = addToolBar(tr("x1"));
- /*QAction */ action = new QAction(tr("Toggle"), this);
- action->setStatusTip(tr("Toggle running state"));
- action->setCheckable(true);
- toolbar->addAction(action);
- connect(action, SIGNAL(triggered()), this, SLOT(ToggleRunState()));
-#if 0
-// createActions();
- newAct = new QAction(QIcon(":/images/new.png"), tr("&New"), this);
- newAct->setShortcuts(QKeySequence::New);
- newAct->setStatusTip(tr("Create a new file"));
- connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
-
- openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);
- openAct->setShortcuts(QKeySequence::Open);
- openAct->setStatusTip(tr("Open an existing file"));
- connect(openAct, SIGNAL(triggered()), this, SLOT(open()));
-
- aboutQtAct = new QAction(tr("About &Qt"), this);
- aboutQtAct->setStatusTip(tr("Show the Qt library's About box"));
- connect(aboutQtAct, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
-
-// createMenus();
- fileMenu = menuBar()->addMenu(tr("&File"));
- fileMenu->addAction(newAct);
- fileMenu->addAction(openAct);
- fileMenu->addAction(saveAct);
- fileMenu->addAction(saveAsAct);
- fileMenu->addSeparator();
- fileMenu->addAction(exitAct);
-
- editMenu = menuBar()->addMenu(tr("&Edit"));
- editMenu->addAction(cutAct);
- editMenu->addAction(copyAct);
- editMenu->addAction(pasteAct);
-
- menuBar()->addSeparator();
+ setWindowIcon(QIcon(":/res/vj-icon.png"));
+
+ QString title = QString(tr("Virtual Jaguar " VJ_RELEASE_VERSION ));
+
+ if (vjs.hardwareTypeAlpine)
+ title += QString(tr(" - Alpine Mode"));
+
+ setWindowTitle(title);
+
+ aboutWin = new AboutWindow(this);
+ helpWin = new HelpWindow(this);
+ filePickWin = new FilePickerWindow(this);
+ memBrowseWin = new MemoryBrowserWindow(this);
+ cpuBrowseWin = new CPUBrowserWindow(this);
+ opBrowseWin = new OPBrowserWindow(this);
+
+ videoWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+ setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
+
+ setUnifiedTitleAndToolBarOnMac(true);
+
+ // Create actions
+
+ quitAppAct = new QAction(tr("E&xit"), this);
+// quitAppAct->setShortcuts(QKeySequence::Quit);
+// quitAppAct->setShortcut(QKeySequence(tr("Alt+x")));
+ quitAppAct->setShortcut(QKeySequence(tr("Ctrl+q")));
+ quitAppAct->setStatusTip(tr("Quit Virtual Jaguar"));
+ connect(quitAppAct, SIGNAL(triggered()), this, SLOT(close()));
+
+ powerGreen.addFile(":/res/power-off.png", QSize(), QIcon::Normal, QIcon::Off);
+ powerGreen.addFile(":/res/power-on-green.png", QSize(), QIcon::Normal, QIcon::On);
+ powerRed.addFile(":/res/power-off.png", QSize(), QIcon::Normal, QIcon::Off);
+ powerRed.addFile(":/res/power-on-red.png", QSize(), QIcon::Normal, QIcon::On);
+
+// powerAct = new QAction(QIcon(":/res/power.png"), tr("&Power"), this);
+ powerAct = new QAction(powerGreen, tr("&Power"), this);
+ powerAct->setStatusTip(tr("Powers Jaguar on/off"));
+ powerAct->setCheckable(true);
+ powerAct->setChecked(false);
+// powerAct->setDisabled(true);
+ connect(powerAct, SIGNAL(triggered()), this, SLOT(TogglePowerState()));
+
+ QIcon pauseIcon;
+ pauseIcon.addFile(":/res/pause-off", QSize(), QIcon::Normal, QIcon::Off);
+ pauseIcon.addFile(":/res/pause-on", QSize(), QIcon::Normal, QIcon::On);
+// pauseAct = new QAction(QIcon(":/res/pause.png"), tr("Pause"), this);
+ pauseAct = new QAction(pauseIcon, tr("Pause"), this);
+ pauseAct->setStatusTip(tr("Toggles the running state"));
+ pauseAct->setCheckable(true);
+ pauseAct->setDisabled(true);
+ pauseAct->setShortcut(QKeySequence(tr("Esc")));
+ connect(pauseAct, SIGNAL(triggered()), this, SLOT(ToggleRunState()));
+
+ zoomActs = new QActionGroup(this);
+
+ x1Act = new QAction(QIcon(":/res/zoom100.png"), tr("Zoom 100%"), zoomActs);
+ x1Act->setStatusTip(tr("Set window zoom to 100%"));
+ x1Act->setCheckable(true);
+ connect(x1Act, SIGNAL(triggered()), this, SLOT(SetZoom100()));
+
+ x2Act = new QAction(QIcon(":/res/zoom200.png"), tr("Zoom 200%"), zoomActs);
+ x2Act->setStatusTip(tr("Set window zoom to 200%"));
+ x2Act->setCheckable(true);
+ connect(x2Act, SIGNAL(triggered()), this, SLOT(SetZoom200()));
+
+ x3Act = new QAction(QIcon(":/res/zoom300.png"), tr("Zoom 300%"), zoomActs);
+ x3Act->setStatusTip(tr("Set window zoom to 300%"));
+ x3Act->setCheckable(true);
+ connect(x3Act, SIGNAL(triggered()), this, SLOT(SetZoom300()));
+
+ tvTypeActs = new QActionGroup(this);
+
+ ntscAct = new QAction(QIcon(":/res/ntsc.png"), tr("NTSC"), tvTypeActs);
+ ntscAct->setStatusTip(tr("Sets Jaguar to NTSC mode"));
+ ntscAct->setCheckable(true);
+ connect(ntscAct, SIGNAL(triggered()), this, SLOT(SetNTSC()));
+
+ palAct = new QAction(QIcon(":/res/pal.png"), tr("PAL"), tvTypeActs);
+ palAct->setStatusTip(tr("Sets Jaguar to PAL mode"));
+ palAct->setCheckable(true);
+ connect(palAct, SIGNAL(triggered()), this, SLOT(SetPAL()));
+
+ blurAct = new QAction(QIcon(":/res/generic.png"), tr("Blur"), this);
+ blurAct->setStatusTip(tr("Sets OpenGL rendering to GL_NEAREST"));
+ blurAct->setCheckable(true);
+ connect(blurAct, SIGNAL(triggered()), this, SLOT(ToggleBlur()));
+
+ aboutAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&About..."), this);
+ aboutAct->setStatusTip(tr("Blatant self-promotion"));
+ connect(aboutAct, SIGNAL(triggered()), this, SLOT(ShowAboutWin()));
+
+ helpAct = new QAction(QIcon(":/res/vj-icon.png"), tr("&Contents..."), this);
+ helpAct->setStatusTip(tr("Help is available, if you should need it"));
+ connect(helpAct, SIGNAL(triggered()), this, SLOT(ShowHelpWin()));
+
+ filePickAct = new QAction(QIcon(":/res/software.png"), tr("&Insert Cartridge..."), this);
+ filePickAct->setStatusTip(tr("Insert a cartridge into Virtual Jaguar"));
+ filePickAct->setShortcut(QKeySequence(tr("Ctrl+i")));
+ connect(filePickAct, SIGNAL(triggered()), this, SLOT(InsertCart()));
+
+ configAct = new QAction(QIcon(":/res/wrench.png"), tr("&Configure"), this);
+ configAct->setStatusTip(tr("Configure options for Virtual Jaguar"));
+ configAct->setShortcut(QKeySequence(tr("Ctrl+c")));
+ connect(configAct, SIGNAL(triggered()), this, SLOT(Configure()));
+
+ useCDAct = new QAction(QIcon(":/res/compact-disc.png"), tr("&Use CD Unit"), this);
+ useCDAct->setStatusTip(tr("Use Jaguar Virtual CD unit"));
+// useCDAct->setShortcut(QKeySequence(tr("Ctrl+c")));
+ useCDAct->setCheckable(true);
+ connect(useCDAct, SIGNAL(triggered()), this, SLOT(ToggleCDUsage()));
+
+ frameAdvanceAct = new QAction(QIcon(":/res/frame-advance.png"), tr("&Frame Advance"), this);
+ frameAdvanceAct->setShortcut(QKeySequence(tr("F7")));
+ connect(frameAdvanceAct, SIGNAL(triggered()), this, SLOT(FrameAdvance()));
+
+ fullScreenAct = new QAction(QIcon(":/res/generic.png"), tr("F&ull Screen"), this);
+ fullScreenAct->setShortcut(QKeySequence(tr("F9")));
+ connect(fullScreenAct, SIGNAL(triggered()), this, SLOT(ToggleFullScreen()));
+
+ // Debugger Actions
+ memBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("Memory Browser"), this);
+ memBrowseAct->setStatusTip(tr("Shows the Jaguar memory browser window"));
+// memBrowseAct->setCheckable(true);
+ connect(memBrowseAct, SIGNAL(triggered()), this, SLOT(ShowMemoryBrowserWin()));
+
+ cpuBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("CPU Browser"), this);
+ cpuBrowseAct->setStatusTip(tr("Shows the Jaguar CPU browser window"));
+// memBrowseAct->setCheckable(true);
+ connect(cpuBrowseAct, SIGNAL(triggered()), this, SLOT(ShowCPUBrowserWin()));
+
+ opBrowseAct = new QAction(QIcon(":/res/generic.png"), tr("OP Browser"), this);
+ opBrowseAct->setStatusTip(tr("Shows the Jaguar OP browser window"));
+// memBrowseAct->setCheckable(true);
+ connect(opBrowseAct, SIGNAL(triggered()), this, SLOT(ShowOPBrowserWin()));
+
+ // Misc. connections...
+ connect(filePickWin, SIGNAL(RequestLoad(QString)), this, SLOT(LoadSoftware(QString)));
+ connect(filePickWin, SIGNAL(FilePickerHiding()), this, SLOT(Unpause()));
+
+ // Create menus & toolbars
+
+ fileMenu = menuBar()->addMenu(tr("&Jaguar"));
+ fileMenu->addAction(powerAct);
+ fileMenu->addAction(pauseAct);
+ fileMenu->addAction(frameAdvanceAct);
+ fileMenu->addAction(filePickAct);
+ fileMenu->addAction(useCDAct);
+ fileMenu->addAction(configAct);
+ fileMenu->addAction(quitAppAct);
+
+ if (vjs.hardwareTypeAlpine)
+ {
+ debugMenu = menuBar()->addMenu(tr("&Debug"));
+ debugMenu->addAction(memBrowseAct);
+ debugMenu->addAction(cpuBrowseAct);
+ debugMenu->addAction(opBrowseAct);
+ }