Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 2008 in orxonox.OLD for orxonox/branches


Ignore:
Timestamp:
Jun 22, 2004, 11:10:00 AM (20 years ago)
Author:
bensch
Message:

orxonox/branches/gui/guicc: now saves config to home/.orxonox.conf

Location:
orxonox/branches/gui/guicc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/gui/guicc/orxonox_gui.cc

    r2007 r2008  
    5353  flags->setTextFromFlags (orxonoxGUI);
    5454
    55   exec->setFilename ("test");
     55  exec->setFilename ("~/.orxonox.conf");
    5656  exec->readFromFile (orxonoxGUI);
    5757  orxonoxGUI->listOptions();
  • orxonox/branches/gui/guicc/orxonox_gui_exec.cc

    r2007 r2008  
    55OrxonoxGuiExec::OrxonoxGuiExec (Window* orxonoxGUI)
    66{
    7   configFile = (char*)malloc(256*sizeof(char));
     7  configFile = (char*)malloc (512*sizeof (char));
    88
    99  execFrame = new Frame ("Execute-Tags:");
     
    3636void OrxonoxGuiExec::setFilename (char* filename)
    3737{
    38  
    39   if (filename)
    40     sprintf(configFile, "%s", filename);
     38  char* buffer = (char*) malloc (512*sizeof(buffer));
     39  sprintf (buffer, "%s", filename);
     40  if (!strncmp (buffer, "~/", 2))
     41  {
     42#ifdef __WIN32__
     43    sprintf (configFile, "%s/%s", getenv ("USERPROFILE"), buffer+2);
     44#else
     45    sprintf (configFile, "%s/%s", getenv ("HOME"), buffer+2);
     46#endif
     47  }
     48  else if (buffer)
     49    sprintf(configFile, "%s", buffer);
     50  delete buffer;
    4151}
    4252
Note: See TracChangeset for help on using the changeset viewer.