TuiNodeEnum.cpp   TuiNodeEnum.cpp 
skipping to change at line 25 skipping to change at line 25
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelTranslator.hpp" #include "StelTranslator.hpp"
#include "TuiNodeEnum.hpp" #include "TuiNodeEnum.hpp"
#include <QKeyEvent> #include <QKeyEvent>
TuiNodeEnum::TuiNodeEnum(const QString& text, QObject* receiver, const char * method, QStringList items, TuiNodeEnum::TuiNodeEnum(const QString& text, QObject* receiver, const char * method, QStringList items,
QString defValue, TuiNode* parent, TuiNode* prev) QString defValue, TuiNode* parent, TuiNode* prev)
: TuiNodeEditable(text, parent, prev), stringList(items) : TuiNodeEditable(text, parent, prev), stringList(items), defValue(defV alue)
{ {
this->connect(this, SIGNAL(setValue(QString)), receiver, method); this->connect(this, SIGNAL(setValue(QString)), receiver, method);
if (stringList.contains(defValue)) if (stringList.contains(defValue))
currentIdx = stringList.indexOf(defValue); currentIdx = stringList.indexOf(defValue);
else else
currentIdx = 0; currentIdx = 0;
} }
TuiNodeResponse TuiNodeEnum::handleEditingKey(int key) TuiNodeResponse TuiNodeEnum::handleEditingKey(int key)
skipping to change at line 71 skipping to change at line 71
{ {
emit(setValue(stringList.at(currentIdx))); emit(setValue(stringList.at(currentIdx)));
response.accepted = true; response.accepted = true;
response.newNode = this; response.newNode = this;
} }
return response; return response;
} }
QString TuiNodeEnum::getDisplayText() QString TuiNodeEnum::getDisplayText()
{ {
QString value = q_(stringList.at(currentIdx)); if (!stringList.isEmpty())
if (!editing) {
{ QString value = q_(stringList.at(currentIdx));
return prefixText + q_(displayText) + QString(": %1").arg(v if (!editing)
alue); {
} return prefixText + q_(displayText) + QString(": %1").arg(valu
else e);
{ }
return prefixText + q_(displayText) + QString(": >%1<").arg( else
value); {
} return prefixText + q_(displayText) + QString(": >%1<").arg(val
ue);
}
}
else
{
return prefixText + q_(displayText) + QString(": %1").arg(defValue
);
}
} }
 End of changes. 2 change blocks. 
12 lines changed or deleted 20 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/