Changeset 4165 in orxonox.OLD for orxonox/branches/heightMap/src/lib/gui/gui
- Timestamp:
- May 11, 2005, 2:23:54 PM (20 years ago)
- Location:
- orxonox/branches/heightMap/src/lib/gui/gui
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/heightMap/src/lib/gui/gui/Makefile.in
r4122 r4165 150 150 PACKAGE_VERSION = @PACKAGE_VERSION@ 151 151 PATH_SEPARATOR = @PATH_SEPARATOR@ 152 PKG_CONFIG = @PKG_CONFIG@ 152 153 RANLIB = @RANLIB@ 153 154 SET_MAKE = @SET_MAKE@ … … 264 265 esac; \ 265 266 done; \ 266 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/gui/gui/Makefile'; \267 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/gui/gui/Makefile'; \ 267 268 cd $(top_srcdir) && \ 268 $(AUTOMAKE) -- gnusrc/lib/gui/gui/Makefile269 $(AUTOMAKE) --foreign src/lib/gui/gui/Makefile 269 270 .PRECIOUS: Makefile 270 271 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/branches/heightMap/src/lib/gui/gui/gui.cc
r4122 r4165 53 53 { 54 54 Window* orxonoxGUI = NULL; 55 55 executable = NULL; 56 56 57 initGUI(argc, argv); 57 58 … … 80 81 Box* optionBoxR = new Box('v'); 81 82 { 82 exec = new GuiExec();83 optionBoxR->fill(exec->getWidget());84 85 83 flags = new GuiFlags(); 86 87 84 optionBoxR->fill(flags->getWidget()); 88 85 89 86 update = new GuiUpdate(); 90 87 optionBoxR->fill(update->getWidget()); 88 89 exec = new GuiExec(); 90 optionBoxR->fill(exec->getWidget()); 91 91 } 92 92 windowBox->fill(optionBoxR); … … 94 94 orxonoxGUI->fill(windowBox); 95 95 } 96 97 96 98 // Reading Values from File 97 99 exec->setConfDir(GUI_DEFAULT_CONF_DIR); … … 116 118 } 117 119 #endif /* HAVE_CURL */ 120 } 118 121 122 /** 123 \brief starts the OrxonoxGUI 124 */ 125 void Gui::startGui(void) 126 { 119 127 mainloopGUI(); 128 120 129 #ifndef HAVE_GTK2 121 130 GuiExec::startOrxonox(NULL, exec); … … 123 132 } 124 133 134 void Gui::printHelp() 135 { 136 Window::mainWindow->walkThrough(Widget::printHelp, 1); 137 } 138 139 /** 140 \brief a bool that knows if orxonox should be started 141 */ 125 142 bool Gui::startOrxonox = false; 126 143 -
orxonox/branches/heightMap/src/lib/gui/gui/gui.h
r4122 r4165 26 26 ~Gui(void); 27 27 28 void startGui(void); 29 void printHelp(void); 30 28 31 static bool startOrxonox; 29 32 }; -
orxonox/branches/heightMap/src/lib/gui/gui/gui_audio.cc
r4122 r4165 47 47 enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO); 48 48 enableSound->setFlagName ("no-sound", 0); 49 enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox"); 50 enableSound->setDefaultValue(0); 49 51 enableSound->saveability(); 50 52 audioBox->fill(enableSound); … … 53 55 musicVolume = new Slider("Music Volume", 0, 100); 54 56 musicVolume->setFlagName("music-volume", "m", 80); 57 musicVolume->setDescription("Sets the volume of the ingame music"); 55 58 musicVolume->saveability(); 56 59 audioBox->fill (musicVolume); … … 59 62 effectsVolume = new Slider ("Effects Volume", 0, 100); 60 63 effectsVolume->setFlagName ("effects-volume", "e", 80); 64 effectsVolume->setDescription("Sets the volune of the ingame SoundEffects"); 61 65 effectsVolume->saveability(); 62 66 audioBox->fill (effectsVolume); -
orxonox/branches/heightMap/src/lib/gui/gui/gui_exec.cc
r4122 r4165 70 70 execBox->fill(this->saveSettings); 71 71 72 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", "error", "warning", "info", "lastItem"); 72 #ifdef DEBUG 73 verboseMode = new Menu(CONFIG_NAME_VERBOSE_MODE, "nothing", 74 #if DEBUG >=1 75 "error", 76 #endif 77 #if DEBUG >=2 78 "warning", 79 #endif 80 #if DEBUG >=3 81 "info", 82 #endif 83 #if DEBUG >=4 84 "debug", 85 #endif 86 #if DEBUG >=5 87 "heavydebug", 88 #endif 89 "lastItem"); 73 90 verboseMode->setFlagName("verbose", "v", 2); 91 verboseMode->setDescription("Sets the Output Mode", "This Enables Outbug messages\n" 92 "0: nothing will be displayed, but stuff one cannot do without (eg.GUI)\n" 93 #if DEBUG >=1 94 "1: error: outputs all the above and errors" 95 #endif 96 #if DEBUG >=2 97 "2: warning: outputs all the above plus warnings" 98 #endif 99 #if DEBUG >=3 100 "3: info: outputs all the above plus Information" 101 #endif 102 #if DEBUG >=4 103 "4: debug: displays all the above plus debug information" 104 #endif 105 #if DEBUG >=5 106 "5: heavydebug: displays all the above plus heavy debug information: WARNING: the game will run very slow with this." 107 #endif 108 ); 74 109 verboseMode->saveability(); 75 110 execBox->fill(verboseMode); 111 #endif 76 112 77 113 alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI); 78 114 alwaysShow->setFlagName("gui", "g", 0); 115 alwaysShow->setDescription("shows the gui when starting orxonox"); 79 116 alwaysShow->saveability(); 80 117 execBox->fill(alwaysShow); … … 114 151 this->confDir = ResourceManager::homeDirCheck(confDir); 115 152 116 PRINTF( 3)("Config Directory is: %s.\n", this->confDir);153 PRINTF(5)("Config Directory is: %s.\n", this->confDir); 117 154 //! \todo F** Windows-support 118 155 #ifndef __WIN32__ … … 135 172 this->confFile = new char[strlen(this->confDir)+strlen(fileName)+2]; 136 173 sprintf(this->confFile, "%s/%s", this->confDir, fileName); 137 PRINTF( 3)("ConfigurationFile is %s.\n", this->confFile);174 PRINTF(5)("ConfigurationFile is %s.\n", this->confFile); 138 175 } 139 176 -
orxonox/branches/heightMap/src/lib/gui/gui/gui_flags.cc
r4122 r4165 38 38 this->flagsBox->fill(flagsLabel); 39 39 this->shortFlags = new CheckButton("shortFlags"); 40 this->shortFlags->setDefaultValue(0); 40 41 this->flagsBox->fill(shortFlags); 41 42 -
orxonox/branches/heightMap/src/lib/gui/gui/gui_gtk.cc
r4122 r4165 312 312 313 313 /** 314 \brief This is for listing the options of "widget" 315 \param widget specifies the widget that should be listed 316 \param data A Counter, that always knows how many Options have been found yet. 317 */ 318 void Widget::printHelp(Widget* widget) 319 { 320 int helpLen=0; 321 322 if (widget->optionType > GUI_NOTHING) 323 { 324 Option* option = (Option*)widget; 325 if (option->flagName || option->flagNameShort) 326 { 327 PRINT(0)(" "); 328 if (option->flagNameShort) 329 { 330 PRINT(0)("-%s", option->flagNameShort); 331 helpLen += strlen(option->flagNameShort)+1; 332 } 333 if (option->flagName) 334 { 335 if (helpLen > 0) 336 { 337 PRINT(0)("|"); 338 helpLen++; 339 } 340 PRINT(0)("--%s:", option->flagName); 341 helpLen += strlen(option->flagName)+2; 342 } 343 while ((helpLen ++) < 29) 344 PRINT(0)(" "); 345 if (option->shortDescription) 346 PRINT(0)("%s\n", option->shortDescription); 347 else 348 PRINT(0)("\n"); 349 } 350 } 351 } 352 353 /** 314 354 \brief Finds an Option by a given number(the n'th option found away from this Widget) 315 355 \param number The Count of options to wait(by reference) … … 595 635 } 596 636 else 597 PRINTF( 1)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n");637 PRINTF(2)("You tried to put more than one Widget into a Container. \nNot including this item.\nThis is only possible with Boxes.\n"); 598 638 } 599 639 … … 1177 1217 if ((this->value = atoi(tmpChar))=!0) 1178 1218 this->value = 1; 1179 #endif /* HAVE_GTK2 */ 1219 1180 1220 PRINT(0)("%s set to: %d\n", this->title, this->value); 1221 #endif /* HAVE_GTK2 */ 1181 1222 } 1182 1223 … … 1262 1303 if (this->value <= this->start) 1263 1304 this->value = this->start; 1264 #endif /* HAVE_GTK2 */ 1305 1265 1306 PRINT(0)("%s set to: %d\n",this->title, this->value); 1307 #endif /* HAVE_GTK2 */ 1266 1308 } 1267 1309 … … 1370 1412 { 1371 1413 this->value = 0; 1372 PRINTF(2)(" Sorry, but%s has not been found in the Itemlist of %s\n", loadString, this->title);1373 } 1374 PRINTF( 4)( "Loading %s: setting to %d\n", this->title, this->value);1414 PRINTF(2)("%s has not been found in the Itemlist of %s\n", loadString, this->title); 1415 } 1416 PRINTF(5)( "Loading %s: setting to %d\n", this->title, this->value); 1375 1417 this->redraw(); 1376 1418 } … … 1429 1471 1430 1472 #endif /* HAVE_GTK2 */ 1431 PRINT( 4)("%s set to: %d\n", this->title, this->value);1473 PRINT(5)("%s set to: %d\n", this->title, this->value); 1432 1474 } 1433 1475 … … 1518 1560 void OptionLabel::load(char* loadString) 1519 1561 { 1520 PRINTF( 4)("Loading %s: setting to %s\n", this->title, loadString);1562 PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString); 1521 1563 this->setValue(loadString); 1522 1564 } … … 1668 1710 #ifdef HAVE_GTK2 1669 1711 gtk_progress_set_value(GTK_PROGRESS(widget), this->progress*100.0/this->totalSize); 1670 PRINTF( 4)("Progress: %f%%\n", this->progress*100.0/this->totalSize);1712 PRINTF(5)("Progress: %f%%\n", this->progress*100.0/this->totalSize); 1671 1713 #else /* HVE_GTK2 */ 1672 1714 PRINT(0)("Progress: %f%%\n", this->progress*100.0/this->totalSize); -
orxonox/branches/heightMap/src/lib/gui/gui/gui_gtk.h
r4122 r4165 71 71 static void listGroups(Widget* widget); 72 72 static void listGroups(Widget* widget, void* data); 73 static void printHelp(Widget* widget); 73 74 Widget* findGroupByNumber(int* number, unsigned int depth); 74 75 static void setOptions(Widget* widget); -
orxonox/branches/heightMap/src/lib/gui/gui/gui_update.cc
r4122 r4165 55 55 dataDirButton = new Button(CONFIG_NAME_DATADIR); 56 56 dataDirLabel = new OptionLabel(CONFIG_NAME_DATADIR, "unknown"); 57 dataDirLabel->setFlagName("data-dir", "d", 0); 58 dataDirLabel->setDescription("Sets the location of the orxonox' Data-Directory"); 57 59 dataDirLabel->saveability(); 58 60 dataDirDialog = new FileDialog("data-Repos-location"); … … 73 75 this->updateBox->fill(this->autoUpdate); 74 76 this->autoUpdate->setFlagName("update", "u", 0); 77 this->autoUpdate->setDescription("Updates orxonox", "When this option is selected orxonox automatically searches for updates, and if found installs them"); 75 78 this->autoUpdate->saveability(); 76 79 … … 127 130 bool GuiUpdate::getSystemInfo(void) 128 131 { 129 PRINTF( 3)("Grabbing system information\n");132 PRINTF(5)("Grabbing system information\n"); 130 133 this->tmpDir = getenv("TMPDIR"); 131 134 if(!tmpDir) 132 135 this->tmpDir = "/tmp"; 133 PRINTF( 4)("Temporary directory is: %s\n", this->tmpDir);136 PRINTF(5)("Temporary directory is: %s\n", this->tmpDir); 134 137 135 138 #ifdef __WIN32__ … … 138 141 this->homeDir = getenv("HOME"); 139 142 #endif 140 PRINTF(4)("Home directory is %s\n", homeDir); 141 142 this->installDataDir = "/usr/share/games/orxonox"; 143 PRINTF(4)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir); 143 PRINTF(5)("Home directory is %s\n", homeDir); 144 145 146 this->installDataDir = DEFAULT_DATA_DIR; 147 PRINTF(5)("Installation of orxonox-data will go to this directory: %s\n", this->installDataDir); 144 148 145 149 this->installSourceDir = "/usr/games/bin"; 146 PRINTF( 4)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir);150 PRINTF(5)("Installation of orxonox-source will go to this directory: %s\n", this->installSourceDir); 147 151 148 152 this->userName = getenv("USER"); 149 PRINTF( 4)("Logged in username is: %s\n", this->userName);153 PRINTF(5)("Logged in username is: %s\n", this->userName); 150 154 } 151 155 … … 153 157 bool* GuiUpdate::checkForUpdates(void) 154 158 { 155 PRINTF( 3)("checking for new version of orxonox\n");159 PRINTF(4)("checking for new version of orxonox\n"); 156 160 FileInfo updateFileInfo; 157 161 updateFileInfo.fileName = "update_info"; … … 263 267 dataInfo->webRoot = "http://www.orxonox.ethz.ch/files/"; 264 268 dataInfo->localRoot = "./"; 265 PRINTF( 3)("Preparing to download file %s.\n", dataInfo->fileName);269 PRINTF(4)("Preparing to download file %s.\n", dataInfo->fileName); 266 270 downloadWithStyle(dataInfo); 267 271 } … … 348 352 return false; 349 353 } 350 PRINTF( 3)("Downloading.\n");354 PRINTF(4)("Downloading.\n"); 351 355 FileInfo* info =(FileInfo*)fileInfo; 352 356 CURLcode res; … … 396 400 return false; 397 401 } 398 PRINTF( 3)("Downloading.\n");402 PRINTF(4)("Downloading.\n"); 399 403 FileInfo* info =(FileInfo*)fileInfo; 400 404 CURLcode res; … … 464 468 curl_easy_cleanup(curlHandle); 465 469 466 PRINTF( 3)("Closing the downloaded file.\n");470 PRINTF(4)("Closing the downloaded file.\n"); 467 471 fclose(info->fileHandle); 468 472 … … 490 494 gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar) 491 495 { 492 PRINTF( 4)("Cannot cancle the Downloading process until after this File\n");496 PRINTF(3)("Cannot cancle the Downloading process until after this File\n"); 493 497 } 494 498 #endif /* HAVE_GTK2 */ -
orxonox/branches/heightMap/src/lib/gui/gui/gui_video.cc
r4122 r4165 51 51 fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN); 52 52 fullscreen->setFlagName("windowed", "q", 1); 53 fullscreen->setDescription("Starts orxonox in windowed mode"); 53 54 fullscreen->saveability(); 54 55 videoBox->fill(fullscreen); … … 57 58 resolution->saveability(); 58 59 resolution->setFlagName("resolution", "r", 0); 60 resolution->setDescription("Sets the resolution of orxonox"); 59 61 videoBox->fill(resolution); 60 62 wireframe = new CheckButton(CONFIG_NAME_WIREFRAME); 61 63 wireframe->setFlagName("wireframe", "w", 0); 64 wireframe->setDescription("Starts orxonox in wireframe mode"); 62 65 wireframe->saveability(); 63 66 videoBox->fill(wireframe); … … 199 202 else{ 200 203 /* Print valid modes */ 201 PRINT( 4)("Available Modes\n");204 PRINT(5)("Available Modes\n"); 202 205 for(i = 0; modes[i] ;++i) 203 206 { 204 207 if (x != modes[i]->w || y != modes[i]->h) 205 208 { 206 PRINT (4)(" %d x %d\n", modes[i]->w, modes[i]->h);209 PRINTF(5)(" %d x %d\n", modes[i]->w, modes[i]->h); 207 210 sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h); 208 211 menu->addItem(tmpChar);
Note: See TracChangeset
for help on using the changeset viewer.