mirror of https://github.com/stella-emu/stella.git
Fixes to RomAuditDialog for recent surface changes. Also, if a ROM
already has the correct name, we no longer rename it anyway (renaming a correctly-named ROM was updating a counter that should only show ROMs that *really* had to be renamed). First pass at integrating RomHunters V4 romset database into internal properties. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1586 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
8ba2482f50
commit
051969e56a
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: LauncherDialog.cxx,v 1.91 2008-12-30 02:34:49 stephena Exp $
|
||||
// $Id: LauncherDialog.cxx,v 1.92 2008-12-31 01:33:03 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -51,7 +51,6 @@ LauncherDialog::LauncherDialog(OSystem* osystem, DialogContainer* parent,
|
|||
myQuitButton(NULL),
|
||||
myList(NULL),
|
||||
myGameList(NULL),
|
||||
myProgressBar(NULL),
|
||||
myRomInfoWidget(NULL),
|
||||
mySelectedItem(0)
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: LauncherDialog.hxx,v 1.36 2008-12-29 20:42:15 stephena Exp $
|
||||
// $Id: LauncherDialog.hxx,v 1.37 2008-12-31 01:33:03 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -30,7 +30,6 @@ class DialogContainer;
|
|||
class GameList;
|
||||
class OptionsDialog;
|
||||
class OSystem;
|
||||
class ProgressDialog;
|
||||
class Properties;
|
||||
class RomInfoWidget;
|
||||
class StaticTextWidget;
|
||||
|
@ -81,8 +80,6 @@ class LauncherDialog : public Dialog
|
|||
GameList* myGameList;
|
||||
|
||||
OptionsDialog* myOptions;
|
||||
ProgressDialog* myProgressBar;
|
||||
|
||||
RomInfoWidget* myRomInfoWidget;
|
||||
|
||||
private:
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: ProgressDialog.cxx,v 1.13 2008-06-13 13:14:51 stephena Exp $
|
||||
// $Id: ProgressDialog.cxx,v 1.14 2008-12-31 01:33:03 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -46,8 +46,6 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
|||
lwidth = font.getStringWidth(message);
|
||||
_w = lwidth + 2 * fontWidth;
|
||||
_h = lineHeight * 5;
|
||||
_x = (boss->getWidth() - _w) / 2;
|
||||
_y = (boss->getHeight() - _h) / 2;
|
||||
|
||||
xpos = fontWidth; ypos = lineHeight;
|
||||
myMessage = new StaticTextWidget(this, font, xpos, ypos, lwidth, fontHeight,
|
||||
|
@ -60,7 +58,6 @@ ProgressDialog::ProgressDialog(GuiObject* boss, const GUI::Font& font,
|
|||
mySlider->setMaxValue(100);
|
||||
|
||||
parent().addDialog(this);
|
||||
instance().frameBuffer().update();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
@ -68,12 +65,6 @@ ProgressDialog::~ProgressDialog()
|
|||
{
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ProgressDialog::done()
|
||||
{
|
||||
parent().removeDialog();
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
void ProgressDialog::setMessage(const string& message)
|
||||
{
|
||||
|
@ -98,6 +89,12 @@ void ProgressDialog::setProgress(int progress)
|
|||
if(progress - mySlider->getValue() > myStep)
|
||||
{
|
||||
mySlider->setValue(progress);
|
||||
|
||||
// Since this dialog is usually called in a tight loop that doesn't
|
||||
// yield, we need to manually tell the framebuffer that a redraw is
|
||||
// necessary
|
||||
// This isn't really an ideal solution, since all redrawing and
|
||||
// event handling is suspended until the dialog is closed
|
||||
instance().frameBuffer().update();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: ProgressDialog.hxx,v 1.5 2008-02-06 13:45:24 stephena Exp $
|
||||
// $Id: ProgressDialog.hxx,v 1.6 2008-12-31 01:33:03 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -38,7 +38,6 @@ class ProgressDialog : public Dialog
|
|||
void setMessage(const string& message);
|
||||
void setRange(int begin, int end, int step);
|
||||
void setProgress(int progress);
|
||||
void done();
|
||||
|
||||
protected:
|
||||
StaticTextWidget* myMessage;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// See the file "license" for information on usage and redistribution of
|
||||
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
//
|
||||
// $Id: RomAuditDialog.cxx,v 1.6 2008-12-25 23:05:16 stephena Exp $
|
||||
// $Id: RomAuditDialog.cxx,v 1.7 2008-12-31 01:33:03 stephena Exp $
|
||||
//
|
||||
// Based on code from ScummVM - Scumm Interpreter
|
||||
// Copyright (C) 2002-2004 The ScummVM project
|
||||
|
@ -113,7 +113,7 @@ void RomAuditDialog::auditRoms()
|
|||
|
||||
// Create a progress dialog box to show the progress of processing
|
||||
// the ROMs, since this is usually a time-consuming operation
|
||||
ProgressDialog progress(this, instance().launcherFont(),
|
||||
ProgressDialog progress(this, instance().font(),
|
||||
"Auditing ROM files ...");
|
||||
progress.setRange(0, files.size() - 1, 5);
|
||||
|
||||
|
@ -135,10 +135,15 @@ void RomAuditDialog::auditRoms()
|
|||
// Only rename the file if we found a valid properties entry
|
||||
if(name != "" && name != files[idx].displayName())
|
||||
{
|
||||
const string& newfile =
|
||||
auditPath + BSPF_PATH_SEPARATOR + name + "." + extension;
|
||||
if(FilesystemNode::renameFile(files[idx].path(), newfile))
|
||||
renamed++;
|
||||
// Check for terminating separator
|
||||
string newfile = auditPath;
|
||||
if(newfile.find_last_of(BSPF_PATH_SEPARATOR) != newfile.length()-1)
|
||||
newfile += BSPF_PATH_SEPARATOR;
|
||||
newfile += name + "." + extension;
|
||||
|
||||
if(files[idx].path() != newfile)
|
||||
if(FilesystemNode::renameFile(files[idx].path(), newfile))
|
||||
renamed++;
|
||||
}
|
||||
else
|
||||
notfound++;
|
||||
|
@ -147,7 +152,7 @@ void RomAuditDialog::auditRoms()
|
|||
// Update the progress bar, indicating one more ROM has been processed
|
||||
progress.setProgress(idx);
|
||||
}
|
||||
progress.done();
|
||||
progress.close();
|
||||
|
||||
myResults1->setValue(renamed);
|
||||
myResults2->setValue(notfound);
|
||||
|
|
Loading…
Reference in New Issue