summaryrefslogtreecommitdiffstats
path: root/Source/CursesDialog/cmCursesMainForm.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/CursesDialog/cmCursesMainForm.cxx')
-rw-r--r--Source/CursesDialog/cmCursesMainForm.cxx80
1 files changed, 40 insertions, 40 deletions
diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx
index 833d540..be17a9f 100644
--- a/Source/CursesDialog/cmCursesMainForm.cxx
+++ b/Source/CursesDialog/cmCursesMainForm.cxx
@@ -9,7 +9,6 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
-#include "../cmCacheManager.h"
#include "../cmSystemTools.h"
#include "../cmVersion.h"
#include "../cmake.h"
@@ -23,6 +22,7 @@
#include "cmCursesCacheEntryComposite.h"
#include "cmCursesLongMessageForm.h"
#include "cmAlgorithms.h"
+#include "cmState.h"
inline int ctrl(int z)
@@ -107,21 +107,21 @@ void cmCursesMainForm::InitializeUI()
// which contain labels, entries and new entry markers
std::vector<cmCursesCacheEntryComposite*>* newEntries =
new std::vector<cmCursesCacheEntryComposite*>;
- newEntries->reserve(this->CMakeInstance->GetCacheManager()->GetSize());
+ std::vector<std::string> cacheKeys =
+ this->CMakeInstance->GetState()->GetCacheEntryKeys();
+ newEntries->reserve(cacheKeys.size());
// Count non-internal and non-static entries
int count=0;
- std::vector<std::string> cacheKeys =
- this->CMakeInstance->GetCacheManager()->GetCacheEntryKeys();
for(std::vector<std::string>::const_iterator it = cacheKeys.begin();
it != cacheKeys.end(); ++it)
{
- cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager()
+ cmState::CacheEntryType t = this->CMakeInstance->GetState()
->GetCacheEntryType(*it);
- if (t != cmCacheManager::INTERNAL &&
- t != cmCacheManager::STATIC &&
- t != cmCacheManager::UNINITIALIZED)
+ if (t != cmState::INTERNAL &&
+ t != cmState::STATIC &&
+ t != cmState::UNINITIALIZED)
{
++count;
}
@@ -147,11 +147,11 @@ void cmCursesMainForm::InitializeUI()
it != cacheKeys.end(); ++it)
{
std::string key = *it;
- cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager()
+ cmState::CacheEntryType t = this->CMakeInstance->GetState()
->GetCacheEntryType(*it);
- if (t == cmCacheManager::INTERNAL ||
- t == cmCacheManager::STATIC ||
- t == cmCacheManager::UNINITIALIZED )
+ if (t == cmState::INTERNAL ||
+ t == cmState::STATIC ||
+ t == cmState::UNINITIALIZED )
{
continue;
}
@@ -171,11 +171,11 @@ void cmCursesMainForm::InitializeUI()
it != cacheKeys.end(); ++it)
{
std::string key = *it;
- cmCacheManager::CacheEntryType t = this->CMakeInstance->GetCacheManager()
+ cmState::CacheEntryType t = this->CMakeInstance->GetState()
->GetCacheEntryType(*it);
- if (t == cmCacheManager::INTERNAL ||
- t == cmCacheManager::STATIC ||
- t == cmCacheManager::UNINITIALIZED )
+ if (t == cmState::INTERNAL ||
+ t == cmState::STATIC ||
+ t == cmState::UNINITIALIZED )
{
continue;
}
@@ -225,10 +225,10 @@ void cmCursesMainForm::RePost()
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
const char* existingValue =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryValue((*it)->GetValue());
bool advanced =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED");
if (!existingValue || (!this->AdvancedMode && advanced))
{
@@ -257,10 +257,10 @@ void cmCursesMainForm::RePost()
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
const char* existingValue =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryValue((*it)->GetValue());
bool advanced =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED");
if (!existingValue || (!this->AdvancedMode && advanced))
{
@@ -293,9 +293,9 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
cmCursesWidget* cw = reinterpret_cast<cmCursesWidget*>
(field_userptr(currentField));
// If in edit mode, get out of it
- if ( cw->GetType() == cmCacheManager::STRING ||
- cw->GetType() == cmCacheManager::PATH ||
- cw->GetType() == cmCacheManager::FILEPATH )
+ if ( cw->GetType() == cmState::STRING ||
+ cw->GetType() == cmState::PATH ||
+ cw->GetType() == cmState::FILEPATH )
{
cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw);
sw->SetInEdit(false);
@@ -329,10 +329,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
const char* existingValue =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryValue((*it)->GetValue());
bool advanced =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED");
if (!existingValue || (!this->AdvancedMode && advanced))
{
@@ -352,10 +352,10 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
for (it = this->Entries->begin(); it != this->Entries->end(); ++it)
{
const char* existingValue =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryValue((*it)->GetValue());
bool advanced =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryPropertyAsBool((*it)->GetValue(), "ADVANCED");
if (!existingValue || (!this->AdvancedMode && advanced))
{
@@ -516,10 +516,10 @@ void cmCursesMainForm::UpdateStatusBar(const char* message)
// Get the help string of the current entry
// and add it to the help string
const char* existingValue =
- this->CMakeInstance->GetCacheManager()->GetCacheEntryValue(curField);
+ this->CMakeInstance->GetState()->GetCacheEntryValue(curField);
if (existingValue)
{
- const char* hs = this->CMakeInstance->GetCacheManager()
+ const char* hs = this->CMakeInstance->GetState()
->GetCacheEntryProperty(curField, "HELPSTRING");
if ( hs )
{
@@ -814,7 +814,7 @@ void cmCursesMainForm::FillCacheManagerFromUI()
for(size_t i=0; i < size; i++)
{
std::string cacheKey = (*this->Entries)[i]->Key;
- const char* existingValue = this->CMakeInstance->GetCacheManager()
+ const char* existingValue = this->CMakeInstance->GetState()
->GetCacheEntryValue(cacheKey);
if (existingValue)
{
@@ -822,8 +822,8 @@ void cmCursesMainForm::FillCacheManagerFromUI()
std::string newValue = (*this->Entries)[i]->Entry->GetValue();
std::string fixedOldValue;
std::string fixedNewValue;
- cmCacheManager::CacheEntryType t =
- this->CMakeInstance->GetCacheManager()
+ cmState::CacheEntryType t =
+ this->CMakeInstance->GetState()
->GetCacheEntryType(cacheKey);
this->FixValue(t, oldValue, fixedOldValue);
this->FixValue(t, newValue, fixedNewValue);
@@ -831,24 +831,24 @@ void cmCursesMainForm::FillCacheManagerFromUI()
if(!(fixedOldValue == fixedNewValue))
{
// The user has changed the value. Mark it as modified.
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->SetCacheEntryBoolProperty(cacheKey, "MODIFIED", true);
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->SetCacheEntryValue(cacheKey, fixedNewValue);
}
}
}
}
-void cmCursesMainForm::FixValue(cmCacheManager::CacheEntryType type,
+void cmCursesMainForm::FixValue(cmState::CacheEntryType type,
const std::string& in, std::string& out) const
{
out = in.substr(0,in.find_last_not_of(" ")+1);
- if(type == cmCacheManager::PATH || type == cmCacheManager::FILEPATH)
+ if(type == cmState::PATH || type == cmState::FILEPATH)
{
cmSystemTools::ConvertToUnixSlashes(out);
}
- if(type == cmCacheManager::BOOL)
+ if(type == cmState::BOOL)
{
if(cmSystemTools::IsOff(out.c_str()))
{
@@ -1046,11 +1046,11 @@ void cmCursesMainForm::HandleInput()
const char* helpString = 0;
const char* existingValue =
- this->CMakeInstance->GetCacheManager()
+ this->CMakeInstance->GetState()
->GetCacheEntryValue(curField);
if (existingValue)
{
- helpString = this->CMakeInstance->GetCacheManager()
+ helpString = this->CMakeInstance->GetState()
->GetCacheEntryProperty(curField, "HELPSTRING");
}
if (helpString)
@@ -1161,7 +1161,7 @@ void cmCursesMainForm::HandleInput()
field_userptr(this->Fields[findex-2]));
if ( lbl )
{
- this->CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue());
+ this->CMakeInstance->GetState()->RemoveCacheEntry(lbl->GetValue());
std::string nextVal;
if (nextCur)