1
/** This file is part of the KDE project
3
* Copyright (C) 2011 Adam Pigg <adam@piggz.co.uk>
5
* This library is free software; you can redistribute it and/or
6
* modify it under the terms of the GNU Library General Public
7
* License as published by the Free Software Foundation; either
8
* version 2 of the License, or (at your option) any later version.
10
* This library is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
* Library General Public License for more details.
15
* You should have received a copy of the GNU Library General Public License
16
* along with this library; see the file COPYING.LIB. If not, write to
17
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#include "KexiMobileWidget.h"
22
#include "KexiMobileNavigator.h"
24
#include <core/KexiWindow.h>
28
KexiMobileWidget::KexiMobileWidget(KexiProject* p) : m_project(p), m_navWidget(0), m_objectPage(0)
30
m_navWidget = new KexiMobileNavigator();
31
addWidget(m_navWidget);
32
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
35
KexiMobileWidget::~KexiMobileWidget()
40
KexiMobileNavigator* KexiMobileWidget::navigator()
45
void KexiMobileWidget::showNavigator()
47
if (currentWidget() != m_navWidget) {
48
setCurrentWidget(m_navWidget);
53
void KexiMobileWidget::databaseOpened(KexiProject *project)
56
if (project && (project->open() == true)) {
57
m_navWidget->setProject(project);
58
qDebug() << "Project opened";
60
qWarning() << "Project not opened";
62
qWarning() << project->errorMsg();
66
setCurrentWidget(m_navWidget);
69
KexiWindow* KexiMobileWidget::activeObject()
74
void KexiMobileWidget::setActiveObject(KexiWindow* win)
76
removeWidget(m_objectPage);
78
if (win != m_objectPage) {
83
addWidget(m_objectPage);
85
setCurrentWidget(m_objectPage);