Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8749 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Jun 23, 2006, 5:08:04 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: fallback test for ORXONOX-data-directory

Location:
trunk/src
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/qt/Makefile.am

    r8145 r8749  
    2525                gui_general_moc.cc \
    2626                gui_control.cc \
    27                 gui_control_moc.cc
     27                gui_control_moc.cc \
     28                \
     29                qt_gui_datadir_fallback.cc \
     30                qt_gui_datadir_fallback_moc.cc
     31
    2832
    2933
     
    3640                gui_audio.h \
    3741                gui_general.h \
    38                 gui_control.h
     42                gui_control.h \
     43                \
     44                qt_gui_datadir_fallback.cc
    3945
    4046
  • trunk/src/lib/gui/qt/qt_gui_datadir_fallback.cc

    r8746 r8749  
    1616//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
    1717
    18 #include "qt_gui.h"
     18#include "qt_gui_datadir_fallback.h"
    1919
    2020#include <QtGui/QApplication>
     
    3434namespace OrxGui
    3535{
    36   QtGui::QtGui(int argc, char** argv)
     36  QtGuiDataDirFallback::QtGuiDataDirFallback(int argc, char** argv)
    3737  : QApplication(argc, argv)
    3838  {
     
    5050      mainLayout->addWidget(bannerWidget, 0,0, 3, 1);
    5151
    52 
    53       QToolBox* toolBox = new QToolBox(groupBox);
    54       {
    55         toolBox->addItem(new GuiGeneral(this), "General");
    56         toolBox->addItem(new GuiVideo(this), "Video");
    57         toolBox->addItem(new GuiAudio(this), "Audio");
    58         toolBox->addItem(new GuiControl(this), "Control");
    59       }
    60       mainLayout->addWidget(toolBox,1,1, 1, 3);
    61 
     52      mainLayout->addWidget(new GuiGeneral(this), 1, 1, 1, 3);
    6253
    6354      QPushButton* start = new QPushButton("start");
     
    8172  }
    8273
    83   QtGui::~QtGui()
     74  QtGuiDataDirFallback::~QtGuiDataDirFallback()
    8475  {
    8576    delete this->mainWindow;
    8677  }
    8778
    88   void QtGui::startGui()
     79  void QtGuiDataDirFallback::startGui()
    8980  {
    9081  }
    9182
    92   void QtGui::stopGui()
     83  void QtGuiDataDirFallback::stopGui()
    9384  {}
    9485
    95   void QtGui::suspend()
     86  void QtGuiDataDirFallback::suspend()
    9687  {}
    9788
    9889    //! Update the Gui.
    99   void QtGui::update()
     90  void QtGuiDataDirFallback::update()
    10091  {
    10192    this->processEvents();
     
    10394
    10495
    105   void QtGui::quitApp()
     96  void QtGuiDataDirFallback::quitApp()
    10697  {
    10798    Gui::quitEvent();
     
    109100  }
    110101
    111   void QtGui::startApp()
     102  void QtGuiDataDirFallback::startApp()
    112103  {
    113104    Gui::startEvent();
  • trunk/src/lib/gui/qt/qt_gui_datadir_fallback.h

    r8746 r8749  
    11/*!
    2  * @file qt_gui.h
     2 * @file qt_gui_datadir_fallback.h
    33 * @brief Definition of ...
    44*/
    55
    6 #ifndef __QT_GUI_H
    7 #define __QT_GUI_H
     6#ifndef __QT_GUI_DATADIR_FALLBACK_H
     7#define __QT_GUI_DATADIR_FALLBACK_H
    88
    99#include "../gui.h"
     
    1414namespace OrxGui
    1515{
    16   class QtGui : public QApplication, public OrxGui::Gui
     16  class QtGuiDataDirFallback : public QApplication, public OrxGui::Gui
    1717  {
    1818    Q_OBJECT
    1919    public:
    20       QtGui(int argc, char** argv);
    21       virtual ~QtGui();
     20      QtGuiDataDirFallback(int argc, char** argv);
     21      virtual ~QtGuiDataDirFallback();
    2222
    2323    //! Start the Gui
     
    4040}
    4141
    42 #endif /* __QT_GUI_H */
     42#endif /* __QT_GUI_DATADIR_FALLBACK_H */
  • trunk/src/orxonox.cc

    r8623 r8749  
    3131
    3232#include "gui/qt/qt_gui.h"
     33#include "gui/qt/qt_gui_datadir_fallback.h"
    3334
    3435#include "parser/ini_parser/ini_parser.h"
     
    227228  // initialize everything
    228229  SDL_Init(0);
     230  if( initVideo() == -1)
     231    return -1;
    229232  if( initResources () == -1)
    230     return -1;
    231   if( initVideo() == -1)
    232233    return -1;
    233234  if( initSound() == -1)
     
    286287  PRINT(3)("> Initializing input\n");
    287288
    288   EventHandler::getInstance()->
    289289  EventHandler::getInstance()->init();
    290290  EventHandler::getInstance()->subscribe(GraphicsEngine::getInstance(), ES_ALL, EV_VIDEO_RESIZE);
     
    336336  }
    337337
    338   if (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
    339   {
     338
     339  while (!ResourceManager::getInstance()->verifyDataDir(DEFAULT_DATA_DIR_CHECKFILE))
     340  {
     341
    340342    PRINTF(1)("The DataDirectory %s could not be verified\n\nh" \
    341343              "!!!  Please Change in File %s Section %s Entry %s to a suitable value !!!\n",
     
    344346              CONFIG_SECTION_GENERAL,
    345347              CONFIG_NAME_DATADIR );
    346     OrxGui::Gui* gui = new OrxGui::QtGui(argc, argv);
     348    OrxGui::Gui* gui = new OrxGui::QtGuiDataDirFallback(argc, argv);
    347349    gui->startGui();
    348350    delete gui;
    349     exit(-1);
    350   }
     351    ResourceManager::getInstance()->setDataDir(Preferences::getInstance()->getString(CONFIG_SECTION_GENERAL, CONFIG_NAME_DATADIR, ""));
     352
     353  }
     354
     355
    351356  //! @todo this is a hack and should be loadable
    352357  std::string imageDir = ResourceManager::getInstance()->getFullName("maps");
     
    356361
    357362  //  DynamicLoader::loadDyLib("libtest.so");
     363  return 0;
     364}
     365
     366/**
     367 * initializes miscelaneous features
     368 * @return -1 on failure
     369 */
     370int Orxonox::initMisc()
     371{
     372  OrxShell::ShellBuffer::getInstance();
    358373
    359374  // start the collision detection engine
    360375  CDEngine::getInstance();
    361   return 0;
    362 }
    363 
    364 /**
    365  * initializes miscelaneous features
    366  * @return -1 on failure
    367  */
    368 int Orxonox::initMisc()
    369 {
    370   OrxShell::ShellBuffer::getInstance();
     376
    371377  return 0;
    372378}
Note: See TracChangeset for help on using the changeset viewer.