Commit 0a1bb5db authored by Pekka Vuorela's avatar Pekka Vuorela

Remove unnecessary MainWindow class

parent 2dbcaed0
......@@ -30,8 +30,7 @@ HEADERS += \
textrender.h \
version.h \
util.h \
keyloader.h \
mainwindow.h
keyloader.h
SOURCES += \
main.cpp \
......@@ -39,8 +38,7 @@ SOURCES += \
textrender.cpp \
ptyiface.cpp \
util.cpp \
keyloader.cpp \
mainwindow.cpp
keyloader.cpp
OTHER_FILES += \
qml/Main.qml \
......
......@@ -21,6 +21,7 @@
#include <QtGui>
#include <QtQml>
#include <QQuickView>
extern "C" {
#include <pty.h>
......@@ -30,7 +31,6 @@ extern "C" {
#include <sys/types.h>
}
#include "mainwindow.h"
#include "ptyiface.h"
#include "terminal.h"
#include "textrender.h"
......@@ -102,7 +102,7 @@ int main(int argc, char *argv[])
}
qmlRegisterType<TextRender>("TextRender",1,0,"TextRender");
MainWindow view;
QQuickView view;
Terminal term;
Util util(settings);
......
/*
Copyright 2011-2012 Heikki Holstila <heikki.holstila@gmail.com>
This file is part of FingerTerm.
FingerTerm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FingerTerm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FingerTerm. If not, see <http://www.gnu.org/licenses/>.
*/
#include "qplatformdefs.h"
#include <QtGui>
#include <QQmlContext>
#include "mainwindow.h"
MainWindow::MainWindow()
{
rootContext()->setContextProperty("windowHasFocus", false);
}
MainWindow::~MainWindow()
{
}
void MainWindow::focusInEvent(QFocusEvent *event)
{
rootContext()->setContextProperty("windowHasFocus", true);
QQuickView::focusInEvent(event);
emit focusChanged(true);
}
void MainWindow::focusOutEvent(QFocusEvent *event)
{
rootContext()->setContextProperty("windowHasFocus", false);
QQuickView::focusOutEvent(event);
emit focusChanged(false);
}
/*
Copyright 2011-2012 Heikki Holstila <heikki.holstila@gmail.com>
This file is part of FingerTerm.
FingerTerm is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
FingerTerm is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with FingerTerm. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QQuickView>
class MainWindow : public QQuickView
{
Q_OBJECT
public:
explicit MainWindow();
virtual ~MainWindow();
protected:
virtual void focusInEvent(QFocusEvent *event);
virtual void focusOutEvent(QFocusEvent *event);
signals:
void focusChanged(bool in);
private:
Q_DISABLE_COPY(MainWindow)
};
#endif // MAINWINDOW_H
......@@ -162,7 +162,7 @@ Item {
property bool visibleSetting: true
x: 0
y: parent.height-vkb.height
visible: windowHasFocus && visibleSetting
visible: page.activeFocus && visibleSetting
}
// area that handles gestures/select/scroll modes and vkb-keypresses
......
......@@ -25,7 +25,6 @@
#include <QQuickView>
#include <QDebug>
#include "mainwindow.h"
#include "terminal.h"
#include "util.h"
#include "textrender.h"
......@@ -52,7 +51,7 @@ Util::~Util()
void Util::setWindow(QQuickView* win)
{
iWindow = dynamic_cast<MainWindow*>(win);
iWindow = win;
if(!iWindow)
qFatal("invalid main window");
}
......
......@@ -23,7 +23,6 @@
#include <QtCore>
class Terminal;
class MainWindow;
class TextRender;
class QQuickView;
......@@ -101,7 +100,7 @@ private:
QString iCurrentWinTitle;
QSettings* iSettings;
MainWindow* iWindow;
QQuickView* iWindow;
Terminal* iTerm;
TextRender* iRenderer;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment