From ceff6ec5254bbee898ac6a193624dba5ccf18e56 Mon Sep 17 00:00:00 2001 From: Nicolas Despres Date: Fri, 7 Jan 2011 14:57:46 +0100 Subject: [PATCH] ccmake: Factor toggle key help instructions. --- Source/CursesDialog/cmCursesMainForm.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 735854df7..6c7627f92 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -427,15 +427,13 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */) { sprintf(firstLine, "Press [c] to configure "); } - if (this->AdvancedMode) - { - sprintf(thirdLine, "Press [t] to toggle advanced mode (Currently On)"); - } - else - { - sprintf(thirdLine, "Press [t] to toggle advanced mode (Currently Off)"); - } - + { + const char* toggleKeyInstruction = + "Press [t] to toggle advanced mode (Currently %s)"; + sprintf(thirdLine, + toggleKeyInstruction, + this->AdvancedMode ? "On" : "Off"); + } sprintf(secondLine, "Press [h] for help " "Press [q] to quit without generating");