The beginning of the 'Great Properties Update'. The stella.pro entries

have been out of date for years, as is the GoodTools package that
originally created them.  Thanks to Rom Hunter of AtariAge, I now have
a much more up to date database to work with.

Viewing ROM properties from the ROM launcher is currently borked.  I know
what the problem is (I caused it), and it will be fixed once the database
is converted.

Added very rudimentary copy and paste support between EditTextWidgets.
Currently, it can only copy internally, within Stella.  This will be
expanded on to actually support the OS clipboard before the next release.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1367 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2007-09-06 21:00:58 +00:00
parent f60fe600c9
commit deb60882a5
9 changed files with 1729 additions and 1200 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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.24 2007-08-12 23:05:12 stephena Exp $ // $Id: EditableWidget.cxx,v 1.25 2007-09-06 21:00:57 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
@ -254,6 +254,10 @@ bool EditableWidget::specialKeys(int keycode)
setCaretPos(0); setCaretPos(0);
break; break;
case 'c':
copySelectedText();
break;
case 'e': case 'e':
setCaretPos(_editString.size()); setCaretPos(_editString.size());
break; break;
@ -270,6 +274,10 @@ bool EditableWidget::specialKeys(int keycode)
handled = killLine(-1); handled = killLine(-1);
break; break;
case 'v':
pasteSelectedText();
break;
case 'w': case 'w':
handled = killLastWord(); handled = killLastWord();
break; break;
@ -365,3 +373,18 @@ bool EditableWidget::killLastWord()
return handled; return handled;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::copySelectedText()
{
_clippedText = _editString;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EditableWidget::pasteSelectedText()
{
_editString = _clippedText;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string EditableWidget::_clippedText = "";

View File

@ -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.hxx,v 1.12 2007-01-01 18:04:52 stephena Exp $ // $Id: EditableWidget.hxx,v 1.13 2007-09-06 21:00:57 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
@ -73,6 +73,10 @@ class EditableWidget : public Widget, public CommandSender
bool killLine(int direction); bool killLine(int direction);
bool killLastWord(); bool killLastWord();
// Clipboard
void copySelectedText();
void pasteSelectedText();
protected: protected:
bool _editable; bool _editable;
string _editString; string _editString;
@ -84,6 +88,8 @@ class EditableWidget : public Widget, public CommandSender
bool _caretInverse; bool _caretInverse;
int _editScrollOffset; int _editScrollOffset;
static string _clippedText;
}; };
#endif #endif

View File

@ -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: GameInfoDialog.cxx,v 1.41 2007-09-06 02:15:00 stephena Exp $ // $Id: GameInfoDialog.cxx,v 1.42 2007-09-06 21:00:57 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
@ -333,11 +333,15 @@ void GameInfoDialog::loadConfig()
} }
else if(&myOSystem->launcher()) else if(&myOSystem->launcher())
{ {
const string& md5 = myOSystem->launcher().romMD5(); string file;
const string& md5 = myOSystem->launcher().romMD5(file);
if(md5 != "") if(md5 != "")
{ {
instance()->propSet().getMD5(md5, myGameProperties); instance()->propSet().getMD5(md5, myGameProperties);
myPropertiesLoaded = true; myPropertiesLoaded = true;
myGameProperties.set(Cartridge_Name, file);
myGameProperties.set(Cartridge_ModelNo, file);
myGameProperties.set(Cartridge_Manufacturer, file);
loadView(); loadView();
} }
} }

View File

@ -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: Launcher.cxx,v 1.19 2007-09-06 02:15:00 stephena Exp $ // $Id: Launcher.cxx,v 1.20 2007-09-06 21:00:57 stephena Exp $
//============================================================================ //============================================================================
#include <sstream> #include <sstream>
@ -62,7 +62,7 @@ void Launcher::initializeVideo()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string Launcher::romMD5() string Launcher::romMD5(string& file)
{ {
return ((LauncherDialog*)myBaseDialog)->selectedRomMD5(); return ((LauncherDialog*)myBaseDialog)->selectedRomMD5(file);
} }

View File

@ -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: Launcher.hxx,v 1.12 2007-09-06 02:15:00 stephena Exp $ // $Id: Launcher.hxx,v 1.13 2007-09-06 21:00:58 stephena Exp $
//============================================================================ //============================================================================
#ifndef LAUNCHER_HXX #ifndef LAUNCHER_HXX
@ -28,7 +28,7 @@ class OSystem;
The base dialog for the ROM launcher in Stella. The base dialog for the ROM launcher in Stella.
@author Stephen Anthony @author Stephen Anthony
@version $Id: Launcher.hxx,v 1.12 2007-09-06 02:15:00 stephena Exp $ @version $Id: Launcher.hxx,v 1.13 2007-09-06 21:00:58 stephena Exp $
*/ */
class Launcher : public DialogContainer class Launcher : public DialogContainer
{ {
@ -51,7 +51,7 @@ class Launcher : public DialogContainer
/** /**
Get game properties for the currently selected ROM. Get game properties for the currently selected ROM.
*/ */
string romMD5(); string romMD5(string& file);
private: private:
// The width and height of this dialog // The width and height of this dialog

View File

@ -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: LauncherDialog.cxx,v 1.72 2007-09-06 02:15:00 stephena Exp $ // $Id: LauncherDialog.cxx,v 1.73 2007-09-06 21:00:58 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
@ -173,12 +173,15 @@ LauncherDialog::~LauncherDialog()
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
string LauncherDialog::selectedRomMD5() string LauncherDialog::selectedRomMD5(string& file)
{ {
int item = myList->getSelected(); int item = myList->getSelected();
if(item < 0 || myGameList->isDir(item)) if(item < 0 || myGameList->isDir(item))
return ""; return "";
FilesystemNode node(myGameList->path(item));
file = node.displayName();
// Make sure we have a valid md5 for this ROM // Make sure we have a valid md5 for this ROM
if(myGameList->md5(item) == "") if(myGameList->md5(item) == "")
{ {
@ -446,6 +449,8 @@ void LauncherDialog::loadRomInfo()
if(myRomInfoFlag) if(myRomInfoFlag)
myRomInfoWidget->showInfo(props); myRomInfoWidget->showInfo(props);
cerr << "\n ==> " << myGameList->path(item) << endl;
} }
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

View File

@ -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: LauncherDialog.hxx,v 1.29 2007-09-06 02:15:00 stephena Exp $ // $Id: LauncherDialog.hxx,v 1.30 2007-09-06 21:00:58 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
@ -55,7 +55,7 @@ class LauncherDialog : public Dialog
int x, int y, int w, int h); int x, int y, int w, int h);
~LauncherDialog(); ~LauncherDialog();
string selectedRomMD5(); string selectedRomMD5(string& file);
protected: protected:
virtual void handleCommand(CommandSender* sender, int cmd, int data, int id); virtual void handleCommand(CommandSender* sender, int cmd, int data, int id);