WQt4Gui.cpp 2.52 KB
Newer Older
1 2
//---------------------------------------------------------------------------
//
3
// Project: OpenWalnut ( http://www.openwalnut.org )
4
//
5 6
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
7
//
wiebel's avatar
wiebel committed
8
// This file is part of OpenWalnut.
9
//
wiebel's avatar
wiebel committed
10
// OpenWalnut is free software: you can redistribute it and/or modify
11 12 13 14
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
wiebel's avatar
wiebel committed
15
// OpenWalnut is distributed in the hope that it will be useful,
16 17 18 19 20
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
wiebel's avatar
wiebel committed
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
22 23 24
//
//---------------------------------------------------------------------------

ebaum's avatar
ebaum committed
25
#include <iostream>
26 27
#include <string>
#include <vector>
28

29
#include <QtGui/QApplication>
30 31 32
#include <QtGui/QFileDialog>

#include "WMainWindow.h"
33

34
#include "WQt4Gui.h"
ebaum's avatar
ebaum committed
35

36
WQt4Gui::WQt4Gui():
37
    WGUI()
ebaum's avatar
ebaum committed
38
{
39
    m_isInitialized = false;
ebaum's avatar
ebaum committed
40 41
}

42
WQt4Gui::~WQt4Gui()
43
{
ebaum's avatar
ebaum committed
44 45
}

46
void WQt4Gui::threadMain()
ebaum's avatar
ebaum committed
47 48
{
    // TODO(ebaum): currently removed argument stuff. will be done later in conjunction with a better
49 50 51 52 53 54
    // option handler.+
#ifdef __APPLE__
    char * dummy = "";
    int dummyInt = 0;
    QApplication appl( dummyInt, &dummy, 0 );
#else
ebaum's avatar
ebaum committed
55
    QApplication appl( 0, NULL );
56
#endif
57 58 59 60 61 62
    QMainWindow* mainWindow = new QMainWindow;
    m_gui = new WMainWindow;
    m_gui->setupGUI( mainWindow );
    mainWindow->show();

    m_isInitialized = true;
63 64 65

    int qtExecResult;
    qtExecResult = appl.exec();
ebaum's avatar
ebaum committed
66

67

ebaum's avatar
ebaum committed
68
    // TODO(ebaum): how to handle return codes?
69 70
}

71 72 73 74
void WQt4Gui::createMainWindow()
{
}

75
void WQt4Gui::addDatasetToBrowser( boost::shared_ptr< WModule > module, int subjectId )
76
{
77
    m_gui->getDatasetBrowser()->addDataset( module, subjectId );
78 79
}

80 81 82 83
std::vector< boost::shared_ptr< WModule > >WQt4Gui::getDataSetList( int subjectId )
{
    return m_gui->getDatasetBrowser()->getDataSetList( subjectId );
}
84

85 86 87 88 89 90 91 92 93 94
bool WQt4Gui::isInitalized()
{
    return m_isInitialized;
}

boost::signal1< void, std::vector< std::string > >* WQt4Gui::getLoadButtonSignal()
{
    return m_gui->getLoaderSignal();
}

95
void WQt4Gui::connectProperties( boost::shared_ptr<WProperties> properties )
96
{
97
    m_gui->getPropertyManager()->connectProperties( properties );
98
}