Changeset 7632 in orxonox.OLD for branches/qt_gui/src/lib/gui
- Timestamp:
- May 17, 2006, 9:23:45 AM (19 years ago)
- Location:
- branches/qt_gui/src/lib/gui
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/qt_gui/src/lib/gui/gui_saveable.cc
r7630 r7632 26 26 * standard constructor 27 27 */ 28 Saveable::Saveable (const std::string& optionName, SaveableGroup* group )28 Saveable::Saveable (const std::string& optionName, SaveableGroup* group, const MultiType& defaultValue) 29 29 : BaseObject(optionName) 30 30 { 31 31 this->bSaveable = false; 32 this->_defaultValue = defaultValue; 32 33 33 34 assert(group != NULL); -
branches/qt_gui/src/lib/gui/gui_saveable.h
r7608 r7632 33 33 34 34 protected: 35 Saveable(const std::string& optionName, SaveableGroup* group );35 Saveable(const std::string& optionName, SaveableGroup* group, const MultiType& defaultValue); 36 36 virtual void makingElementSaveable() {}; 37 37 … … 39 39 SaveableGroup* group; 40 40 MultiType _value; 41 MultiType _defaultValue; 41 42 bool bSaveable; 42 43 }; -
branches/qt_gui/src/lib/gui/qt_gui/gui_audio.cc
r7608 r7632 51 51 QLabel* soundCardLabel = new QLabel("Soundcard"); 52 52 layout->addWidget(soundCardLabel, 1,1); 53 QtGuiComboBox* soundCard = new QtGuiComboBox(CONFIG_NAME_SOUNDCARD, this );53 QtGuiComboBox* soundCard = new QtGuiComboBox(CONFIG_NAME_SOUNDCARD, this, ""); 54 54 layout->addWidget(soundCard, 2, 1); 55 55 56 56 57 QtGuiSlider* channels = new QtGuiSlider(CONFIG_NAME_AUDIO_CHANNELS, this, Qt::Vertical);57 QtGuiSlider* channels = new QtGuiSlider(CONFIG_NAME_AUDIO_CHANNELS, this, 16, Qt::Vertical); 58 58 layout->addWidget(channels, 0, 0, 2, 1); 59 59 QLabel* channelsLabel = new QLabel("Channels"); … … 66 66 QLabel* musicLabel = new QLabel("Music Volume"); 67 67 layout->addWidget(musicLabel, 0, 2); 68 QtGuiSlider* musicVolume = new QtGuiSlider(CONFIG_NAME_MUSIC_VOLUME, this );68 QtGuiSlider* musicVolume = new QtGuiSlider(CONFIG_NAME_MUSIC_VOLUME, this, 80); 69 69 layout->addWidget(musicVolume, 1, 2); 70 70 … … 72 72 QLabel* effectsLabel = new QLabel("Effects Volume"); 73 73 layout->addWidget(effectsLabel, 2,2); 74 QtGuiSlider* effectVolume = new QtGuiSlider(CONFIG_NAME_EFFECTS_VOLUME, this );74 QtGuiSlider* effectVolume = new QtGuiSlider(CONFIG_NAME_EFFECTS_VOLUME, this, 80); 75 75 layout->addWidget(effectVolume, 3, 2); 76 76 } -
branches/qt_gui/src/lib/gui/qt_gui/gui_general.cc
r7608 r7632 47 47 QLabel* dataDirLabel = new QLabel("DataDirectory"); 48 48 layout->addWidget(dataDirLabel, 0,0); 49 this->dataDir = new QtGuiInputLine(CONFIG_NAME_DATADIR, this );49 this->dataDir = new QtGuiInputLine(CONFIG_NAME_DATADIR, this, DEFAULT_DATA_DIR); 50 50 layout->addWidget(dataDir, 0, 1, 1, 2); 51 51 QPushButton* dataFileDialogButton = new QPushButton("browse"); … … 56 56 QLabel* debugLabel = new QLabel("debug-mode"); 57 57 layout->addWidget(debugLabel, 1,0); 58 QtGuiComboBox* debug = new QtGuiComboBox(CONFIG_NAME_DEBUG_LEVEL, this );58 QtGuiComboBox* debug = new QtGuiComboBox(CONFIG_NAME_DEBUG_LEVEL, this, "3 - information"); 59 59 layout->addWidget(debug, 1, 1, 1, 2); 60 60 -
branches/qt_gui/src/lib/gui/qt_gui/gui_video.cc
r7608 r7632 44 44 45 45 { 46 QtGuiCheckBox* fullscreen = new QtGuiCheckBox(CONFIG_NAME_FULLSCREEN, this );46 QtGuiCheckBox* fullscreen = new QtGuiCheckBox(CONFIG_NAME_FULLSCREEN, this, false); 47 47 //fullscreen->setName(); 48 48 layout->addWidget(fullscreen, 0, 0); 49 49 50 QtGuiCheckBox* wireframe = new QtGuiCheckBox(CONFIG_NAME_WIREFRAME, this );50 QtGuiCheckBox* wireframe = new QtGuiCheckBox(CONFIG_NAME_WIREFRAME, this, false); 51 51 layout->addWidget(wireframe, 1, 0); 52 52 53 53 { 54 QComboBox* resolution = new QtGuiComboBox(CONFIG_NAME_RESOLUTION, this );54 QComboBox* resolution = new QtGuiComboBox(CONFIG_NAME_RESOLUTION, this, "640x480"); 55 55 layout->addWidget(resolution, 2, 0); 56 56 std::vector<QString> resolutions; -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui.cc
r7608 r7632 81 81 QtGui::~QtGui() 82 82 { 83 this->saveAll();84 85 83 delete this->mainWindow; 86 84 } -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc
r7608 r7632 24 24 25 25 QtGuiCheckBox::QtGuiCheckBox(const std::string& name, SaveableGroup* group, bool defaultValue) 26 : QCheckBox(QString().fromStdString(name)), Saveable(name, group )26 : QCheckBox(QString().fromStdString(name)), Saveable(name, group, defaultValue) 27 27 { 28 28 //this->load(this->value()); … … 50 50 51 51 52 QtGuiSlider::QtGuiSlider(const std::string& name, SaveableGroup* group, Qt::Orientation orientation)53 : QSlider(orientation), Saveable(name, group )52 QtGuiSlider::QtGuiSlider(const std::string& name, SaveableGroup* group, int defaultValue, Qt::Orientation orientation) 53 : QSlider(orientation), Saveable(name, group, defaultValue) 54 54 { 55 55 … … 77 77 78 78 79 QtGuiComboBox::QtGuiComboBox(const std::string& name, SaveableGroup* group )80 : QComboBox(), Saveable(name, group )79 QtGuiComboBox::QtGuiComboBox(const std::string& name, SaveableGroup* group, const std::string& defaultValue) 80 : QComboBox(), Saveable(name, group, defaultValue) 81 81 { 82 82 … … 97 97 98 98 99 QtGuiInputLine::QtGuiInputLine(const std::string& name, SaveableGroup* group )100 : QLineEdit(), Saveable(name, group )99 QtGuiInputLine::QtGuiInputLine(const std::string& name, SaveableGroup* group, const std::string& defaultValue) 100 : QLineEdit(), Saveable(name, group, defaultValue) 101 101 { 102 102 -
branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.h
r7608 r7632 48 48 49 49 public: 50 QtGuiSlider(const std::string& name, SaveableGroup* group, Qt::Orientation orientation = Qt::Horizontal);50 QtGuiSlider(const std::string& name, SaveableGroup* group, int defaultValue = 0, Qt::Orientation orientation = Qt::Horizontal); 51 51 virtual ~QtGuiSlider(); 52 52 … … 67 67 68 68 public: 69 QtGuiComboBox(const std::string& name, SaveableGroup* group );69 QtGuiComboBox(const std::string& name, SaveableGroup* group, const std::string& defaultValue); 70 70 71 71 virtual void load(); … … 78 78 79 79 public: 80 QtGuiInputLine(const std::string& name, SaveableGroup* group );80 QtGuiInputLine(const std::string& name, SaveableGroup* group, const std::string& defaultValue); 81 81 82 82 virtual void load();
Note: See TracChangeset
for help on using the changeset viewer.