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
|
|
|
|
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
|
|
|
|
2014-08-16 07:07:41 +02:00
|
|
|
using std::bind;
|
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(
|
2014-10-05 06:46:48 +00:00
|
|
|
GMenu2X& gmenu2x,
|
2011-12-23 14:03:05 +01:00
|
|
|
const string &name, const string &description, string *value)
|
2010-07-28 01:46:32 +02:00
|
|
|
: MenuSettingStringBase(gmenu2x, name, description, value)
|
|
|
|
{
|
2014-08-16 06:35:27 +02:00
|
|
|
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
2014-10-05 06:46:48 +00:00
|
|
|
gmenu2x, "skin:imgs/buttons/cancel.png",
|
2015-04-21 20:32:33 +02:00
|
|
|
gmenu2x.tr["Clear"],
|
2014-08-16 07:07:41 +02:00
|
|
|
bind(&MenuSettingDir::clear, this))));
|
2010-05-03 22:21:36 +02:00
|
|
|
|
2014-08-16 06:35:27 +02:00
|
|
|
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
2014-10-05 06:46:48 +00:00
|
|
|
gmenu2x, "skin:imgs/buttons/accept.png",
|
2015-04-21 20:32:33 +02:00
|
|
|
gmenu2x.tr["Select"],
|
2014-08-16 07:07:41 +02:00
|
|
|
bind(&MenuSettingDir::edit, this))));
|
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
|
|
|
{
|
2014-10-05 06:46:48 +00:00
|
|
|
DirDialog dd(gmenu2x, description, value());
|
2011-10-23 16:13:02 +02:00
|
|
|
if (dd.exec()) setValue(dd.getPath());
|
2010-02-04 12:33:47 +01:00
|
|
|
}
|