// JPM 11/04/2017 Added the local window\r
// JPM 08/31/2018 Added the call stack window\r
// JPM 09/04/2018 Added the new Models and BIOS handler\r
+// JPM 09/17/2018 Added a screenshot feature\r
//\r
\r
// FIXED:\r
powerAct->setChecked(false);\r
connect(powerAct, SIGNAL(triggered()), this, SLOT(TogglePowerState()));\r
\r
+ // Pause feature\r
QIcon pauseIcon;\r
pauseIcon.addFile(":/res/pause-off.png", QSize(), QIcon::Normal, QIcon::Off);\r
pauseIcon.addFile(":/res/pause-on.png", QSize(), QIcon::Normal, QIcon::On);\r
pauseAct->setShortcutContext(Qt::ApplicationShortcut);\r
connect(pauseAct, SIGNAL(triggered()), this, SLOT(ToggleRunState()));\r
\r
+ // Screenshot feature\r
+ screenshotAct = new QAction(QIcon(":/res/screenshot.png"), tr("&Screenshot"), this);\r
+ screenshotAct->setShortcut(QKeySequence(tr(vjs.KBContent[KBSCREENSHOT].KBSettingValue)));\r
+ screenshotAct->setShortcutContext(Qt::ApplicationShortcut);\r
+ screenshotAct->setCheckable(false);\r
+ screenshotAct->setDisabled(false);\r
+ connect(screenshotAct, SIGNAL(triggered()), this, SLOT(MakeScreenshot()));\r
+\r
zoomActs = new QActionGroup(this);\r
\r
x1Act = new QAction(QIcon(":/res/zoom100.png"), tr("Zoom 100%"), zoomActs);\r
allWatchBrowseAct->setStatusTip(tr("Shows all Watch browser window"));\r
connect(allWatchBrowseAct, SIGNAL(triggered()), this, SLOT(ShowAllWatchBrowserWin()));\r
\r
- LocalBrowseAct = new QAction(QIcon(":/res/debug-local.png"), tr("Local"), this);\r
- LocalBrowseAct->setStatusTip(tr("Shows Local browser window"));\r
+ LocalBrowseAct = new QAction(QIcon(":/res/debug-local.png"), tr("Locals"), this);\r
+ LocalBrowseAct->setStatusTip(tr("Shows Locals browser window"));\r
connect(LocalBrowseAct, SIGNAL(triggered()), this, SLOT(ShowLocalBrowserWin()));\r
\r
heapallocatorBrowseAct = new QAction(QIcon(""), tr("Heap allocator"), this);\r
toolbar->addSeparator();\r
if (!vjs.softTypeDebugger)\r
{\r
+ toolbar->addAction(screenshotAct);\r
+ toolbar->addSeparator();\r
toolbar->addAction(x1Act);\r
toolbar->addAction(x2Act);\r
toolbar->addAction(x3Act);\r
vjs.useFastBlitter = settings.value("useFastBlitter", false).toBool();\r
strcpy(vjs.EEPROMPath, settings.value("EEPROMs", QStandardPaths::writableLocation(QStandardPaths::DataLocation).append("/eeproms/")).toString().toUtf8().data());\r
strcpy(vjs.ROMPath, settings.value("ROMs", QStandardPaths::writableLocation(QStandardPaths::DataLocation).append("/software/")).toString().toUtf8().data());\r
+ strcpy(vjs.screenshotPath, settings.value("Screenshots", QStandardPaths::writableLocation(QStandardPaths::DataLocation).append("/screenshots/")).toString().toUtf8().data());\r
\r
// Read settings from the Debugger mode\r
settings.beginGroup("debugger");\r
settings.setValue("CDBootROM", vjs.CDBootPath);\r
settings.setValue("EEPROMs", vjs.EEPROMPath);\r
settings.setValue("ROMs", vjs.ROMPath);\r
+ settings.setValue("Screenshots", vjs.screenshotPath);\r
\r
// Write settings from the Alpine mode\r
settings.beginGroup("alpine");\r
RefreshAlpineWindows();\r
}\r
}\r
+\r
+\r
+// Create and save screenshot\r
+void MainWin::MakeScreenshot(void)\r
+{\r
+ char Text[256];\r
+ QImage screenshot;\r
+ time_t now = time(0);\r
+ struct tm tstruct;\r
+\r
+ // Create filename\r
+ tstruct = *localtime(&now);\r
+ sprintf(Text, "%svj_%i%i%i_%i%i%i.jpg", vjs.screenshotPath, tstruct.tm_year, tstruct.tm_mon, tstruct.tm_mday, tstruct.tm_hour, tstruct.tm_min, tstruct.tm_sec);\r
+\r
+ // Create screenshot\r
+ screenshot = videoWidget->grabFrameBuffer();\r
+ screenshot.save(Text, "JPG", 100);\r
+}\r
+\r