diff --git a/.travis.yml b/.travis.yml index fcc6e8d..dd3eb50 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,32 +2,23 @@ language: cpp compiler: gcc sudo: require dist: trusty + before_install: -- sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y -- sudo apt-get update -qq -install: -- sudo apt-get -y install qt58base qt58webengine qt58quickcontrols -- source /opt/qt58/bin/qt58-env.sh + - sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y + - sudo apt-get update -qq + +install: + - sudo apt-get -y install qt58base qt58webengine qt58quickcontrols + - source /opt/qt58/bin/qt58-env.sh + script: -- qmake PREFIX=/usr -- make -j4 -- sudo make INSTALL_ROOT=appdir install ; sudo chown -R $USER appdir ; find appdir/ -- wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" -- chmod a+x linuxdeployqt*.AppImage -- unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH -- "./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -qmldir=./qml/ - -bundle-non-qt-libs" -- "./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -qmldir=./qml/ - -appimage" -- find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " - -f 2-3 | sort | uniq -- mv FeedTheMonkey*.AppImage FeedTheMonkey.AppImage -deploy: - provider: releases - api_key: - secure: d+hHwOnmeLPVvuue6VDCs2LwLS+BFzJF/BB5iObtkCYBwQ8ybnVzUcgnjJKOt37SHI0T9kLegI+Lq/843ECYiGiDjQg4PvCF69V8ODgHv3v1qiN5oG/eroBXd83a0+xhi4BuJt0SwcV9mcv4uD9bCPhj944rmMLH+3qD4ysgImBmbYSbbLecE9+QAs7bfrCwQRfdCePBORX3FHa/p12NEtln7xv6ZRyku9LdJSzAcdgm4zc95ggTAVC1+aQB6J0q2QzWPlQcOkLx+ZYmOqClhbSMFpIyPXP8UpXjYyvUlTAd0+wH8BGf0O3lpOqACc7IKIbj9d5oPmghVZo55SyW+RR77G+az+IbGJ7iXZsMfQZsMvtB7hNYhNvUUxQrAau7Y/ve+6sMQmvA7aMHV8kDUvnNW/c2r2jAWwk+N8QzGcP/rclDCKeOWZqZABmrzTViXZVAeXh4hJ8r6mbq8iwagBUPCsVYhVuerQt/KIoWxyn6/1GmMfKGi3dA/v3u1qU61vzrz3yLlJBmUAVPxZdVmqfRweh4BXjImxFMFmf5PYm5FnDg1gmw8rWsgii7+IPYw7DjTAHpjYbtXvDwDgG1nRXiRp2TGtPPgKW1/Uk8r/j5vfB5WcEZ7exLUgsPPjny5MGvzjqOxeLvwK1Pg9jFBFXIx7l1tNMJQxQU0r3DmBg= - file: FeedTheMonkey.AppImage - on: - repo: jeena/FeedTheMonkey - skip_cleanup: true - draft: true + - qmake PREFIX=/usr + - make -j4 + - sudo make INSTALL_ROOT=appdir install ; sudo chown -R $USER appdir ; find appdir/ + - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + - chmod a+x linuxdeployqt*.AppImage + - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH + - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -qmldir=./qml/ -bundle-non-qt-libs + - ./linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -qmldir=./qml/ -appimage + - find ./appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq + - curl --upload-file ./FeedTheMonkey*.AppImage https://transfer.sh/FeedTheMonkey-git.$(git rev-parse --short HEAD)-x86_64.AppImage diff --git a/README.md b/README.md index 155358a..8819b8e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # FeedTheMonkey -Icon +Icon FeedTheMonkey is a desktop client for [TinyTinyRSS](http://tt-rss.org). That means that it doesn't work as a standalone feed reader but only as a client for the TinyTinyRSS API @@ -43,7 +43,7 @@ the use on a desktop computer but I'd like to see it on a mobile device too. ## Screenshot -![Feed the Monkey screenshot](http://jeena.net/feedthemonkey/feedthemonkey-dark.png) +![Feed the Monkey screenshot](http://jabs.nu/feedthemonkey/screenshot.png) ## License diff --git a/html/content.css b/html/content.css index 2b1d0b3..afcb4e4 100644 --- a/html/content.css +++ b/html/content.css @@ -25,12 +25,14 @@ html, body { body { background: #eee; font-family: sans-serif; + padding: 2em; + font-weight: lighter; word-wrap: break-word; } .nightmode { - background: #353535; - color: #ddd; + background: #111; + color: #aaa; } .nightmode::-webkit-scrollbar { @@ -49,28 +51,32 @@ body { } h1 { + font-weight: lighter; font-size: 1.4em; margin: 0; padding: 0; } +#date { + border-bottom: 1px solid #aaa; + margin-bottom: 1em; + padding-bottom: 1em; + display: block; +} + +.nightmode #date { + border-bottom-color: #333; +} + .starred:after { content: "*"; } -header { - padding: 2em; - border-bottom: 1px solid #aaa; -} - -.nightmode header { - border-bottom-color: #222; -} - header p { - color: #666; + color: #aaa; margin: 0; padding: 0; + font-size: 0.8em; } .nightmode header p { @@ -84,7 +90,6 @@ a { article { line-height: 1.6; - margin: 2em; } article a { diff --git a/html/content.html b/html/content.html index 87d53aa..bbcd5f5 100644 --- a/html/content.html +++ b/html/content.html @@ -4,96 +4,7 @@ TTRSS - + diff --git a/html/content.js b/html/content.js new file mode 100644 index 0000000..2d88c4e --- /dev/null +++ b/html/content.js @@ -0,0 +1,85 @@ +/* + * This file is part of FeedTheMonkey. + * + * Copyright 2015 Jeena + * + * FeedTheMonkey 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 3 of the License, or + * (at your option) any later version. + * + * FeedTheMonkey 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 FeedTheMonkey. If not, see . + */ + +function $(id) { + return document.getElementById(id); +} + +function setArticle(article) { + window.scrollTo(0, 0); + + $("date").innerHTML = ""; + $("title").innerHTML = ""; + $("title").href = ""; + $("title").title = ""; + $("feed_title").innerHTML = ""; + $("author").innerHTML = ""; + $("article").innerHTML = ""; + + if(article === "empty") { + + $("article").innerHTML = "No unread articles to display."; + + } else if(article === "loading") { + + $("article").innerHTML = "Loading "; + + } else if (article === "logout") { + + } else if(article) { + + $("date").innerHTML = (new Date(parseInt(article.updated, 10) * 1000)); + $("title").innerHTML = article.title; + $("title").href = article.link; + $("title").title = article.link; + $("feed_title").innerHTML = article.feed_title; + $("title").className = article.marked ? "starred" : ""; + $("author").innerHTML = ""; + if(article.author && article.author.length > 0) + $("author").innerHTML = "– " + article.author + $("article").innerHTML = article.content; + + var as = $("article").getElementsByTagName("a"); + for(var i = 0; i < as.length; i++) { + as[i].target = ""; + } + } +} + +function setFont(font, size) { + document.body.style.fontFamily = font; + document.body.style.fontSize = size + "pt"; +} + +function setNightmode(nightmode) { + if(nightmode) document.body.className = "nightmode"; + else document.body.className = ""; +} + +document.onkeydown = checkKey; + +function checkKey(e) { + e = e || window.event; + if (e.keyCode == '37') { + window.location.href = "feedthemonkey:previous"; + } + else if (e.keyCode == '39') { + window.location.href = "feedthemonkey:next"; + } +} diff --git a/html/html.qrc b/html/html.qrc index c6cf166..90d8b19 100644 --- a/html/html.qrc +++ b/html/html.qrc @@ -2,5 +2,6 @@ content.css content.html + content.js diff --git a/qml/Content.qml b/qml/Content.qml index 07440be..086dbef 100644 --- a/qml/Content.qml +++ b/qml/Content.qml @@ -17,11 +17,12 @@ * along with FeedTheMonkey. If not, see . */ -import QtWebEngine 1.8 +import QtWebEngine 1.0 import QtQuick 2.0 import QtQuick.Controls 1.3 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.3 +import QtQuick.Controls 1.3 import TTRSS 1.0 Item { @@ -91,10 +92,7 @@ Item { } else if (request.url == "feedthemonkey:next") { request.action = WebEngineView.IgnoreRequest; app.showNextPost(); - } else if (request.url == "feedthemonkey:open") { - request.action = WebEngineView.IgnoreRequest; - Qt.openUrlExternally(post.link) - } else if (request.navigationType !== WebEngineNavigationRequest.LinkClickedNavigation) { + } else if (request.navigationType != WebEngineView.LinkClickedNavigation) { request.action = WebEngineView.AcceptRequest; } else { request.action = WebEngineView.IgnoreRequest; diff --git a/qml/PostListItem.qml b/qml/PostListItem.qml index 63bf813..e0c3d20 100644 --- a/qml/PostListItem.qml +++ b/qml/PostListItem.qml @@ -33,7 +33,7 @@ Item { } id: item - height: d.height + t.height + e.height + 2 + height: d.height + t.height + e.height + 20 Item { anchors.fill: parent @@ -81,7 +81,7 @@ Item { Label { id: t text: title - color: nightmode ? (read ? "#888" : "#ddd") : (read ? "gray" : "black") + color: nightmode ? (read ? "#555" : "#aaa") : (read ? "gray" : "black") font.pointSize: textFontSize textFormat: Text.PlainText wrapMode: Text.WrapAnywhere diff --git a/qml/Sidebar.qml b/qml/Sidebar.qml index 84de4cb..bcb70ee 100644 --- a/qml/Sidebar.qml +++ b/qml/Sidebar.qml @@ -48,21 +48,6 @@ ScrollView { } } - onWidthChanged: { - // Hide sidebar if smaller than 200px wide - if(width < 200) { - width = 0; - } - } - - Rectangle { - width: 1 - color: app.nightmode ? "#111" : "lightgray" - anchors.right: parent.right - anchors.top: parent.top - height: parent.height - } - ListView { id: listView @@ -82,12 +67,12 @@ ScrollView { highlightFollowsCurrentItem: false highlight: Component { Rectangle { - width: listView.currentItem.width -1 + width: listView.currentItem.width height: listView.currentItem.height - color: nightmode ? "#15539e" : "lightblue" + color: nightmode ? "#444" : "lightblue" + opacity: 0.5 y: listView.currentItem.y } - } onCurrentItemChanged: { @@ -100,6 +85,8 @@ ScrollView { } item.content.post = server.posts[currentIndex] + //content.flickableItem.contentY = 0 + previousPost = item.content.post } } diff --git a/qml/TheMenuBar.qml b/qml/TheMenuBar.qml index 34c0310..ae2eb70 100644 --- a/qml/TheMenuBar.qml +++ b/qml/TheMenuBar.qml @@ -35,11 +35,6 @@ MenuBar { Menu { visible: menuBar.visible title: qsTr("File") - MenuItem { - text: qsTr("Close &Window") - shortcut: "Ctrl+W" - onTriggered: Qt.quit() - } MenuItem { text: qsTr("Exit") shortcut: "Ctrl+Q" @@ -137,7 +132,7 @@ MenuBar { title: qsTr("Help") MenuItem { text: qsTr("About") - onTriggered: Qt.openUrlExternally("http://jeena.net/feedthemonkey/index.html"); + onTriggered: Qt.openUrlExternally("http://jabs.nu/feedthemonkey"); } } diff --git a/qml/main.qml b/qml/main.qml index 0b6074b..7746367 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -29,7 +29,7 @@ ApplicationWindow { id: app title: "FeedTheMonkey" visible: true - color: nightmode ? "#2d2d2d" : "#eee" + color: nightmode ? "#111" : "#eee" minimumWidth: 480 minimumHeight: 320 @@ -60,6 +60,7 @@ ApplicationWindow { __contentItem.visible: visible } + Settings { id: settings category: "window" @@ -159,6 +160,10 @@ ApplicationWindow { case Qt.Key_Return: Qt.openUrlExternally(content.post.link) break + case Qt.Key_S: { + console.log(Qt.openUrlExternally("speaker:"+ removeHTML(content.post.content))) + break + } default: break } @@ -180,6 +185,7 @@ ApplicationWindow { content: content server: server + Layout.minimumWidth: 200 implicitWidth: 300 textFontSize: app.textFontSize nightmode: app.nightmode diff --git a/src/main.cpp b/src/main.cpp index 95f351e..48475bb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -31,7 +31,6 @@ int main(int argc, char *argv[]) { - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); app.setOrganizationName("Jeena"); app.setOrganizationDomain("jeena.net"); diff --git a/src/tinytinyrsslogin.cpp b/src/tinytinyrsslogin.cpp index 2648e7a..78fcd9f 100644 --- a/src/tinytinyrsslogin.cpp +++ b/src/tinytinyrsslogin.cpp @@ -99,18 +99,6 @@ void TinyTinyRSSLogin::reply() qWarning() << mLoginError; emit loginErrorChanged(mLoginError); - if(mLoginError == "NOT_LOGGED_IN") { - mSessionId = nullptr; - mServerUrl = nullptr; - - QSettings settings; - settings.remove("sessionId"); - settings.remove("serverUrl"); - settings.sync(); - - emit sessionIdChanged(mSessionId); - } - } else { mSessionId = json.object().value("content").toObject().value("session_id").toString();