2010-02-04 12:33:47 +01:00
|
|
|
/***************************************************************************
|
2011-10-23 16:13:02 +02:00
|
|
|
* Copyright (C) 2006 by Massimiliano Torromeo *
|
|
|
|
* massimiliano.torromeo@gmail.com *
|
2010-02-04 12:33:47 +01: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., *
|
|
|
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
|
|
|
***************************************************************************/
|
2011-10-23 16:13:02 +02:00
|
|
|
|
2010-02-04 12:33:47 +01:00
|
|
|
#include "menusettingdir.h"
|
2011-10-23 16:13:02 +02:00
|
|
|
|
2013-07-29 12:58:25 -04:00
|
|
|
#include "delegate.h"
|
2010-02-04 12:33:47 +01:00
|
|
|
#include "dirdialog.h"
|
2011-10-23 16:13:02 +02:00
|
|
|
#include "gmenu2x.h"
|
|
|
|
#include "iconbutton.h"
|
2010-02-04 12:33:47 +01:00
|
|
|
|
2010-07-28 02:36:46 +02:00
|
|
|
using std::string;
|
2014-08-15 21:52:48 +00:00
|
|
|
using std::unique_ptr;
|
2010-02-04 12:33:47 +01:00
|
|
|
|
2010-07-28 01:46:32 +02:00
|
|
|
MenuSettingDir::MenuSettingDir(
|
2011-12-23 14:03:05 +01:00
|
|
|
GMenu2X *gmenu2x, Touchscreen &ts_,
|
|
|
|
const string &name, const string &description, string *value)
|
2010-07-28 01:46:32 +02:00
|
|
|
: MenuSettingStringBase(gmenu2x, name, description, value)
|
2011-12-23 14:03:05 +01:00
|
|
|
, ts(ts_)
|
2010-07-28 01:46:32 +02:00
|
|
|
{
|
2014-08-16 06:35:27 +02:00
|
|
|
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
|
|
|
gmenu2x, ts, "skin:imgs/buttons/cancel.png",
|
|
|
|
gmenu2x->tr["Clear"],
|
|
|
|
BIND(&MenuSettingDir::clear))));
|
2010-05-03 22:21:36 +02:00
|
|
|
|
2014-08-16 06:35:27 +02:00
|
|
|
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
|
|
|
gmenu2x, ts, "skin:imgs/buttons/accept.png",
|
|
|
|
gmenu2x->tr["Select"],
|
|
|
|
BIND(&MenuSettingDir::edit))));
|
2010-02-04 12:33:47 +01:00
|
|
|
}
|
|
|
|
|
2010-07-28 01:46:32 +02:00
|
|
|
void MenuSettingDir::edit()
|
2010-05-03 22:21:36 +02:00
|
|
|
{
|
2011-12-23 14:03:05 +01:00
|
|
|
DirDialog dd(gmenu2x, ts, description, value());
|
2011-10-23 16:13:02 +02:00
|
|
|
if (dd.exec()) setValue(dd.getPath());
|
2010-02-04 12:33:47 +01:00
|
|
|
}
|