Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7601 in orxonox.OLD


Ignore:
Timestamp:
May 12, 2006, 8:58:20 AM (18 years ago)
Author:
bensch
Message:

orxonox/qt_gui: QtGuiComboBox saveable

Location:
branches/qt_gui/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/qt_gui/src/defs/globals.h

    r7599 r7601  
    3838#define   CONFIG_SECTION_VIDEO_ADVANCED    "video_advanced"
    3939#define   CONFIG_SECTION_AUDIO             "audio"
    40 #define   CONFIG_SECTION_EXEC              "exec"
    41 #define   CONFIG_SECTION_DATA              "data"
     40#define   CONFIG_SECTION_GENERAL           "data"
    4241
    4342/*
     
    7069#define   CONFIG_NAME_VERBOSE_MODE         "Verbose-Mode"
    7170#define   CONFIG_NAME_ALWAYS_SHOW_GUI      "Always-Show-The-Gui"
     71#define   CONFIG_NAME_DEBUG_LEVEL          "Debug-Level"
     72
    7273// evenets
    7374#define   CONFIG_NAME_PLAYER_FORWARD       "Forward"
  • branches/qt_gui/src/lib/gui/gtk_gui/gui_update.cc

    r5766 r7601  
    5151
    5252  this->updateFrame = new Frame("Update-Options:");
    53   this->updateFrame->setGroupName(CONFIG_SECTION_DATA);
     53  this->updateFrame->setGroupName(CONFIG_SECTION_GENERAL);
    5454  this->updateBox = new Box('v');
    5555
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.cc

    r7595 r7601  
    3131
    3232#include "debug.h"
     33#include "globals.h"
    3334
    3435#include "qt_gui_elements.h"
     
    4041  */
    4142  GuiGeneral::GuiGeneral(OrxGui::Gui* gui)
    42   : Element("General", gui), QGroupBox()
     43  : Element(CONFIG_SECTION_GENERAL, gui), QGroupBox()
    4344  {
    4445    QGridLayout* layout = new QGridLayout(this);
     
    4647      QLabel* dataDirLabel = new QLabel("DataDirectory");
    4748      layout->addWidget(dataDirLabel, 0,0);
    48       QtGuiInputLine* dataDir = new QtGuiInputLine("Data-Directory", this);
     49      QtGuiInputLine* dataDir = new QtGuiInputLine(CONFIG_NAME_DATADIR, this);
    4950      layout->addWidget(dataDir, 0, 1, 1, 2);
    5051      QPushButton* dataFileDialogButton = new QPushButton("browse");
     
    5657      QLabel* debugLabel = new QLabel("debug-mode");
    5758      layout->addWidget(debugLabel, 1,0);
    58       QtGuiComboBox* debug = new QtGuiComboBox("debug", this);
     59      QtGuiComboBox* debug = new QtGuiComboBox(CONFIG_NAME_DEBUG_LEVEL, this);
    5960      layout->addWidget(debug, 1, 1, 1, 2);
    6061
  • branches/qt_gui/src/lib/gui/qt_gui/gui_video.cc

    r7598 r7601  
    5252
    5353      {
    54         QComboBox* resolution = new QComboBox();
     54        QComboBox* resolution = new QtGuiComboBox(CONFIG_NAME_RESOLUTION, this);
    5555        layout->addWidget(resolution, 2, 0);
    5656        std::vector<QString> resolutions;
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc

    r7599 r7601  
    8686  void QtGuiComboBox::load()
    8787  {
    88     //TODO
     88    Saveable::load();
     89    this->setCurrentIndex(this->findText(QString().fromStdString(this->value().getString())));
    8990  }
    9091
    9192  void QtGuiComboBox::save()
    9293  {
     94    this->value() = this->currentText().toStdString();
     95    Saveable::save();
    9396  }
    9497
  • branches/qt_gui/src/orxonox.cc

    r7595 r7601  
    314314  // init the resource manager
    315315  std::string dataPath;
    316   if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_DATA, CONFIG_NAME_DATADIR, ""))!= "")
     316  if ((dataPath = Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""))!= "")
    317317  {
    318318    if (!ResourceManager::getInstance()->setDataDir(dataPath) &&
     
    329329    ResourceManager::getInstance()->getDataDir().c_str(),
    330330    this->configFileName.c_str(),
    331               CONFIG_SECTION_DATA,
     331              CONFIG_SECTION_GENERAL,
    332332              CONFIG_NAME_DATADIR );
    333333    OrxGui::Gui* gui = new OrxGui::QtGui(argc, argv);
Note: See TracChangeset for help on using the changeset viewer.