Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 26, 2004, 8:06:06 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/updater: parsing argv's works now. But no events can be handled, like gui-quit, autoupdate and so on.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/updater/src/gui/orxonox_gui_gtk.cc

    r3294 r3295  
    207207  if (widget->isOption >= 1)
    208208    static_cast<Option*>(widget)->redraw();
     209}
     210
     211/**
     212   \brief Walks through all the Flags given at startuptime.
     213*/
     214void Widget::flagCheck(Widget* widget, void* flagName)
     215{
     216  if (widget->isOption>=1)
     217    {     
     218      Option* option = (Option*)widget;
     219      char* name = (char*)flagName;
     220      char* value = NULL;
     221      bool found = false;
     222      // check if long flag matches
     223      if ((option->flagName && strlen(name)>2 && !strncmp(name+2, option->flagName, strlen(option->flagName)) && (name[strlen(option->flagName)+2] == '\0' || name[strlen(option->flagName)+2] == '=') ))
     224        {
     225          found = true;
     226          if (name[strlen(option->flagName)+2] == '=')
     227            {
     228              value = name+strlen(option->flagName)+3;
     229            }
     230        }
     231      else if (option->flagNameShort && strlen(name)>1 && !strncmp(name+1, option->flagNameShort, strlen(option->flagNameShort))&& (name[strlen(option->flagNameShort)+1] == '\0' || name[strlen(option->flagNameShort)+1] == '=')) // check if short flag matches
     232        {
     233          found = true;
     234          if (name[strlen(option->flagNameShort)+1] == '=')
     235            {
     236              value = name+strlen(option->flagNameShort)+2;
     237            }     
     238        }
     239
     240      if (found)
     241        {
     242          PRINT(3)("found matching Flag %s\n", name);
     243          if (value)
     244            {
     245              PRINT(3)("with Value %s\n", value);
     246              option->value = atoi(value);
     247            }
     248          else
     249            {
     250              option->value = !option->defaultValue;
     251            }
     252          option->redraw();
     253        }
     254
     255    }
    209256}
    210257
Note: See TracChangeset for help on using the changeset viewer.