Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4083 in orxonox.OLD for orxonox/trunk/src/lib/gui/gui/gui_update.cc


Ignore:
Timestamp:
May 6, 2005, 2:53:28 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk/gui: now one can only select the data-repos

File:
1 edited

Legend:

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

    r4068 r4083  
    4040  Button* dataDirButton;       //!< A Button for the selection of the DataRepos
    4141  OptionLabel* dataDirLabel;   //!< A Label fot the selection of the DataRepos
     42 
    4243
    4344  this->tmpDir = NULL;
     
    5152  this->updateFrame->setGroupName("update");
    5253  this->updateBox = new Box('v');
     54
     55  dataDirButton = new Button("Data Directory");
     56  dataDirLabel = new OptionLabel("DataDir", "unknown");
     57  dataDirLabel->saveability();
     58  dataDirDialog = new FileDialog("data-Repos-location");
     59  dataDirDialog->setDefaultFileName("data");
     60  dataDirDialog->setMask(DATA_IDENTIFIER);
     61  this->checkDataDir("../data/" DATA_IDENTIFIER, dataDirLabel);
     62  dataDirDialog->disableFileOpts();
     63  dataDirDialog->setOpenUpButton(dataDirButton);
     64  //dataDirDialog->setChangeOption(dataDirLabel);
     65  dataDirDialog->setOKFunc(dataDirLabel, GuiUpdate::checkDataDir);
     66  updateBox->fill(dataDirButton);
     67  updateBox->fill(dataDirLabel);
     68
    5369#ifdef HAVE_CURL
    5470
     
    6076
    6177 
    62   dataDirButton = new Button("browse");
    63   dataDirLabel = new OptionLabel("DataDir", "test");
    64   dataDirLabel->saveability();
    65   dataDirDialog = new FileDialog("data-Repos-location");
    66   dataDirDialog->setDefaultFileName("../data");
    67   dataDirDialog->setOpenUpButton(dataDirButton);
    68   dataDirDialog->setChangeOption(dataDirLabel);
    69   updateBox->fill(dataDirLabel);
    70   updateBox->fill(dataDirButton);
    7178
    7279
     
    7885
    7986#else /* HAVE_CURL */
    80   Label* noCurlLabel = new Label("since you do not have cURL,\nthis option is not availible");
     87  Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible");
    8188  this->updateBox->fill(noCurlLabel); 
    8289#endif /* HAVE_CURL */
     
    94101
    95102}
     103
     104/**
     105   \brief checks if the Folder containing selected File is data.oxd, and if so sets it.
     106   \param
     107*/
     108bool GuiUpdate::checkDataDir(const char* fileName, void* object)
     109{
     110  if (!strcmp(fileName+(strlen(fileName)-strlen(DATA_IDENTIFIER)), DATA_IDENTIFIER))
     111    {
     112      char* tmpName = new char[strlen(fileName)-strlen(DATA_IDENTIFIER)+1];
     113      strncpy(tmpName, fileName, strlen(fileName)-strlen(DATA_IDENTIFIER));
     114      tmpName[strlen(fileName)-strlen(DATA_IDENTIFIER)] = '\0';
     115      static_cast<OptionLabel*>(object)->setValue(tmpName);
     116      delete tmpName;
     117      return true;
     118    }
     119  else
     120    return false;
     121}
     122
    96123
    97124/**
Note: See TracChangeset for help on using the changeset viewer.