mirror of https://github.com/stella-emu/stella.git
A few more tweaks to the new UI stuff.
Removed older browsing mode where the listing is scanned by md5sum, since it wasn't really useful any more. Basically, the default is to now use 'rombrowse' mode, where the listing acts like an actual filesystem. Related to this, removed 'rombrowse', 'modtime' and 'lastrom' settings. Reworked the FileSnapDialog wrt the previous point. The rombrowse toggle button and 'Reload' button were no longer relevant. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1341 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
eb02480491
commit
f49eb18079
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FSNode.hxx,v 1.11 2007-01-01 18:04:48 stephena Exp $
|
// $Id: FSNode.hxx,v 1.12 2007-08-07 14:38:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -140,11 +140,6 @@ class AbstractFilesystemNode
|
||||||
*/
|
*/
|
||||||
static bool makeDir(const string& path);
|
static bool makeDir(const string& path);
|
||||||
|
|
||||||
/**
|
|
||||||
Return a string representing the last modification time of this file/dir.
|
|
||||||
*/
|
|
||||||
static string modTime(const string& path);
|
|
||||||
|
|
||||||
/* TODO:
|
/* TODO:
|
||||||
bool isReadable();
|
bool isReadable();
|
||||||
bool isWriteable();
|
bool isWriteable();
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FrameBuffer.cxx,v 1.120 2007-07-31 15:46:20 stephena Exp $
|
// $Id: FrameBuffer.cxx,v 1.121 2007-08-07 14:38:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -569,7 +569,7 @@ void FrameBuffer::frameRect(uInt32 x, uInt32 y, uInt32 w, uInt32 h,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kDashLine:
|
case kDashLine:
|
||||||
unsigned int i, skip, lwidth = 0;
|
unsigned int i, skip, lwidth = 1;
|
||||||
|
|
||||||
for(i = x, skip = 1; i < x+w-1; i=i+lwidth+1, ++skip)
|
for(i = x, skip = 1; i < x+w-1; i=i+lwidth+1, ++skip)
|
||||||
{
|
{
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OSystem.cxx,v 1.102 2007-08-06 21:32:10 stephena Exp $
|
// $Id: OSystem.cxx,v 1.103 2007-08-07 14:38:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -804,7 +804,7 @@ uInt32 OSystem::ourGUIColors[kNumUIPalettes][kNumColors-256] = {
|
||||||
0x000000, // kTextColor
|
0x000000, // kTextColor
|
||||||
0x62a108, // kTextColorHi
|
0x62a108, // kTextColorHi
|
||||||
0xc80000, // kTextColorEm
|
0xc80000, // kTextColorEm
|
||||||
0xe69d10, // kDlgColor
|
0xc9af7c, // kDlgColor
|
||||||
0xf0f0cf, // kListColor
|
0xf0f0cf, // kListColor
|
||||||
0xac3410, // kBtnColor
|
0xac3410, // kBtnColor
|
||||||
0xd55941, // kBtnColorHi
|
0xd55941, // kBtnColorHi
|
||||||
|
@ -815,9 +815,6 @@ uInt32 OSystem::ourGUIColors[kNumUIPalettes][kNumColors-256] = {
|
||||||
0xc80000 // kWidColor
|
0xc80000 // kWidColor
|
||||||
},
|
},
|
||||||
|
|
||||||
/* { 0x686868, 0xffe69c, 0x404040, 0xc8c8ff, 0x000000, 0x62a108, 0xc80000 }, */
|
|
||||||
|
|
||||||
|
|
||||||
// GP2X
|
// GP2X
|
||||||
{ 0x686868, 0x000000, 0x404040, 0xc8c8ff, 0x20a020, 0x0000ff, 0xc80000,
|
{ 0x686868, 0x000000, 0x404040, 0xc8c8ff, 0x20a020, 0x0000ff, 0xc80000,
|
||||||
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
|
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Settings.cxx,v 1.120 2007-07-27 13:49:16 stephena Exp $
|
// $Id: Settings.cxx,v 1.121 2007-08-07 14:38:51 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -76,18 +76,15 @@ Settings::Settings(OSystem* osystem)
|
||||||
setInternal("sssingle", "false");
|
setInternal("sssingle", "false");
|
||||||
|
|
||||||
setInternal("romdir", "");
|
setInternal("romdir", "");
|
||||||
setInternal("rombrowse", "true");
|
|
||||||
setInternal("lastrom", "");
|
|
||||||
setInternal("modtime", "");
|
|
||||||
setInternal("debugheight", "0");
|
|
||||||
setInternal("launcherres", "320x240");
|
|
||||||
setInternal("uipalette", "0");
|
|
||||||
setInternal("autoslot", "false");
|
|
||||||
|
|
||||||
setInternal("statedir", "");
|
setInternal("statedir", "");
|
||||||
setInternal("cheatfile", "");
|
setInternal("cheatfile", "");
|
||||||
setInternal("palettefile", "");
|
setInternal("palettefile", "");
|
||||||
setInternal("propsfile", "");
|
setInternal("propsfile", "");
|
||||||
|
|
||||||
|
setInternal("debugheight", "0");
|
||||||
|
setInternal("launcherres", "400x300");
|
||||||
|
setInternal("uipalette", "0");
|
||||||
|
setInternal("autoslot", "false");
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -302,7 +299,6 @@ void Settings::usage()
|
||||||
<< " -p2speed <number> Speed of emulated mouse movement for paddle 2 (0-100)\n"
|
<< " -p2speed <number> Speed of emulated mouse movement for paddle 2 (0-100)\n"
|
||||||
<< " -p3speed <number> Speed of emulated mouse movement for paddle 3 (0-100)\n"
|
<< " -p3speed <number> Speed of emulated mouse movement for paddle 3 (0-100)\n"
|
||||||
<< " -pthresh <number> Set threshold for eliminating paddle jitter\n"
|
<< " -pthresh <number> Set threshold for eliminating paddle jitter\n"
|
||||||
<< " -rombrowse <1|0> Use ROM browser mode (shows files and folders)\n"
|
|
||||||
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
<< " -autoslot <1|0> Automatically switch to next save slot when state saving\n"
|
||||||
<< " -ssdir <path> The directory to save snapshot files to\n"
|
<< " -ssdir <path> The directory to save snapshot files to\n"
|
||||||
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
<< " -sssingle <1|0> Generate single snapshot instead of many\n"
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FSNodeGP2X.cxx,v 1.4 2007-01-01 18:04:51 stephena Exp $
|
// $Id: FSNodeGP2X.cxx,v 1.5 2007-08-07 14:38:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -227,16 +227,3 @@ bool AbstractFilesystemNode::makeDir(const string& path)
|
||||||
{
|
{
|
||||||
return mkdir(path.c_str(), 0777) == 0;
|
return mkdir(path.c_str(), 0777) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
string AbstractFilesystemNode::modTime(const string& path)
|
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
if(stat(path.c_str(), &st) != 0)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
ostringstream buf;
|
|
||||||
buf << st.st_mtime;
|
|
||||||
|
|
||||||
return buf.str();
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: EditableWidget.cxx,v 1.22 2007-08-06 20:16:51 stephena Exp $
|
// $Id: EditableWidget.cxx,v 1.23 2007-08-07 14:38:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -194,7 +194,7 @@ void EditableWidget::drawCaret()
|
||||||
y += _y;
|
y += _y;
|
||||||
|
|
||||||
FrameBuffer& fb = _boss->instance()->frameBuffer();
|
FrameBuffer& fb = _boss->instance()->frameBuffer();
|
||||||
fb.vLine(x, y+2, y + editRect.height() - 2, color);
|
fb.vLine(x, y+2, y + editRect.height() - 3, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -13,18 +13,18 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FileSnapDialog.cxx,v 1.9 2007-07-27 13:49:16 stephena Exp $
|
// $Id: FileSnapDialog.cxx,v 1.10 2007-08-07 14:38:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
#include "bspf.hxx"
|
||||||
|
|
||||||
#include "FSNode.hxx"
|
#include "FSNode.hxx"
|
||||||
#include "DialogContainer.hxx"
|
#include "DialogContainer.hxx"
|
||||||
#include "BrowserDialog.hxx"
|
#include "BrowserDialog.hxx"
|
||||||
#include "EditTextWidget.hxx"
|
#include "EditTextWidget.hxx"
|
||||||
#include "TabWidget.hxx"
|
|
||||||
#include "bspf.hxx"
|
|
||||||
#include "LauncherDialog.hxx"
|
#include "LauncherDialog.hxx"
|
||||||
#include "FileSnapDialog.hxx"
|
#include "FileSnapDialog.hxx"
|
||||||
|
|
||||||
|
@ -38,130 +38,90 @@ FileSnapDialog::FileSnapDialog(
|
||||||
myBrowser(NULL),
|
myBrowser(NULL),
|
||||||
myIsGlobal(boss != 0)
|
myIsGlobal(boss != 0)
|
||||||
{
|
{
|
||||||
const int vBorder = 4;
|
const int vBorder = 8;
|
||||||
int xpos, ypos, bwidth, bheight;
|
int xpos, ypos, bwidth, bheight;
|
||||||
WidgetArray wid;
|
WidgetArray wid;
|
||||||
ButtonWidget* b;
|
ButtonWidget* b;
|
||||||
int tabID;
|
|
||||||
|
|
||||||
bwidth = font.getStringWidth("Cancel") + 20;
|
bwidth = font.getStringWidth("Properties file:") + 20;
|
||||||
bheight = font.getLineHeight() + 4;
|
bheight = font.getLineHeight() + 4;
|
||||||
|
|
||||||
// The tab widget
|
xpos = vBorder; ypos = vBorder;
|
||||||
xpos = 2; ypos = vBorder;
|
|
||||||
myTab = new TabWidget(this, font, xpos, ypos, _w - 2*xpos, _h - 2*bheight - ypos);
|
|
||||||
addTabWidget(myTab);
|
|
||||||
addFocusWidget(myTab);
|
|
||||||
|
|
||||||
// 1) The browser settings tab
|
|
||||||
wid.clear();
|
|
||||||
tabID = myTab->addTab("Browser Settings");
|
|
||||||
|
|
||||||
// ROM path
|
// ROM path
|
||||||
xpos = 15; ypos += 5;
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Rom path:",
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Path",
|
|
||||||
kChooseRomDirCmd);
|
kChooseRomDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myRomPath = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
myRomPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
// Use ROM browse mode
|
|
||||||
xpos = 30; ypos += myRomPath->getHeight() + 8;
|
|
||||||
myBrowseCheckbox = new CheckboxWidget(myTab, font, xpos, ypos,
|
|
||||||
"Browse folders", kBrowseDirCmd);
|
|
||||||
wid.push_back(myBrowseCheckbox);
|
|
||||||
|
|
||||||
// Reload current ROM listing
|
|
||||||
xpos += myBrowseCheckbox->getWidth() + 20;
|
|
||||||
myReloadButton = new ButtonWidget(myTab, font, xpos, ypos-2,
|
|
||||||
font.getStringWidth("Reload ROM Listing") + 20,
|
|
||||||
bheight,
|
|
||||||
"Reload ROM Listing", kReloadRomDirCmd);
|
|
||||||
// myReloadButton->setEditable(true);
|
|
||||||
wid.push_back(myReloadButton);
|
|
||||||
|
|
||||||
// ROM settings are disabled while in game mode
|
// ROM settings are disabled while in game mode
|
||||||
if(!myIsGlobal)
|
if(!myIsGlobal)
|
||||||
{
|
{
|
||||||
myTab->disableTab(0);
|
b->clearFlags(WIDGET_ENABLED);
|
||||||
// TODO - until I get the above method working, we also need to
|
myRomPath->setEditable(false);
|
||||||
// disable the specific widgets ourself
|
|
||||||
myRomPath->clearFlags(WIDGET_ENABLED);
|
|
||||||
for(unsigned int i = 0; i < wid.size(); ++i)
|
|
||||||
wid[i]->clearFlags(WIDGET_ENABLED);
|
|
||||||
}
|
}
|
||||||
// Add focus widgets for ROM tab
|
|
||||||
addToFocusList(wid, tabID);
|
|
||||||
|
|
||||||
// 2) The configuration files tab
|
|
||||||
wid.clear();
|
|
||||||
tabID = myTab->addTab(" Config Files ");
|
|
||||||
|
|
||||||
bwidth = font.getStringWidth("Properties file:") + 20;
|
|
||||||
|
|
||||||
// State directory
|
// State directory
|
||||||
xpos = 15; ypos = vBorder + 5;
|
xpos = vBorder; ypos += b->getHeight() + 3;
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "State path:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "State path:",
|
||||||
kChooseStateDirCmd);
|
kChooseStateDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myStatePath = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
myStatePath = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myStatePath);
|
wid.push_back(myStatePath);
|
||||||
|
|
||||||
// Cheat file
|
// Cheat file
|
||||||
xpos = 15; ypos += b->getHeight() + 3;
|
xpos = vBorder; ypos += b->getHeight() + 3;
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Cheat file:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Cheat file:",
|
||||||
kChooseCheatFileCmd);
|
kChooseCheatFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myCheatFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
myCheatFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myCheatFile);
|
wid.push_back(myCheatFile);
|
||||||
|
|
||||||
// Palette file
|
// Palette file
|
||||||
xpos = 15; ypos += b->getHeight() + 3;
|
xpos = vBorder; ypos += b->getHeight() + 3;
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Palette file:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Palette file:",
|
||||||
kChoosePaletteFileCmd);
|
kChoosePaletteFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myPaletteFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
myPaletteFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myPaletteFile);
|
wid.push_back(myPaletteFile);
|
||||||
|
|
||||||
// Properties file
|
// Properties file
|
||||||
xpos = 15; ypos += b->getHeight() + 3;
|
xpos = vBorder; ypos += b->getHeight() + 3;
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Properties file:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Properties file:",
|
||||||
kChoosePropsFileCmd);
|
kChoosePropsFileCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
myPropsFile = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
myPropsFile = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(myPropsFile);
|
wid.push_back(myPropsFile);
|
||||||
|
|
||||||
// Snapshot path
|
// Snapshot path
|
||||||
xpos = 15; ypos += b->getHeight() + 3;
|
xpos = vBorder; ypos += b->getHeight() + 3;
|
||||||
b = new ButtonWidget(myTab, font, xpos, ypos, bwidth, bheight, "Snapshot path:",
|
b = new ButtonWidget(this, font, xpos, ypos, bwidth, bheight, "Snapshot path:",
|
||||||
kChooseSnapDirCmd);
|
kChooseSnapDirCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
xpos += bwidth + 10;
|
xpos += bwidth + 10;
|
||||||
mySnapPath = new EditTextWidget(myTab, font, xpos, ypos + 2,
|
mySnapPath = new EditTextWidget(this, font, xpos, ypos + 2,
|
||||||
_w - xpos - 10, font.getLineHeight(), "");
|
_w - xpos - 10, font.getLineHeight(), "");
|
||||||
wid.push_back(mySnapPath);
|
wid.push_back(mySnapPath);
|
||||||
|
|
||||||
// Snapshot single or multiple saves
|
// Snapshot single or multiple saves
|
||||||
xpos = 30; ypos += mySnapPath->getHeight() + 8;
|
xpos = 30; ypos += mySnapPath->getHeight() + 8;
|
||||||
mySnapSingleCheckbox = new CheckboxWidget(myTab, font, xpos, ypos,
|
mySnapSingleCheckbox = new CheckboxWidget(this, font, xpos, ypos,
|
||||||
"Multiple snapshots");
|
"Multiple snapshots");
|
||||||
wid.push_back(mySnapSingleCheckbox);
|
wid.push_back(mySnapSingleCheckbox);
|
||||||
|
|
||||||
// Add focus widgets for Snapshot tab
|
// Add focus widgets for Snapshot tab
|
||||||
addToFocusList(wid, tabID);
|
addToFocusList(wid);
|
||||||
|
|
||||||
// Activate the first tab
|
|
||||||
myTab->setActiveTab(0);
|
|
||||||
|
|
||||||
// Add OK & Cancel buttons
|
// Add OK & Cancel buttons
|
||||||
wid.clear();
|
wid.clear();
|
||||||
|
@ -196,10 +156,6 @@ FileSnapDialog::~FileSnapDialog()
|
||||||
void FileSnapDialog::loadConfig()
|
void FileSnapDialog::loadConfig()
|
||||||
{
|
{
|
||||||
myRomPath->setEditString(instance()->settings().getString("romdir"));
|
myRomPath->setEditString(instance()->settings().getString("romdir"));
|
||||||
bool b = instance()->settings().getBool("rombrowse");
|
|
||||||
myBrowseCheckbox->setState(b);
|
|
||||||
myReloadButton->setEnabled(myIsGlobal && !b);
|
|
||||||
|
|
||||||
myStatePath->setEditString(instance()->stateDir());
|
myStatePath->setEditString(instance()->stateDir());
|
||||||
myCheatFile->setEditString(instance()->cheatFile());
|
myCheatFile->setEditString(instance()->cheatFile());
|
||||||
myPaletteFile->setEditString(instance()->paletteFile());
|
myPaletteFile->setEditString(instance()->paletteFile());
|
||||||
|
@ -207,16 +163,12 @@ void FileSnapDialog::loadConfig()
|
||||||
|
|
||||||
mySnapPath->setEditString(instance()->settings().getString("ssdir"));
|
mySnapPath->setEditString(instance()->settings().getString("ssdir"));
|
||||||
mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle"));
|
mySnapSingleCheckbox->setState(!instance()->settings().getBool("sssingle"));
|
||||||
|
|
||||||
myTab->loadConfig();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void FileSnapDialog::saveConfig()
|
void FileSnapDialog::saveConfig()
|
||||||
{
|
{
|
||||||
instance()->settings().setString("romdir", myRomPath->getEditString());
|
instance()->settings().setString("romdir", myRomPath->getEditString());
|
||||||
instance()->settings().setBool("rombrowse", myBrowseCheckbox->getState());
|
|
||||||
|
|
||||||
instance()->settings().setString("statedir", myStatePath->getEditString());
|
instance()->settings().setString("statedir", myStatePath->getEditString());
|
||||||
instance()->settings().setString("cheatfile", myCheatFile->getEditString());
|
instance()->settings().setString("cheatfile", myCheatFile->getEditString());
|
||||||
instance()->settings().setString("palettefile", myPaletteFile->getEditString());
|
instance()->settings().setString("palettefile", myPaletteFile->getEditString());
|
||||||
|
@ -251,10 +203,7 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
saveConfig();
|
saveConfig();
|
||||||
close();
|
close();
|
||||||
if(myIsGlobal)
|
if(myIsGlobal)
|
||||||
{
|
|
||||||
sendCommand(kBrowseChangedCmd, 0, 0); // Call this before refreshing ROMs
|
|
||||||
sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed
|
sendCommand(kRomDirChosenCmd, 0, 0); // Let the boss know romdir has changed
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kChooseRomDirCmd:
|
case kChooseRomDirCmd:
|
||||||
|
@ -329,12 +278,6 @@ void FileSnapDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case kReloadRomDirCmd:
|
|
||||||
{
|
|
||||||
sendCommand(kReloadRomDirCmd, 0, 0);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Dialog::handleCommand(sender, cmd, data, 0);
|
Dialog::handleCommand(sender, cmd, data, 0);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FileSnapDialog.hxx,v 1.5 2007-07-27 13:49:16 stephena Exp $
|
// $Id: FileSnapDialog.hxx,v 1.6 2007-08-07 14:38:51 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -29,7 +29,6 @@ class BrowserDialog;
|
||||||
class CheckboxWidget;
|
class CheckboxWidget;
|
||||||
class PopUpWidget;
|
class PopUpWidget;
|
||||||
class EditTextWidget;
|
class EditTextWidget;
|
||||||
class TabWidget;
|
|
||||||
|
|
||||||
#include "Dialog.hxx"
|
#include "Dialog.hxx"
|
||||||
#include "Command.hxx"
|
#include "Command.hxx"
|
||||||
|
@ -59,24 +58,17 @@ class FileSnapDialog : public Dialog, public CommandSender
|
||||||
kChooseCheatFileCmd = 'LOcf', // cheatfile (stella.cht)
|
kChooseCheatFileCmd = 'LOcf', // cheatfile (stella.cht)
|
||||||
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
|
kChoosePaletteFileCmd = 'LOpf', // palette file (stella.pal)
|
||||||
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
|
kChoosePropsFileCmd = 'LOpr', // properties file (stella.pro)
|
||||||
kChooseSnapDirCmd = 'LOsn', // snap select
|
kChooseSnapDirCmd = 'LOsn', // snapshot dir
|
||||||
kBrowseDirCmd = 'LObd', // browse mode
|
|
||||||
kStateDirChosenCmd = 'LOsc', // state dir changed
|
kStateDirChosenCmd = 'LOsc', // state dir changed
|
||||||
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
|
kCheatFileChosenCmd = 'LOcc', // cheatfile changed
|
||||||
kPaletteFileChosenCmd = 'LOpc', // palette file changed
|
kPaletteFileChosenCmd = 'LOpc', // palette file changed
|
||||||
kPropsFileChosenCmd = 'LOrc' // properties file changed
|
kPropsFileChosenCmd = 'LOrc' // properties file changed
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
BrowserDialog* myBrowser;
|
BrowserDialog* myBrowser;
|
||||||
TabWidget* myTab;
|
|
||||||
|
|
||||||
// Rom path controls
|
|
||||||
EditTextWidget* myRomPath;
|
|
||||||
CheckboxWidget* myBrowseCheckbox;
|
|
||||||
ButtonWidget* myReloadButton;
|
|
||||||
|
|
||||||
// Config paths
|
// Config paths
|
||||||
|
EditTextWidget* myRomPath;
|
||||||
EditTextWidget* myStatePath;
|
EditTextWidget* myStatePath;
|
||||||
EditTextWidget* myCheatFile;
|
EditTextWidget* myCheatFile;
|
||||||
EditTextWidget* myPaletteFile;
|
EditTextWidget* myPaletteFile;
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: OptionsDialog.cxx,v 1.54 2007-07-19 16:21:39 stephena Exp $
|
// $Id: OptionsDialog.cxx,v 1.55 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -78,7 +78,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
b = addBigButton("UI Settings", kUsrIfaceCmd);
|
b = addBigButton("UI Settings", kUsrIfaceCmd);
|
||||||
wid.push_back(b);
|
wid.push_back(b);
|
||||||
|
|
||||||
myFileSnapButton = addBigButton("Files & Snapshots", kFileSnapCmd);
|
myFileSnapButton = addBigButton("Config Files", kFileSnapCmd);
|
||||||
wid.push_back(myFileSnapButton);
|
wid.push_back(myFileSnapButton);
|
||||||
|
|
||||||
// Move to second column
|
// Move to second column
|
||||||
|
@ -127,7 +127,7 @@ OptionsDialog::OptionsDialog(OSystem* osystem, DialogContainer* parent,
|
||||||
w = 200; h = 105;
|
w = 200; h = 105;
|
||||||
myUIDialog = new UIDialog(myOSystem, parent, font, x, y, w, h);
|
myUIDialog = new UIDialog(myOSystem, parent, font, x, y, w, h);
|
||||||
|
|
||||||
w = 280; h = 180;
|
w = 280; h = 170;
|
||||||
myFileSnapDialog = new FileSnapDialog(myOSystem, parent, font,
|
myFileSnapDialog = new FileSnapDialog(myOSystem, parent, font,
|
||||||
boss, x, y, w, h);
|
boss, x, y, w, h);
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: PopUpWidget.cxx,v 1.35 2007-08-06 21:32:10 stephena Exp $
|
// $Id: PopUpWidget.cxx,v 1.36 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -86,7 +86,7 @@ void PopUpDialog::drawDialog()
|
||||||
// The last entry may be empty. Fill it with black.
|
// The last entry may be empty. Fill it with black.
|
||||||
if(_twoColumns && (count & 1))
|
if(_twoColumns && (count & 1))
|
||||||
fb.fillRect(_x + 1 + _w / 2, _y + 1 + _popUpBoss->_fontHeight * (_entriesPerColumn - 1),
|
fb.fillRect(_x + 1 + _w / 2, _y + 1 + _popUpBoss->_fontHeight * (_entriesPerColumn - 1),
|
||||||
_w / 2 - 1, _popUpBoss->_fontHeight, _popUpBoss->_bgcolor);
|
_w / 2 - 1, _popUpBoss->_fontHeight, kListColor);
|
||||||
|
|
||||||
_dirty = false;
|
_dirty = false;
|
||||||
fb.addDirtyRect(_x, _y, _w, _h);
|
fb.addDirtyRect(_x, _y, _w, _h);
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: ScrollBarWidget.cxx,v 1.16 2007-01-01 18:04:54 stephena Exp $
|
// $Id: ScrollBarWidget.cxx,v 1.17 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -69,6 +69,8 @@ ScrollBarWidget::ScrollBarWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
{
|
{
|
||||||
_flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG;
|
_flags = WIDGET_ENABLED | WIDGET_TRACK_MOUSE | WIDGET_CLEARBG;
|
||||||
_type = kScrollBarWidget;
|
_type = kScrollBarWidget;
|
||||||
|
_bgcolor = kListColor;
|
||||||
|
_bgcolorhi = kListColor;
|
||||||
|
|
||||||
_part = kNoPart;
|
_part = kNoPart;
|
||||||
_sliderHeight = 0;
|
_sliderHeight = 0;
|
||||||
|
@ -262,24 +264,23 @@ void ScrollBarWidget::drawWidget(bool hilite)
|
||||||
fb.frameRect(_x, _y, _w, UP_DOWN_BOX_HEIGHT, kColor);
|
fb.frameRect(_x, _y, _w, UP_DOWN_BOX_HEIGHT, kColor);
|
||||||
fb.drawBitmap(up_arrow, _x, _y,
|
fb.drawBitmap(up_arrow, _x, _y,
|
||||||
isSinglePage ? kColor :
|
isSinglePage ? kColor :
|
||||||
(hilite && _part == kUpArrowPart) ? kTextColorHi : kTextColor);
|
(hilite && _part == kUpArrowPart) ? kBtnColorHi : kBtnColor);
|
||||||
|
|
||||||
// Down arrow
|
// Down arrow
|
||||||
fb.frameRect(_x, bottomY - UP_DOWN_BOX_HEIGHT, _w, UP_DOWN_BOX_HEIGHT, kColor);
|
fb.frameRect(_x, bottomY - UP_DOWN_BOX_HEIGHT, _w, UP_DOWN_BOX_HEIGHT, kColor);
|
||||||
fb.drawBitmap(down_arrow, _x, bottomY - UP_DOWN_BOX_HEIGHT,
|
fb.drawBitmap(down_arrow, _x, bottomY - UP_DOWN_BOX_HEIGHT,
|
||||||
isSinglePage ? kColor :
|
isSinglePage ? kColor :
|
||||||
(hilite && _part == kDownArrowPart) ? kTextColorHi : kTextColor);
|
(hilite && _part == kDownArrowPart) ? kBtnColorHi : kBtnColor);
|
||||||
|
|
||||||
// Slider
|
// Slider
|
||||||
if(!isSinglePage)
|
if(!isSinglePage)
|
||||||
{
|
{
|
||||||
fb.fillRect(_x, _y + _sliderPos, _w, _sliderHeight,
|
fb.fillRect(_x, _y + _sliderPos, _w, _sliderHeight,
|
||||||
(hilite && _part == kSliderPart) ? kTextColorHi : kTextColor);
|
(hilite && _part == kSliderPart) ? kBtnColorHi : kBtnColor);
|
||||||
fb.frameRect(_x, _y + _sliderPos, _w, _sliderHeight, kColor);
|
fb.frameRect(_x, _y + _sliderPos, _w, _sliderHeight, kColor);
|
||||||
int y = _y + _sliderPos + _sliderHeight / 2;
|
int y = _y + _sliderPos + _sliderHeight / 2;
|
||||||
int color = (hilite && _part == kSliderPart) ? kColor : kShadowColor;
|
fb.hLine(_x + 2, y - 2, _x + _w - 3, kBtnFntColorHi);
|
||||||
fb.hLine(_x + 2, y - 2, _x + _w - 3, color);
|
fb.hLine(_x + 2, y, _x + _w - 3, kBtnFntColorHi);
|
||||||
fb.hLine(_x + 2, y, _x + _w - 3, color);
|
fb.hLine(_x + 2, y + 2, _x + _w - 3, kBtnFntColorHi);
|
||||||
fb.hLine(_x + 2, y + 2, _x + _w - 3, color);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: Widget.cxx,v 1.51 2007-08-06 20:16:51 stephena Exp $
|
// $Id: Widget.cxx,v 1.52 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -82,10 +82,20 @@ void Widget::draw()
|
||||||
_x = getAbsX();
|
_x = getAbsX();
|
||||||
_y = getAbsY();
|
_y = getAbsY();
|
||||||
|
|
||||||
|
|
||||||
|
// fb.fillRect(_x+1, _y+1, _w-2, _h-2,
|
||||||
|
|
||||||
|
|
||||||
// Clear background (unless alpha blending is enabled)
|
// Clear background (unless alpha blending is enabled)
|
||||||
if(_flags & WIDGET_CLEARBG)
|
if(_flags & WIDGET_CLEARBG)
|
||||||
fb.fillRect(_x, _y, _w, _h,
|
{
|
||||||
(_flags & WIDGET_HILITED) ? _bgcolorhi : _bgcolor);
|
int x = _x, y = _y, w = _w, h = _h;
|
||||||
|
if(_flags & WIDGET_BORDER)
|
||||||
|
{
|
||||||
|
x++; y++; w-=2; h-=2;
|
||||||
|
}
|
||||||
|
fb.fillRect(x, y, w, h, (_flags & WIDGET_HILITED) ? _bgcolorhi : _bgcolor);
|
||||||
|
}
|
||||||
|
|
||||||
// Draw border
|
// Draw border
|
||||||
if(_flags & WIDGET_BORDER) {
|
if(_flags & WIDGET_BORDER) {
|
||||||
|
@ -644,6 +654,10 @@ void SliderWidget::drawWidget(bool hilite)
|
||||||
// Draw the box
|
// Draw the box
|
||||||
fb.box(_x + _labelWidth, _y, _w - _labelWidth, _h, kColor, kShadowColor);
|
fb.box(_x + _labelWidth, _y, _w - _labelWidth, _h, kColor, kShadowColor);
|
||||||
|
|
||||||
|
// Fill the box
|
||||||
|
fb.fillRect(_x + _labelWidth + 2, _y + 2, _w - _labelWidth - 4, _h - 4,
|
||||||
|
!isEnabled() ? kColor : kListColor);
|
||||||
|
|
||||||
// Draw the 'bar'
|
// Draw the 'bar'
|
||||||
fb.fillRect(_x + _labelWidth + 2, _y + 2, valueToPos(_value), _h - 4,
|
fb.fillRect(_x + _labelWidth + 2, _y + 2, valueToPos(_value), _h - 4,
|
||||||
!isEnabled() ? kColor :
|
!isEnabled() ? kColor :
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FSNodePOSIX.cxx,v 1.10 2007-01-01 18:04:55 stephena Exp $
|
// $Id: FSNodePOSIX.cxx,v 1.11 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -231,16 +231,3 @@ bool AbstractFilesystemNode::makeDir(const string& path)
|
||||||
{
|
{
|
||||||
return mkdir(path.c_str(), 0777) == 0;
|
return mkdir(path.c_str(), 0777) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
string AbstractFilesystemNode::modTime(const string& path)
|
|
||||||
{
|
|
||||||
struct stat st;
|
|
||||||
if(stat(path.c_str(), &st) != 0)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
ostringstream buf;
|
|
||||||
buf << st.st_mtime;
|
|
||||||
|
|
||||||
return buf.str();
|
|
||||||
}
|
|
||||||
|
|
|
@ -13,7 +13,7 @@
|
||||||
// See the file "license" for information on usage and redistribution of
|
// See the file "license" for information on usage and redistribution of
|
||||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||||
//
|
//
|
||||||
// $Id: FSNodeWin32.cxx,v 1.10 2007-08-04 20:32:54 stephena Exp $
|
// $Id: FSNodeWin32.cxx,v 1.11 2007-08-07 14:38:52 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -280,18 +280,3 @@ bool AbstractFilesystemNode::makeDir(const string& path)
|
||||||
{
|
{
|
||||||
return CreateDirectory(path.c_str(), NULL) != 0;
|
return CreateDirectory(path.c_str(), NULL) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
||||||
string AbstractFilesystemNode::modTime(const string& path)
|
|
||||||
{
|
|
||||||
WIN32_FILE_ATTRIBUTE_DATA attr;
|
|
||||||
BOOL b = GetFileAttributesEx(path.c_str(), GetFileExInfoStandard, &attr);
|
|
||||||
|
|
||||||
if(b == 0)
|
|
||||||
return "";
|
|
||||||
|
|
||||||
ostringstream buf;
|
|
||||||
buf << attr.ftLastWriteTime.dwHighDateTime << attr.ftLastWriteTime.dwLowDateTime;
|
|
||||||
|
|
||||||
return buf.str();
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue