TuiNodeBool.cpp   TuiNodeBool.cpp 
skipping to change at line 16 skipping to change at line 16
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
*/ */
#include "StelTranslator.hpp"
#include "TuiNodeBool.hpp" #include "TuiNodeBool.hpp"
#include <QKeyEvent> #include <QKeyEvent>
TuiNodeBool::TuiNodeBool(const QString& text, QObject* receiver, const char * method, bool defValue, TuiNode* parent, TuiNode* prev) TuiNodeBool::TuiNodeBool(const QString& text, QObject* receiver, const char * method, bool defValue, TuiNode* parent, TuiNode* prev)
: TuiNodeEditable(text, parent, prev), state(defValue) : TuiNodeEditable(text, parent, prev), state(defValue)
{ {
this->connect(this, SIGNAL(setValue(bool)), receiver, method); this->connect(this, SIGNAL(setValue(bool)), receiver, method);
} }
TuiNodeResponse TuiNodeBool::handleEditingKey(int key) TuiNodeResponse TuiNodeBool::handleEditingKey(int key)
skipping to change at line 72 skipping to change at line 73
response.accepted = true; response.accepted = true;
response.newNode = this; response.newNode = this;
emit(setValue(state)); emit(setValue(state));
return response; return response;
} }
return response; return response;
} }
QString TuiNodeBool::getDisplayText() QString TuiNodeBool::getDisplayText()
{ {
// TODO: The label/value separation needs to be reworked. This way o
f using
// the colon is not i18n-friendly. --BM
QString stringOn = q_("On");
QString stringOff = q_("Off");
QString value;
if (!editing) if (!editing)
{ {
if (state) if (state)
return displayText + ": On"; value = QString(": %1").arg(stringOn);
else else
return displayText + ": Off"; value = QString(": %1").arg(stringOff);
} }
else else
{ {
if (state) if (state)
return displayText + ": >On<"; value = QString(": >%1<").arg(stringOn);
else else
return displayText + ": >Off<"; value = QString(": >%1<").arg(stringOff);
} }
return prefixText + q_(displayText) + value;
} }
 End of changes. 8 change blocks. 
5 lines changed or deleted 13 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/