Changeset 4083 in orxonox.OLD for orxonox/trunk/src/lib/gui/gui/gui_update.cc
- Timestamp:
- May 6, 2005, 2:53:28 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/gui/gui/gui_update.cc
r4068 r4083 40 40 Button* dataDirButton; //!< A Button for the selection of the DataRepos 41 41 OptionLabel* dataDirLabel; //!< A Label fot the selection of the DataRepos 42 42 43 43 44 this->tmpDir = NULL; … … 51 52 this->updateFrame->setGroupName("update"); 52 53 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 53 69 #ifdef HAVE_CURL 54 70 … … 60 76 61 77 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);71 78 72 79 … … 78 85 79 86 #else /* HAVE_CURL */ 80 Label* noCurlLabel = new Label("since you do not have cURL ,\nthis option isnot availible");87 Label* noCurlLabel = new Label("since you do not have cURL-support,\nupdate options are not availible"); 81 88 this->updateBox->fill(noCurlLabel); 82 89 #endif /* HAVE_CURL */ … … 94 101 95 102 } 103 104 /** 105 \brief checks if the Folder containing selected File is data.oxd, and if so sets it. 106 \param 107 */ 108 bool 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 96 123 97 124 /**
Note: See TracChangeset
for help on using the changeset viewer.