]> pilppa.org Git - vdr-tv-client.git/blob - src/QMLMainWindow.cpp
show full keyboard instead of number-only
[vdr-tv-client.git] / src / QMLMainWindow.cpp
1 /*
2  * vdr-tv-client: TV frontend for watching tv streams from the vdr server.
3  *
4  * Copyright (c) 2011, Mika Laitio. <lamikr@pilppa.org>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19  * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
20  *
21  */
22
23 #include "QMLVDRClient.h"
24 #include "QMLMainWindow.h"
25 #include <QtDeclarative>
26
27 QMLMainWindow::QMLMainWindow()
28 {
29     qmlRegisterType<QMLVDRClient>("com.meego.vdrclient", 1, 0, "VDRClient");
30
31     view = new QDeclarativeView;
32     context = view->rootContext();
33     context->setContextProperty("backgroundColor",
34                                  QColor(Qt::yellow));
35
36     view->setSource(QUrl::fromLocalFile("/usr/share/vdr-tv-client/qml/ServerSelectionMain.qml"));
37     view->show();
38 }
39
40 QMLMainWindow::~QMLMainWindow()
41 {
42     delete(view);
43 }
44
45 QMLMainWindow* QMLMainWindow::instance()
46 {
47     static QMLMainWindow *_instance = NULL;
48
49     qCritical() << "1";
50     if(_instance == NULL)
51     {
52         _instance = new QMLMainWindow;
53     }
54     qCritical() << "2";
55
56     return _instance;
57 }