From 481bbd254103fc9d6dc98b19a5226f8868c8c5d9 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 27 Feb 2012 02:44:23 +0300 Subject: Add sliderlist setup item. --- src/gui/widgets/namesmodel.cpp | 51 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/gui/widgets/namesmodel.cpp (limited to 'src/gui/widgets/namesmodel.cpp') diff --git a/src/gui/widgets/namesmodel.cpp b/src/gui/widgets/namesmodel.cpp new file mode 100644 index 000000000..abfcd6def --- /dev/null +++ b/src/gui/widgets/namesmodel.cpp @@ -0,0 +1,51 @@ +/* + * The ManaPlus Client + * Copyright (C) 2012 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * 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 + * 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, see . + */ + +#include "gui/widgets/namesmodel.h" + +#include "logger.h" + +#include "utils/gettext.h" + +#include +#include + +#include "debug.h" + +NamesModel::NamesModel() +{ +} + +NamesModel::~NamesModel() +{ +} + +int NamesModel::getNumberOfElements() +{ + return static_cast(mNames.size()); +} + +std::string NamesModel::getElementAt(int i) +{ + if (i >= getNumberOfElements() || i < 0) + return _("???"); + + return mNames[i]; +} -- cgit v1.2.3-60-g2f50