Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4165 in orxonox.OLD for orxonox/branches/heightMap/src/lib/gui/gui


Ignore:
Timestamp:
May 11, 2005, 2:23:54 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/heightMap: merged trunk back to the heightMap branche
merged with command:
svn merge trunk/ branches/heightMap/ -r 4122:HEAD

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  
    150150PACKAGE_VERSION = @PACKAGE_VERSION@
    151151PATH_SEPARATOR = @PATH_SEPARATOR@
     152PKG_CONFIG = @PKG_CONFIG@
    152153RANLIB = @RANLIB@
    153154SET_MAKE = @SET_MAKE@
     
    264265          esac; \
    265266        done; \
    266         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile'; \
     267        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile'; \
    267268        cd $(top_srcdir) && \
    268           $(AUTOMAKE) --gnu  src/lib/gui/gui/Makefile
     269          $(AUTOMAKE) --foreign  src/lib/gui/gui/Makefile
    269270.PRECIOUS: Makefile
    270271Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/heightMap/src/lib/gui/gui/gui.cc

    r4122 r4165  
    5353{
    5454  Window* orxonoxGUI = NULL;
    55 
     55  executable = NULL;
     56 
    5657  initGUI(argc, argv);
    5758
     
    8081      Box* optionBoxR = new Box('v');
    8182      {
    82         exec = new GuiExec();
    83         optionBoxR->fill(exec->getWidget());
    84        
    8583        flags = new GuiFlags();
    86        
    8784        optionBoxR->fill(flags->getWidget());
    8885       
    8986        update = new GuiUpdate();
    9087        optionBoxR->fill(update->getWidget());
     88
     89        exec = new GuiExec();
     90        optionBoxR->fill(exec->getWidget());
    9191      }
    9292      windowBox->fill(optionBoxR);
     
    9494    orxonoxGUI->fill(windowBox);
    9595  }
     96
     97
    9698  // Reading Values from File
    9799  exec->setConfDir(GUI_DEFAULT_CONF_DIR);
     
    116118    }
    117119#endif /* HAVE_CURL */
     120}
    118121
     122/**
     123   \brief starts the OrxonoxGUI
     124*/
     125void Gui::startGui(void)
     126{
    119127  mainloopGUI();
     128 
    120129#ifndef HAVE_GTK2
    121130  GuiExec::startOrxonox(NULL, exec);
     
    123132}
    124133
     134void 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*/
    125142bool Gui::startOrxonox = false;
    126143
  • orxonox/branches/heightMap/src/lib/gui/gui/gui.h

    r4122 r4165  
    2626  ~Gui(void);
    2727
     28  void startGui(void);
     29  void printHelp(void);
     30
    2831  static bool startOrxonox;
    2932};
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_audio.cc

    r4122 r4165  
    4747      enableSound = new CheckButton(CONFIG_NAME_DISABLE_AUDIO);
    4848      enableSound->setFlagName ("no-sound", 0);
     49      enableSound->setDescription("Disables Sound", "Check this to disable Sound in Orxonox");
     50      enableSound->setDefaultValue(0);
    4951      enableSound->saveability();
    5052      audioBox->fill(enableSound);
     
    5355      musicVolume = new Slider("Music Volume", 0, 100);
    5456      musicVolume->setFlagName("music-volume", "m", 80);
     57      musicVolume->setDescription("Sets the volume of the ingame music");
    5558      musicVolume->saveability();
    5659      audioBox->fill (musicVolume);
     
    5962      effectsVolume = new Slider ("Effects Volume", 0, 100);
    6063      effectsVolume->setFlagName ("effects-volume", "e", 80);
     64      effectsVolume->setDescription("Sets the volune of the ingame SoundEffects");
    6165      effectsVolume->saveability();
    6266      audioBox->fill (effectsVolume);
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_exec.cc

    r4122 r4165  
    7070      execBox->fill(this->saveSettings);
    7171
    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");
    7390      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                                  );
    74109      verboseMode->saveability();
    75110      execBox->fill(verboseMode);
     111#endif
    76112
    77113      alwaysShow = new CheckButton(CONFIG_NAME_ALWAYS_SHOW_GUI);
    78114      alwaysShow->setFlagName("gui", "g", 0);
     115      alwaysShow->setDescription("shows the gui when starting orxonox");
    79116      alwaysShow->saveability();
    80117      execBox->fill(alwaysShow);
     
    114151  this->confDir = ResourceManager::homeDirCheck(confDir);
    115152
    116   PRINTF(3)("Config Directory is: %s.\n", this->confDir);
     153  PRINTF(5)("Config Directory is: %s.\n", this->confDir);
    117154  //! \todo F** Windows-support
    118155#ifndef __WIN32__
     
    135172  this->confFile = new char[strlen(this->confDir)+strlen(fileName)+2];
    136173  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);
    138175}
    139176
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_flags.cc

    r4122 r4165  
    3838  this->flagsBox->fill(flagsLabel);
    3939  this->shortFlags = new CheckButton("shortFlags");
     40  this->shortFlags->setDefaultValue(0);
    4041  this->flagsBox->fill(shortFlags);
    4142
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_gtk.cc

    r4122 r4165  
    312312
    313313/**
     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*/
     318void 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/**
    314354    \brief Finds an Option by a given number(the n'th option found away from this Widget)
    315355    \param number The Count of options to wait(by reference)
     
    595635    }
    596636  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");
    598638}
    599639
     
    11771217  if ((this->value = atoi(tmpChar))=!0)
    11781218    this->value = 1;
    1179 #endif /* HAVE_GTK2 */
     1219
    11801220  PRINT(0)("%s set to: %d\n", this->title, this->value);
     1221#endif /* HAVE_GTK2 */
    11811222}
    11821223
     
    12621303  if (this->value <= this->start)
    12631304    this->value = this->start;
    1264 #endif /* HAVE_GTK2 */
     1305
    12651306  PRINT(0)("%s set to: %d\n",this->title, this->value);
     1307#endif /* HAVE_GTK2 */
    12661308}
    12671309
     
    13701412    {
    13711413      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);
    13751417  this->redraw();
    13761418}
     
    14291471
    14301472#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);
    14321474}
    14331475
     
    15181560void OptionLabel::load(char* loadString)
    15191561{
    1520   PRINTF(4)("Loading %s: setting to %s\n", this->title, loadString);
     1562  PRINTF(5)("Loading %s: setting to %s\n", this->title, loadString);
    15211563  this->setValue(loadString);
    15221564}
     
    16681710#ifdef HAVE_GTK2
    16691711  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);
    16711713#else /* HVE_GTK2 */
    16721714  PRINT(0)("Progress: %f%%\n", this->progress*100.0/this->totalSize);
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_gtk.h

    r4122 r4165  
    7171   static void listGroups(Widget* widget);
    7272   static void listGroups(Widget* widget, void* data);
     73   static void printHelp(Widget* widget);
    7374   Widget* findGroupByNumber(int* number, unsigned int depth);
    7475   static void setOptions(Widget* widget);
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_update.cc

    r4122 r4165  
    5555  dataDirButton = new Button(CONFIG_NAME_DATADIR);
    5656  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");
    5759  dataDirLabel->saveability();
    5860  dataDirDialog = new FileDialog("data-Repos-location");
     
    7375  this->updateBox->fill(this->autoUpdate);
    7476  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");
    7578  this->autoUpdate->saveability();
    7679
     
    127130bool GuiUpdate::getSystemInfo(void)
    128131{
    129   PRINTF(3)("Grabbing system information\n");
     132  PRINTF(5)("Grabbing system information\n");
    130133  this->tmpDir = getenv("TMPDIR");
    131134  if(!tmpDir)
    132135    this->tmpDir = "/tmp";
    133   PRINTF(4)("Temporary directory is: %s\n", this->tmpDir);
     136  PRINTF(5)("Temporary directory is: %s\n", this->tmpDir);
    134137
    135138#ifdef __WIN32__
     
    138141  this->homeDir = getenv("HOME");
    139142#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);
    144148
    145149  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);
    147151
    148152  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);
    150154}
    151155
     
    153157bool* GuiUpdate::checkForUpdates(void)
    154158{
    155   PRINTF(3)("checking for new version of orxonox\n");
     159  PRINTF(4)("checking for new version of orxonox\n");
    156160  FileInfo updateFileInfo;
    157161  updateFileInfo.fileName = "update_info";
     
    263267  dataInfo->webRoot  = "http://www.orxonox.ethz.ch/files/";
    264268  dataInfo->localRoot = "./";
    265   PRINTF(3)("Preparing to download file %s.\n", dataInfo->fileName);
     269  PRINTF(4)("Preparing to download file %s.\n", dataInfo->fileName);
    266270  downloadWithStyle(dataInfo);
    267271}
     
    348352      return false;
    349353    }
    350   PRINTF(3)("Downloading.\n");
     354  PRINTF(4)("Downloading.\n");
    351355  FileInfo* info =(FileInfo*)fileInfo;
    352356  CURLcode res;
     
    396400      return false;
    397401    }
    398   PRINTF(3)("Downloading.\n");
     402  PRINTF(4)("Downloading.\n");
    399403  FileInfo* info =(FileInfo*)fileInfo;
    400404  CURLcode res;
     
    464468    curl_easy_cleanup(curlHandle);
    465469 
    466   PRINTF(3)("Closing the downloaded file.\n");
     470  PRINTF(4)("Closing the downloaded file.\n");
    467471  fclose(info->fileHandle);
    468472
     
    490494gint GuiUpdate::cancelDownload(GtkWidget* w, GdkEventKey* event, void* bar)
    491495{
    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");
    493497}
    494498#endif /* HAVE_GTK2 */
  • orxonox/branches/heightMap/src/lib/gui/gui/gui_video.cc

    r4122 r4165  
    5151      fullscreen = new CheckButton(CONFIG_NAME_FULLSCREEN);
    5252      fullscreen->setFlagName("windowed", "q", 1);
     53      fullscreen->setDescription("Starts orxonox in windowed mode");
    5354      fullscreen->saveability();
    5455      videoBox->fill(fullscreen);
     
    5758      resolution->saveability();
    5859      resolution->setFlagName("resolution", "r", 0);
     60      resolution->setDescription("Sets the resolution of orxonox");
    5961      videoBox->fill(resolution);
    6062      wireframe = new CheckButton(CONFIG_NAME_WIREFRAME);
    6163      wireframe->setFlagName("wireframe", "w", 0);
     64      wireframe->setDescription("Starts orxonox in wireframe mode");
    6265      wireframe->saveability();
    6366      videoBox->fill(wireframe);
     
    199202  else{
    200203    /* Print valid modes */
    201     PRINT(4)("Available Modes\n");
     204    PRINT(5)("Available Modes\n");
    202205    for(i = 0; modes[i] ;++i)
    203206      {
    204207        if (x != modes[i]->w || y != modes[i]->h)
    205208          {
    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);
    207210            sprintf(tmpChar, "%dx%d", modes[i]->w, modes[i]->h);
    208211            menu->addItem(tmpChar);
Note: See TracChangeset for help on using the changeset viewer.