Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/gui/qt/qt_gui_datadir_fallback.cc @ 10182

Last change on this file since 10182 was 8750, checked in by bensch, 18 years ago

orxonox/trunk: now one can also close orxonox when the datadir is not found by the user

File size: 2.6 KB
RevLine 
[4744]1/*
[1853]2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
[1855]10
11   ### File Specific:
[7149]12   main-programmer: Benjamin Grauer
[1855]13   co-programmer: ...
[1853]14*/
15
[3955]16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
[1853]17
[8749]18#include "qt_gui_datadir_fallback.h"
[1853]19
[7534]20#include <QtGui/QApplication>
21#include <QtGui/QToolBox>
22#include <QtGui/QGridLayout>
[7478]23
[7542]24#include "qt_gui_elements.h"
[7636]25#include "q_image_widget.h"
26
[7855]27#include "gui_general.h"
[7484]28#include "gui_video.h"
[7495]29#include "gui_audio.h"
[7636]30#include "gui_control.h"
31
[7594]32#include "banner.xpm"
[7484]33
[7447]34namespace OrxGui
35{
[8749]36  QtGuiDataDirFallback::QtGuiDataDirFallback(int argc, char** argv)
[7478]37  : QApplication(argc, argv)
[7473]38  {
[1853]39
[7479]40    this->mainWindow = new QMainWindow();
[7594]41    this->mainWindow->setMinimumSize(500, 200);
[7480]42
[7493]43    QGroupBox* groupBox = new QGroupBox(this->mainWindow);
[7480]44    QGridLayout* mainLayout = new QGridLayout(groupBox);
[7484]45    {
[7594]46      QImageWidget* bannerWidget = new QImageWidget();
47      QImage bannerImage(banner_xpm);
48      bannerImage.save("test.bmp", "bmp");
49      bannerWidget->setImage(bannerImage);
50      mainLayout->addWidget(bannerWidget, 0,0, 3, 1);
51
[8750]52      QLabel* label = new QLabel();
53      label->setText("ORXONOX needs its DataDirectory to be configured.\n Just Select the ORXONOX-dataDirectory with the browse-button, and start the Game\n");
54
55      mainLayout->addWidget(label, 0,1);
56
[8749]57      mainLayout->addWidget(new GuiGeneral(this), 1, 1, 1, 3);
[7594]58
[7548]59      QPushButton* start = new QPushButton("start");
60      connect(start, SIGNAL(released()), this, SLOT(startApp()));
61      mainLayout->addWidget(start, 2,2);
62
[7542]63      QPushButton* quit = new QPushButton("quit");
[7548]64      connect(quit, SIGNAL(released()), this, SLOT(quitApp()));
65      mainLayout->addWidget(quit, 2,3);
[7542]66
[7484]67    }
[7480]68
[7555]69    connect(this->mainWindow, SIGNAL(destroyed()), this, SLOT(quitApp()));
[7480]70    this->mainWindow->setCentralWidget(groupBox);
[7479]71    this->mainWindow->show();
[7447]72
[7598]73    this->loadAll();
[7479]74    this->exec();
[7604]75    this->saveAll();
76
[7473]77  }
[7478]78
[8749]79  QtGuiDataDirFallback::~QtGuiDataDirFallback()
[7473]80  {
[7480]81    delete this->mainWindow;
[7473]82  }
83
[8749]84  void QtGuiDataDirFallback::startGui()
[7598]85  {
86  }
[7473]87
[8749]88  void QtGuiDataDirFallback::stopGui()
[7473]89  {}
90
[8749]91  void QtGuiDataDirFallback::suspend()
[7473]92  {}
93
94    //! Update the Gui.
[8749]95  void QtGuiDataDirFallback::update()
[7478]96  {
97    this->processEvents();
98  }
[7473]99
[7548]100
[8749]101  void QtGuiDataDirFallback::quitApp()
[7548]102  {
103    Gui::quitEvent();
104    this->quit();
105  }
[7549]106
[8749]107  void QtGuiDataDirFallback::startApp()
[7548]108  {
109    Gui::startEvent();
110    this->quit();
111  }
112
[7447]113}
Note: See TracBrowser for help on using the repository browser.