summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog
diff options
context:
space:
mode:
authorAndy Cedilnik <andy.cedilnik@kitware.com>2002-11-18 21:29:14 (GMT)
committerAndy Cedilnik <andy.cedilnik@kitware.com>2002-11-18 21:29:14 (GMT)
commit65a814c989c1ff44d61660b628fbf45d5fdc2b95 (patch)
tree4f48c26c7a712e08ec15cb965223cc459aff619c /Source/CursesDialog
parentd05716c4984fc327e0504e9ab1062be67d1f4807 (diff)
downloadCMake-65a814c989c1ff44d61660b628fbf45d5fdc2b95.zip
CMake-65a814c989c1ff44d61660b628fbf45d5fdc2b95.tar.gz
CMake-65a814c989c1ff44d61660b628fbf45d5fdc2b95.tar.bz2
Initial add of progress
Diffstat (limited to 'Source/CursesDialog')
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx13
-rw-r--r--Source/CursesDialog/cmCursesMainForm.h5
2 files changed, 17 insertions, 1 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 38202fd..ddccf9a 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -547,6 +547,14 @@ void cmCursesMainForm::UpdateStatusBar()
pos_form_cursor(m_Form);
}
+void cmCursesMainForm::UpdateProgress(const char *msg, float prog, void*)
+{
+ if ( prog < 0 )
+ {
+ std::cout << "-- " << msg << std::endl;
+ }
+}
+
int cmCursesMainForm::Configure()
{
@@ -559,7 +567,7 @@ int cmCursesMainForm::Configure()
refresh();
endwin();
std::cerr << "Configuring, please wait...\n\r";
-
+ this->m_CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress, this);
// always save the current gui values to disk
this->FillCacheManagerFromUI();
@@ -573,6 +581,7 @@ int cmCursesMainForm::Configure()
// run the generate process
m_OkToGenerate = true;
int retVal = this->m_CMakeInstance->Configure();
+ this->m_CMakeInstance->SetProgressCallback(0, 0);
initscr(); /* Initialization */
noecho(); /* Echo off */
@@ -623,6 +632,7 @@ int cmCursesMainForm::Generate()
refresh();
endwin();
std::cerr << "Generating, please wait...\n\r";
+ this->m_CMakeInstance->SetProgressCallback(cmCursesMainForm::UpdateProgress, this);
// Get rid of previous errors
m_Errors = std::vector<std::string>();
@@ -630,6 +640,7 @@ int cmCursesMainForm::Generate()
// run the generate process
int retVal = this->m_CMakeInstance->Generate();
+ this->m_CMakeInstance->SetProgressCallback(0, 0);
initscr(); /* Initialization */
noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */
diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h
index 6bbe0cf..9e19919 100644
--- a/Source/CursesDialog/cmCursesMainForm.h
+++ b/Source/CursesDialog/cmCursesMainForm.h
@@ -98,6 +98,11 @@ public:
*/
void LoadCache(const char *dir);
+ /**
+ * Progress callback
+ */
+ static void UpdateProgress(const char *msg, float prog, void*);
+
protected:
cmCursesMainForm(const cmCursesMainForm& from);
void operator=(const cmCursesMainForm&);