Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7603 in orxonox.OLD for branches/qt_gui


Ignore:
Timestamp:
May 12, 2006, 9:14:47 AM (19 years ago)
Author:
bensch
Message:

DataDirectory-selection works

Location:
branches/qt_gui/src
Files:
4 edited

Legend:

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

    r7601 r7603  
    3838#define   CONFIG_SECTION_VIDEO_ADVANCED    "video_advanced"
    3939#define   CONFIG_SECTION_AUDIO             "audio"
    40 #define   CONFIG_SECTION_GENERAL           "data"
     40#define   CONFIG_SECTION_GENERAL           "general"
    4141
    4242/*
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.cc

    r7601 r7603  
    4747      QLabel* dataDirLabel = new QLabel("DataDirectory");
    4848      layout->addWidget(dataDirLabel, 0,0);
    49       QtGuiInputLine* dataDir = new QtGuiInputLine(CONFIG_NAME_DATADIR, this);
     49      this->dataDir = new QtGuiInputLine(CONFIG_NAME_DATADIR, this);
    5050      layout->addWidget(dataDir, 0, 1, 1, 2);
    5151      QPushButton* dataFileDialogButton = new QPushButton("browse");
    5252      layout->addWidget(dataFileDialogButton, 0, 3, 1, 1);
    5353      connect(dataFileDialogButton, SIGNAL(released()), this, SLOT(openDataFileDialog()));
    54 
    5554
    5655
     
    8382    "Choose the ORXONOX DATA DIRECTORY",
    8483    ".",
    85     "ORXONOX DATA INDEX (data.oxd)");
     84    "ORXONOX DATA INDEX (" DEFAULT_DATA_DIR_CHECKFILE ")" );
     85
     86    s.remove("data.oxd");
     87    if (!s.isNull())
     88      this->dataDir->setText(s);
    8689  }
    8790
  • branches/qt_gui/src/lib/gui/qt_gui/gui_general.h

    r7593 r7603  
    1111#include <QtGui/QGroupBox>
    1212
     13
    1314namespace OrxGui
    1415{
     16  class QtGuiInputLine;
     17
    1518  //! Class that creates the Audio-Options.
    1619  class GuiGeneral : public QGroupBox, public OrxGui::Element
     
    2225    virtual ~GuiGeneral();
    2326
    24     public slots:
    25       void openDataFileDialog();
     27  public slots:
     28    void openDataFileDialog();
    2629
     30  private:
     31    QtGuiInputLine* dataDir;
    2732  };
    2833}
  • branches/qt_gui/src/lib/gui/qt_gui/qt_gui_elements.cc

    r7601 r7603  
    107107  void QtGuiInputLine::load()
    108108  {
    109     this->setText(this->value().getString().c_str());
     109    Saveable::load();
     110    this->setText(QString().fromStdString(this->value().getString()));
    110111  }
    111112
     
    114115  void QtGuiInputLine::save()
    115116  {
     117    this->value() = this->text().toStdString();
     118    Saveable::save();
    116119  }
    117120
Note: See TracChangeset for help on using the changeset viewer.