Changeset 8858 for code/trunk/src/libraries/core/GUIManager.cc
- Timestamp:
- Aug 23, 2011, 12:45:53 AM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:ignore
-
old new 1 1 build 2 2 codeblocks 3 vs 3 4 dependencies
-
- Property svn:mergeinfo changed
/code/branches/output (added) merged: 8739-8740,8765,8771-8772,8774-8780,8787-8789,8794-8799,8801,8803-8812,8814,8816-8817,8820,8822,8825-8837,8840,8844,8846,8848-8850,8853-8854
- Property svn:ignore
-
code/trunk/src/libraries/core/GUIManager.cc
r8729 r8858 73 73 #include "util/Clock.h" 74 74 #include "util/Convert.h" 75 #include "util/ Debug.h"75 #include "util/Output.h" 76 76 #include "util/Exception.h" 77 77 #include "util/Math.h" 78 78 #include "util/OrxAssert.h" 79 #include "util/output/BaseWriter.h" 79 80 #include "ConfigValueIncludes.h" 80 81 #include "Core.h" … … 101 102 void logEvent(const CEGUI::String& message, CEGUI::LoggingLevel level = CEGUI::Standard) 102 103 { 103 int orxonoxLevel = CEGUI::Standard;104 OutputLevel orxonoxLevel = level::debug_output; 104 105 switch (level) 105 106 { 106 case CEGUI::Errors: orxonoxLevel = 1; break;107 case CEGUI::Warnings: orxonoxLevel = 2; break;108 case CEGUI::Standard: orxonoxLevel = 4; break;109 case CEGUI::Informative: orxonoxLevel = 5; break;110 case CEGUI::Insane: orxonoxLevel = 6; break;107 case CEGUI::Errors: orxonoxLevel = level::internal_error; break; 108 case CEGUI::Warnings: orxonoxLevel = level::internal_warning; break; 109 case CEGUI::Standard: orxonoxLevel = level::verbose; break; 110 case CEGUI::Informative: orxonoxLevel = level::verbose_more; break; 111 case CEGUI::Insane: orxonoxLevel = level::verbose_ultra; break; 111 112 default: OrxAssert(false, "CEGUI log level out of range, inspect immediately!"); 112 113 } 113 OutputHandler::getOutStream(orxonoxLevel) 114 << "CEGUI: " << message << std::endl;114 115 orxout(orxonoxLevel, context::cegui) << message << endl; 115 116 116 117 CEGUI::DefaultLogger::logEvent(message, level); … … 256 257 { 257 258 RegisterRootObject(GUIManager); 259 260 orxout(internal_status) << "initializing GUIManager..." << endl; 261 258 262 this->setConfigValues(); 259 263 260 264 using namespace CEGUI; 261 265 262 COUT(3) << "Initialising CEGUI." << std::endl;266 orxout(internal_info) << "Initialising CEGUI." << endl; 263 267 264 268 this->oldCEGUI_ = false; 265 269 266 270 // Note: No SceneManager specified yet 267 271 #ifdef ORXONOX_OLD_CEGUI … … 300 304 std::auto_ptr<CEGUILogger> ceguiLogger(new CEGUILogger()); 301 305 ceguiLogger->setLogFilename(PathConfig::getLogPathString() + "cegui.log"); 302 // Set the log level according to ours (translate by subtracting 1) 303 ceguiLogger->setLoggingLevel( 304 static_cast<LoggingLevel>(OutputHandler::getInstance().getSoftDebugLevel("logFile") - 1)); 306 ceguiLogger->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_)); 305 307 this->ceguiLogger_ = ceguiLogger.release(); 306 308 … … 336 338 // Set up the sheet manager in the Lua framework 337 339 this->luaState_->doFile("SheetManager.lua"); 340 341 orxout(internal_status) << "finished initializing GUIManager" << endl; 338 342 } 339 343 340 344 void GUIManager::destroy() 341 345 { 346 orxout(internal_status) << "destroying GUIManager..." << endl; 347 342 348 using namespace CEGUI; 343 349 … … 356 362 #endif 357 363 safeObjectDelete(&luaState_); 364 365 orxout(internal_status) << "finished destroying GUIManager" << endl; 358 366 } 359 367 360 368 void GUIManager::setConfigValues(void) 361 369 { 362 SetConfigValue(guiScheme_, GUIManager::defaultScheme_) .description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme);370 SetConfigValue(guiScheme_, GUIManager::defaultScheme_).description("Changes the current GUI scheme.").callback(this, &GUIManager::changedGUIScheme); 363 371 SetConfigValue(numScrollLines_, 1).description("How many lines to scroll in a list if the scroll wheel is used"); 372 SetConfigValueExternal(outputLevelCeguiLog_, BaseWriter::getConfigurableSectionName(), "outputLevelCeguiLog", CEGUI::Standard).description("The log level of the CEGUI log file").callback(this, &GUIManager::changedCeguiOutputLevel); 364 373 } 365 374 366 375 void GUIManager::changedGUIScheme(void) 367 376 { 377 } 378 379 void GUIManager::changedCeguiOutputLevel() 380 { 381 if (this->ceguiLogger_) 382 this->ceguiLogger_->setLoggingLevel(static_cast<CEGUI::LoggingLevel>(this->outputLevelCeguiLog_)); 368 383 } 369 384 … … 670 685 { 671 686 // Display the error and proceed. See @remarks why this can be dangerous. 672 COUT(1) << ex.getMessage() << std::endl;687 orxout(internal_error) << ex.getMessage() << endl; 673 688 return true; 674 689 }
Note: See TracChangeset
for help on using the changeset viewer.