Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove legacy platforms
-Remove support for Maemo, Meego, Harmattan & Symbian.
-Allow definition of font for QMake.

Signed-off-by: Herman van Hazendonk <github.com@herrie.org>
  • Loading branch information
Herrie82 authored and pvuorela committed May 4, 2016
1 parent ab80773 commit 4f76e2e
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 247 deletions.
44 changes: 8 additions & 36 deletions fingerterm.pro
@@ -1,20 +1,13 @@
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
DEPENDPATH += .
INCLUDEPATH += .
LIBS += -lutil

system($$PWD/updateversion.sh)

# Input
HEADERS += \
ptyiface.h \
Expand All @@ -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 \
Expand All @@ -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
Expand Down
23 changes: 5 additions & 18 deletions main.cpp
Expand Up @@ -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"
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -171,17 +158,17 @@ 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"))
{
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());
Expand Down Expand Up @@ -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"))
Expand Down
43 changes: 0 additions & 43 deletions mainwindow.cpp
Expand Up @@ -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);
Expand Down Expand Up @@ -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
}
2 changes: 0 additions & 2 deletions mainwindow.h
Expand Up @@ -30,8 +30,6 @@ class MainWindow : public QQuickView
virtual ~MainWindow();

void minimize();
void enableSwipe();
void disableSwipe();

protected:
virtual void focusInEvent(QFocusEvent *event);
Expand Down
2 changes: 2 additions & 0 deletions qml/Key.qml
Expand Up @@ -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 } }
}
Expand Down Expand Up @@ -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 } }
}
Expand Down
50 changes: 1 addition & 49 deletions qml/MenuFingerterm.qml
Expand Up @@ -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: {
Expand All @@ -442,7 +394,7 @@ Rectangle {
}
}
Button {
visible: (currentSwipeLocking=="false" && util.isHarmattan()) || !util.isHarmattan();
visible: true;
text: "Minimize"
onClicked: {
hideMenu();
Expand Down
2 changes: 1 addition & 1 deletion rpm/fingerterm.spec
Expand Up @@ -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}
Expand Down

0 comments on commit 4f76e2e

Please sign in to comment.