[Cmake-commits] CMake branch, next, updated. v3.7.0-1165-g7f07081

Brad King brad.king at kitware.com
Tue Nov 15 09:56:10 EST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  7f07081e9144cadfe7e1e15f28f43ac8b4cd6382 (commit)
       via  e330f155745e6c102a598015a6ba36a4882658b9 (commit)
       via  b9b815a782e55055ea1dbbda25cb9aa2f1fae222 (commit)
      from  33eadfabaf1a91a0800d9be79104b208023ebda0 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f07081e9144cadfe7e1e15f28f43ac8b4cd6382
commit 7f07081e9144cadfe7e1e15f28f43ac8b4cd6382
Merge: 33eadfa e330f15
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Tue Nov 15 09:56:09 2016 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Nov 15 09:56:09 2016 -0500

    Merge topic 'ccmake_fix_print_keys' into next
    
    e330f155 ccmake: Correctly display edit mode and associated keys
    b9b815a7 ccmake: Add missing spaces to match the previous text length


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e330f155745e6c102a598015a6ba36a4882658b9
commit e330f155745e6c102a598015a6ba36a4882658b9
Author:     Sylvain Joubert <joubert.sy at gmail.com>
AuthorDate: Tue Nov 15 11:55:03 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 15 09:54:32 2016 -0500

    ccmake: Correctly display edit mode and associated keys
    
    Specific widgets can implement `PrintKeys` but their effects were hidden
    by the main widget `PrintKeys`.  Fix this to give the user a better hint
    about the edit mode status.
    
    Closes: #13757

diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index fd4ecd1..f084305 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -347,61 +347,56 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
     cw = reinterpret_cast<cmCursesWidget*>(field_userptr(currentField));
   }
 
-  if (cw) {
-    cw->PrintKeys();
-  }
-
-  //    {
-  //    }
-  //  else
-  //    {
-  char firstLine[512] = "";
-  char secondLine[512] = "";
-  char thirdLine[512] = "";
-  if (process) {
-    const char* clearLine =
-      "                                                                    ";
-    strcpy(firstLine, clearLine);
-    strcpy(secondLine, clearLine);
-    strcpy(thirdLine, clearLine);
-  } else {
-    if (this->OkToGenerate) {
-      sprintf(firstLine,
-              "Press [c] to configure       Press [g] to generate and exit");
+  char fmt_s[] = "%s";
+  if (cw == CM_NULLPTR || cw->PrintKeys() == false) {
+    char firstLine[512] = "";
+    char secondLine[512] = "";
+    char thirdLine[512] = "";
+    if (process) {
+      const char* clearLine =
+        "                                                                    ";
+      strcpy(firstLine, clearLine);
+      strcpy(secondLine, clearLine);
+      strcpy(thirdLine, clearLine);
     } else {
-      sprintf(firstLine,
-              "Press [c] to configure                                     ");
-    }
-    {
-      const char* toggleKeyInstruction =
-        "Press [t] to toggle advanced mode (Currently %s)";
-      sprintf(thirdLine, toggleKeyInstruction,
-              this->AdvancedMode ? "On" : "Off");
+      if (this->OkToGenerate) {
+        sprintf(firstLine,
+                "Press [c] to configure       Press [g] to generate and exit");
+      } else {
+        sprintf(firstLine,
+                "Press [c] to configure                                     ");
+      }
+      {
+        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");
     }
-    sprintf(secondLine, "Press [h] for help           "
-                        "Press [q] to quit without generating");
-  }
 
-  curses_move(y - 4, 0);
-  char fmt_s[] = "%s";
-  char fmt[512] = "Press [enter] to edit option Press [d] to delete an entry";
-  if (process) {
-    strcpy(fmt, "                           ");
+    curses_move(y - 4, 0);
+    char fmt[512] =
+      "Press [enter] to edit option Press [d] to delete an entry";
+    if (process) {
+      strcpy(fmt, "                           ");
+    }
+    printw(fmt_s, fmt);
+    curses_move(y - 3, 0);
+    printw(fmt_s, firstLine);
+    curses_move(y - 2, 0);
+    printw(fmt_s, secondLine);
+    curses_move(y - 1, 0);
+    printw(fmt_s, thirdLine);
   }
-  printw(fmt_s, fmt);
-  curses_move(y - 3, 0);
-  printw(fmt_s, firstLine);
-  curses_move(y - 2, 0);
-  printw(fmt_s, secondLine);
-  curses_move(y - 1, 0);
-  printw(fmt_s, thirdLine);
 
   if (cw) {
-    sprintf(firstLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
-    curses_move(0, 65 - static_cast<unsigned int>(strlen(firstLine)) - 1);
-    printw(fmt_s, firstLine);
+    char pageLine[512] = "";
+    sprintf(pageLine, "Page %d of %d", cw->GetPage(), this->NumberOfPages);
+    curses_move(0, 65 - static_cast<unsigned int>(strlen(pageLine)) - 1);
+    printw(fmt_s, pageLine);
   }
-  //    }
 
   pos_form_cursor(this->Form);
 }
diff --git a/Source/CursesDialog/cmCursesStringWidget.cxx b/Source/CursesDialog/cmCursesStringWidget.cxx
index eabc642..ff189f0 100644
--- a/Source/CursesDialog/cmCursesStringWidget.cxx
+++ b/Source/CursesDialog/cmCursesStringWidget.cxx
@@ -202,7 +202,9 @@ bool cmCursesStringWidget::PrintKeys()
     printw(fmt_s, firstLine);
 
     curses_move(y - 3, 0);
-    printw(fmt_s, "Editing option, press [enter] to leave edit.");
+    printw(fmt_s, "Editing option, press [enter] to confirm");
+    curses_move(y - 2, 0);
+    printw(fmt_s, "                press [esc] to cancel");
     return true;
   }
   return false;

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b9b815a782e55055ea1dbbda25cb9aa2f1fae222
commit b9b815a782e55055ea1dbbda25cb9aa2f1fae222
Author:     Sylvain Joubert <joubert.sy at gmail.com>
AuthorDate: Tue Nov 15 11:12:34 2016 +0100
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Tue Nov 15 09:45:30 2016 -0500

    ccmake: Add missing spaces to match the previous text length
    
    There was a "glitch" leaving "it" on the screen

diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index ebd35f3..fd4ecd1 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -370,7 +370,7 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
               "Press [c] to configure       Press [g] to generate and exit");
     } else {
       sprintf(firstLine,
-              "Press [c] to configure                                   ");
+              "Press [c] to configure                                     ");
     }
     {
       const char* toggleKeyInstruction =

-----------------------------------------------------------------------

Summary of changes:
 Source/CursesDialog/cmCursesMainForm.cxx     |   91 ++++++++++++--------------
 Source/CursesDialog/cmCursesStringWidget.cxx |    4 +-
 2 files changed, 46 insertions(+), 49 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list