2007-05-30 21:56:52 +00:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* ScummVM is the legal property of its developers, whose names
|
|
|
|
* are too numerous to list here. Please refer to the COPYRIGHT
|
|
|
|
* file distributed with this source distribution.
|
2007-02-18 18:23:52 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2014-02-18 01:34:20 +00:00
|
|
|
*
|
2007-02-18 18:23:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef MASSADD_DIALOG_H
|
|
|
|
#define MASSADD_DIALOG_H
|
|
|
|
|
|
|
|
#include "gui/dialog.h"
|
|
|
|
#include "common/fs.h"
|
2008-06-11 06:22:02 +00:00
|
|
|
#include "common/hashmap.h"
|
2007-02-18 18:23:52 +00:00
|
|
|
#include "common/stack.h"
|
2008-06-11 06:22:02 +00:00
|
|
|
#include "common/str.h"
|
2007-02-18 18:23:52 +00:00
|
|
|
|
|
|
|
namespace GUI {
|
|
|
|
|
|
|
|
class StaticTextWidget;
|
|
|
|
|
|
|
|
class MassAddDialog : public Dialog {
|
2010-03-18 15:09:24 +00:00
|
|
|
typedef Common::Array<Common::String> StringArray;
|
2007-02-18 18:23:52 +00:00
|
|
|
public:
|
2008-10-02 16:58:59 +00:00
|
|
|
MassAddDialog(const Common::FSNode &startDir);
|
2007-02-18 18:23:52 +00:00
|
|
|
|
|
|
|
//void open();
|
|
|
|
void handleCommand(CommandSender *sender, uint32 cmd, uint32 data);
|
|
|
|
void handleTickle();
|
|
|
|
|
2009-12-15 12:56:10 +00:00
|
|
|
Common::String getFirstAddedTarget() const {
|
2009-12-15 08:19:34 +00:00
|
|
|
if (!_games.empty())
|
|
|
|
return _games.front().gameid();
|
|
|
|
return Common::String();
|
|
|
|
}
|
|
|
|
|
2007-02-18 18:23:52 +00:00
|
|
|
private:
|
2008-10-02 16:58:59 +00:00
|
|
|
Common::Stack<Common::FSNode> _scanStack;
|
2007-02-18 18:23:52 +00:00
|
|
|
GameList _games;
|
2008-01-27 19:47:41 +00:00
|
|
|
|
2008-06-11 06:22:02 +00:00
|
|
|
/**
|
|
|
|
* Map each path occuring in the config file to the target(s) using that path.
|
|
|
|
* Used to detect whether a potential new target is already present in the
|
|
|
|
* config manager.
|
|
|
|
*/
|
2010-03-18 15:09:24 +00:00
|
|
|
Common::HashMap<Common::String, StringArray> _pathToTargets;
|
2008-06-11 06:22:02 +00:00
|
|
|
|
2007-02-18 18:23:52 +00:00
|
|
|
int _dirsScanned;
|
2011-05-02 11:39:34 +00:00
|
|
|
int _oldGamesCount;
|
2011-03-31 10:35:43 +00:00
|
|
|
int _dirTotal;
|
2007-02-18 18:23:52 +00:00
|
|
|
|
|
|
|
Widget *_okButton;
|
|
|
|
StaticTextWidget *_dirProgressText;
|
|
|
|
StaticTextWidget *_gameProgressText;
|
2009-06-06 17:49:59 +00:00
|
|
|
|
|
|
|
ListWidget *_list;
|
2007-02-18 18:23:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // End of namespace GUI
|
|
|
|
|
|
|
|
#endif
|