Commit 4f76e2ed authored by Herrie's avatar Herrie Committed by Pekka Vuorela

Remove legacy platforms

-Remove support for Maemo, Meego, Harmattan & Symbian.
-Allow definition of font for QMake.
Signed-off-by: default avatarHerman van Hazendonk <github.com@herrie.org>
parent ab807739
QT = core gui qml quick dbus feedback
QT = core gui qml quick dbus
CONFIG += link_pkgconfig
PKGCONFIG += nemonotifications-qt5
contains(MEEGO_EDITION,harmattan): {
CONFIG += meegotouch
}
TEMPLATE = app
TARGET = fingerterm
......@@ -13,8 +8,6 @@ DEPENDPATH += .
INCLUDEPATH += .
LIBS += -lutil
system($$PWD/updateversion.sh)
# Input
HEADERS += \
ptyiface.h \
......@@ -23,25 +16,21 @@ HEADERS += \
version.h \
util.h \
keyloader.h \
mainwindow.h \
dbusadaptor.h
SOURCES += main.cpp terminal.cpp textrender.cpp \
mainwindow.h
SOURCES += \
main.cpp \
terminal.cpp \
textrender.cpp \
ptyiface.cpp \
util.cpp \
keyloader.cpp \
mainwindow.cpp \
dbusadaptor.cpp
mainwindow.cpp
OTHER_FILES += \
qml/Main.qml \
qml/Keyboard.qml \
qml/Key.qml \
qml/Lineview.qml \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog \
qml/Button.qml \
qml/MenuFingerterm.qml \
qml/NotifyWin.qml \
......@@ -51,28 +40,11 @@ OTHER_FILES += \
RESOURCES += \
resources.qrc
unix:!symbian:!maemo5 {
target.path = /usr/bin
INSTALLS += target
}
maemo5 {
unix {
target.path = /usr/bin
INSTALLS += target
}
contains(MEEGO_EDITION,harmattan) {
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications
INSTALLS += desktopfile
}
contains(MEEGO_EDITION,harmattan) {
icon.files = fingerterm.png
icon.path = /usr/share/icons/hicolor/80x80/apps
INSTALLS += icon
}
contains(MEEGO_EDITION,nemo) {
desktopfile.extra = cp $${TARGET}.desktop.nemo $${TARGET}.desktop
desktopfile.path = /usr/share/applications
......
......@@ -30,11 +30,6 @@ extern "C" {
#include <sys/types.h>
}
#ifdef MEEGO_EDITION_HARMATTAN
#include <MComponentData>
#include "dbusadaptor.h"
#endif
#include "mainwindow.h"
#include "ptyiface.h"
#include "terminal.h"
......@@ -109,14 +104,6 @@ int main(int argc, char *argv[])
qmlRegisterType<TextRender>("TextRender",1,0,"TextRender");
MainWindow view;
#ifdef MEEGO_EDITION_HARMATTAN
DbusAdaptor *dba = new DbusAdaptor();
dba->setAppWindow(&view);
// needed for MFeedback, also creates the dbus interface
MComponentData::createInstance(argc, argv, "fingerterm", dba);
#endif
Terminal term;
Util util(settings);
term.setUtil(&util);
......@@ -171,9 +158,6 @@ int main(int argc, char *argv[])
QObject::connect(&term,SIGNAL(displayBufferChanged()),win,SLOT(displayBufferChanged()));
QObject::connect(view.engine(),SIGNAL(quit()),&app,SLOT(quit()));
#ifdef MEEGO_EDITION_HARMATTAN
view.showFullScreen();
#else
QSize screenSize = QGuiApplication::primaryScreen()->size();
if ((screenSize.width() < 1024 || screenSize.height() < 768 || app.arguments().contains("-fs"))
&& !app.arguments().contains("-nofs"))
......@@ -181,7 +165,10 @@ int main(int argc, char *argv[])
view.showFullScreen();
} else
view.show();
#endif
#ifdef RESIZE_ROOT_QML_TO_VIEW
view.setResizeMode(QQuickView::SizeRootObjectToView);
#endif
PtyIFace ptyiface(pid, socketM, &term,
settings->value("terminal/charset").toString());
......@@ -213,7 +200,7 @@ void defaultSettings(QSettings* settings)
if(!settings->contains("ui/keyboardLayout"))
settings->setValue("ui/keyboardLayout", "english");
if(!settings->contains("ui/fontFamily"))
settings->setValue("ui/fontFamily", "monospace");
settings->setValue("ui/fontFamily", DEFAULT_FINGERTERM_FONTFAMILY);
if(!settings->contains("ui/fontSize"))
settings->setValue("ui/fontSize", 11);
if(!settings->contains("ui/keyboardMargins"))
......
......@@ -23,14 +23,6 @@
#include <QQmlContext>
#include "mainwindow.h"
#ifdef MEEGO_EDITION_HARMATTAN
#include <MApplication>
#include <MNotification>
#include <QX11Info>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#endif //MEEGO_EDITION_HARMATTAN
MainWindow::MainWindow()
{
rootContext()->setContextProperty("windowHasFocus", false);
......@@ -58,38 +50,3 @@ void MainWindow::minimize()
{
setWindowState(Qt::WindowMinimized);
}
void MainWindow::disableSwipe()
{
#ifdef MEEGO_EDITION_HARMATTAN
resize(MApplication::desktop()->screenGeometry().width(),
MApplication::desktop()->screenGeometry().height());
showFullScreen();
unsigned int customRegion[] =
{
rect().x(),
rect().y(),
rect().width(),
rect().height()
};
Display *dpy = QX11Info::display();
Atom customRegionAtom = XInternAtom(dpy, "_MEEGOTOUCH_CUSTOM_REGION", False);
XChangeProperty(dpy, effectiveWinId(), customRegionAtom,
XA_CARDINAL, 32, PropModeReplace,
reinterpret_cast<unsigned char*>(&customRegion[0]), 4);
#endif //MEEGO_EDITION_HARMATTAN
}
void MainWindow::enableSwipe()
{
#ifdef MEEGO_EDITION_HARMATTAN
Display *dpy = QX11Info::display();
Atom customRegionAtom = XInternAtom(dpy, "_MEEGOTOUCH_CUSTOM_REGION", False);
XDeleteProperty(dpy, effectiveWinId(), customRegionAtom);
#endif //MEEGO_EDITION_HARMATTAN
}
......@@ -30,8 +30,6 @@ public:
virtual ~MainWindow();
void minimize();
void enableSwipe();
void disableSwipe();
protected:
virtual void focusInEvent(QFocusEvent *event);
......
......@@ -72,6 +72,7 @@ Rectangle {
opacity: key.labelOpacity * (highlighted ? 1.0 : 0.2)
Behavior on opacity { NumberAnimation { duration: 100 } }
font.family: util.settingsValue("ui/fontFamily");
font.pointSize: (highlighted ? window.fontSizeLarge : window.fontSizeSmall) * (text.length > 1 ? 0.5 : 1.0)
Behavior on font.pointSize { NumberAnimation { duration: 100 } }
}
......@@ -99,6 +100,7 @@ Rectangle {
opacity: key.labelOpacity * (highlighted ? 1.0 : 0.2)
Behavior on opacity { NumberAnimation { duration: 100 } }
font.family: util.settingsValue("ui/fontFamily");
font.pointSize: (highlighted ? window.fontSizeLarge : window.fontSizeSmall) * (text.length > 1 ? 0.5 : 1.0)
Behavior on font.pointSize { NumberAnimation { duration: 100 } }
}
......
......@@ -369,54 +369,6 @@ Rectangle {
}
}
}
Rectangle {
visible: util.isHarmattan()
width: window.buttonWidthLarge
height: window.buttonHeightLarge
radius: window.radiusSmall
color: "#606060"
border.color: "#000000"
border.width: 1
Column {
Text {
width: window.buttonWidthLarge
height: window.headerHeight
color: "#ffffff"
font.pointSize: window.uiFontSize-1
text: "Allow swiping"
horizontalAlignment: Text.AlignHCenter
}
Row {
Button {
text: "No"
width: window.buttonWidthSmall
height: window.buttonHeightSmall
highlighted: currentSwipeLocking=="false"
onClicked: {
changeSwipeLocking("false")
}
}
Button {
text: "Yes"
width: window.buttonWidthSmall
height: window.buttonHeightSmall
highlighted: currentSwipeLocking=="true"
onClicked: {
changeSwipeLocking("true")
}
}
Button {
text: "Auto"
width: window.buttonWidthSmall
height: window.buttonHeightSmall
highlighted: currentSwipeLocking=="auto"
onClicked: {
changeSwipeLocking("auto")
}
}
}
}
}
Button {
text: "New window"
onClicked: {
......@@ -442,7 +394,7 @@ Rectangle {
}
}
Button {
visible: (currentSwipeLocking=="false" && util.isHarmattan()) || !util.isHarmattan();
visible: true;
text: "Minimize"
onClicked: {
hideMenu();
......
......@@ -33,7 +33,7 @@ Provides: meego-terminal > 0.2.2
%build
sed -i 's,/opt/fingerterm/,/usr/,' fingerterm.pro
qmake -qt=5 MEEGO_EDITION=nemo
qmake -qt=5 MEEGO_EDITION=nemo PKGCONFIG+=nemonotifications-qt5 QT+=feedback DEFINES+=HAVE_FEEDBACK DEFINES+=DEFAULT_FINGERTERM_FONTFAMILY=\\\"monospace\\\"
# Inject version number from RPM into source
sed -i -e 's/PROGRAM_VERSION="[^"]*"/PROGRAM_VERSION="%{version}"/g' version.h
make %{?_smp_mflags}
......
......@@ -32,10 +32,8 @@
#include "textrender.h"
#include "version.h"
#ifdef HAVE_FEEDBACK
#include <QFeedbackEffect>
#ifdef MEEGO_EDITION_HARMATTAN
#include <notification.h>
#endif
Util::Util(QSettings *settings, QObject *parent) :
......@@ -96,68 +94,12 @@ void Util::windowMinimize()
void Util::openNewWindow()
{
#ifdef MEEGO_EDITION_HARMATTAN
QDBusInterface iface(MComponentData::instance()->serviceName(),
"/org/maemo/m",
"com.nokia.MApplicationIf");
if (iface.isValid()) {
QStringList params;
params.append("new");
iface.call("launch", params);
}
#else
QProcess::startDetached("/usr/bin/fingerterm");
#endif //MEEGO_EDITION_HARMATTAN
}
void Util::updateSwipeLock(bool suggestedState)
{
#ifdef MEEGO_EDITION_HARMATTAN
if (settingsValue("ui/allowSwipe").toString()=="auto") {
if(suggestedState) {
enableSwipe();
} else {
disableSwipe();
}
} else if (settingsValue("ui/allowSwipe").toString()=="false") {
disableSwipe();
} else if (settingsValue("ui/allowSwipe").toString()=="true") {
enableSwipe();
}
#else
Q_UNUSED(suggestedState)
#endif //MEEGO_EDITION_HARMATTAN
}
void Util::disableSwipe()
{
#ifdef MEEGO_EDITION_HARMATTAN
if(swipeModeSet && !swipeAllowed)
return;
if (iWindow) {
iWindow->disableSwipe();
swipeModeSet = true;
swipeAllowed = false;
}
#endif //MEEGO_EDITION_HARMATTAN
}
void Util::enableSwipe()
{
#ifdef MEEGO_EDITION_HARMATTAN
if(swipeModeSet && swipeAllowed)
return;
if (iWindow)
{
iWindow->enableSwipe();
swipeModeSet = true;
swipeAllowed = true;
}
#endif //MEEGO_EDITION_HARMATTAN
}
QString Util::configPath()
......@@ -190,20 +132,7 @@ QString Util::versionString()
int Util::uiFontSize()
{
#ifdef MEEGO_EDITION_HARMATTAN
return 14;
#else
return 12;
#endif
}
bool Util::isHarmattan()
{
#ifdef MEEGO_EDITION_HARMATTAN
return true;
#else
return false;
#endif
}
void Util::keyPressFeedback()
......@@ -211,7 +140,9 @@ void Util::keyPressFeedback()
if( !settingsValue("ui/keyPressFeedback").toBool() )
return;
#ifdef HAVE_FEEDBACK
QFeedbackEffect::playThemeEffect(QFeedbackEffect::PressWeak);
#endif
}
void Util::keyReleaseFeedback()
......@@ -220,7 +151,9 @@ void Util::keyReleaseFeedback()
return;
// TODO: check what's more comfortable, only press, or press and release
#ifdef HAVE_FEEDBACK
QFeedbackEffect::playThemeEffect(QFeedbackEffect::ReleaseWeak);
#endif
}
void Util::bellAlert()
......@@ -228,21 +161,6 @@ void Util::bellAlert()
if(!iWindow)
return;
#ifdef MEEGO_EDITION_HARMATTAN
if(settingsValue("general/backgroundBellNotify").toBool() &&
!iWindow->hasFocus())
{
Notification notif;
notif.setAppIcon("icon-l-terminal");
notif.setUrgency(Notification::Normal);
notif.setExpireTimeout(0);
notif.setPreviewSummary(QCoreApplication::applicationName());
// TODO: should be translated
notif.setPreviewBody("Terminal alert was received");
notif.setRemoteAction(Notification::remoteAction("default", "", MComponentData::instance()->serviceName(), "/org/maemo/m", "com.nokia.MApplicationIf", "launch"));
notif.publish();
} else
#endif //MEEGO_EDITION_HARMATTAN
if( settingsValue("general/visualBell").toBool() ) {
emit visualBell();
}
......@@ -250,14 +168,6 @@ void Util::bellAlert()
void Util::clearNotifications()
{
#ifdef MEEGO_EDITION_HARMATTAN
foreach( QObject *obj, Notification::notifications() ) {
if( Notification *notif = qobject_cast<Notification *>(obj) ) {
notif->close();
}
delete obj;
}
#endif //MEEGO_EDITION_HARMATTAN
}
void Util::mousePress(float eventX, float eventY) {
......
......@@ -49,7 +49,6 @@ public:
Q_INVOKABLE void setSettingsValue(QString key, QVariant value);
Q_INVOKABLE int uiFontSize();
Q_INVOKABLE bool isHarmattan();
Q_INVOKABLE void keyPressFeedback();
Q_INVOKABLE void keyReleaseFeedback();
......@@ -86,8 +85,6 @@ private:
Q_DISABLE_COPY(Util)
enum PanGesture { PanNone, PanLeft, PanRight, PanUp, PanDown };
void enableSwipe();
void disableSwipe();
bool swipeModeSet;
bool swipeAllowed;
......
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