Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5016 in orxonox.OLD for orxonox/trunk/src/lib/gui


Ignore:
Timestamp:
Aug 14, 2005, 5:37:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/lib/gui/gui_exec.cc

    r5015 r5016  
    242242  if(widget->optionType > GUI_NOTHING)
    243243    if (static_cast<Option*>(widget)->isSaveable())
    244       {
    245         char Buffer[256];
    246         char* space2under;
    247         strcpy(Buffer, static_cast<Option*>(widget)->title);
    248         if(strchr(Buffer, '_'))
    249           PRINTF(2)("Optionname %s is not Valid for Saving, because it includes an underscore\n", Buffer);
    250         while(space2under = strchr(Buffer, ' '))
    251           {
    252             space2under[0] = '_';
    253           }
    254           fprintf(CONFIG_FILE, "%s = %s\n", Buffer, static_cast<Option*>(widget)->save());
    255       }
     244      fprintf(CONFIG_FILE, "%s = %s\n", static_cast<Option*>(widget)->title, static_cast<Option*>(widget)->save());
    256245
    257246  if(widget->next != NULL)
     
    265254void GuiExec::readFromFile(Widget* widget)
    266255{
    267 
    268256  char* fileName = ResourceManager::homeDirCheck(confFile);
    269257  IniParser iniParser(fileName);
     
    300288  }
    301289  widget->walkThrough(widget->setOptions, 0);
    302 
    303 //
    304 //
    305 //   this->CONFIG_FILE = fopen(this->confFile, "r");
    306 //   VarInfo varInfo;
    307 //   if(this->CONFIG_FILE)
    308 //     {
    309 //       Widget* groupWidget = widget;
    310 //       char Buffer[256] = "";
    311 //       char Variable[256]= "";
    312 //       char* Value;
    313 //       while(fscanf(this->CONFIG_FILE, "%s", Buffer) != EOF)
    314 //         {
    315 //           // group-search //
    316 //           if(!strncmp(Buffer, "[", 1))
    317 //             {
    318 //               if((groupWidget = locateGroup(widget, Buffer, 1))==NULL)
    319 //                 {
    320 //                   PRINTF(2)("!!There is no group called %s in this GUI.\n First best Widget will get the Infos assigned.\n Config-File will be updated in next Save\n", Buffer);
    321 //                   groupWidget = widget;
    322 //                 }
    323 //               else
    324 //                 PRINT(5)("Group %s located.\n", static_cast<Packer*>(groupWidget)->groupName);
    325 //             }
    326 //           // option-setting //
    327 //           if(!strcmp(Buffer, "="))
    328 //             {
    329 //               char* under2space;
    330 //               while(under2space = strchr(Variable, '_'))
    331 //                 {
    332 //                   sprintf(under2space, " %s", under2space+1);
    333 //                 }
    334 //
    335 //               fscanf(this->CONFIG_FILE, "%s", Buffer);
    336 //               varInfo.variableName = Variable;
    337 //               varInfo.variableValue = Buffer;
    338 //               groupWidget->walkThrough(this->readFileText, &varInfo, 0);
    339 //               sprintf(Variable, "");
    340 //             }
    341 //           sprintf(Variable, "%s", Buffer);
    342 //         }
    343 //       widget->walkThrough(widget->setOptions, 0);
    344 //     }
    345 //     fclose(this->CONFIG_FILE);
    346290}
    347291
Note: See TracChangeset for help on using the changeset viewer.