Răsfoiți Sursa

ccmake: Factor toggle key help instructions.

Nicolas Despres 15 ani în urmă
părinte
comite
ceff6ec525
1 a modificat fișierele cu 7 adăugiri și 9 ștergeri
  1. 7 9
      Source/CursesDialog/cmCursesMainForm.cxx

+ 7 - 9
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");