Ubuntu, update project, click, port some fixes
This commit is contained in:
parent
9074d67ab9
commit
265def2f20
6 changed files with 80 additions and 42 deletions
2
main.cpp
2
main.cpp
|
|
@ -119,7 +119,7 @@ Q_DECL_EXPORT int main(int argc, char *argv[])
|
|||
#if defined(Q_OS_SAILFISH)
|
||||
viewer->setSource(SailfishApp::pathTo("qml/sailfish/harbour-ttrss.qml"));
|
||||
#elif defined(Q_OS_UBUNTU_TOUCH)
|
||||
viewer->setSource(QStringLiteral("qml/ttrss/ubuntu-touch/main.qml"));
|
||||
viewer->setSource(QStringLiteral("qml/ubuntu-touch/main.qml"));
|
||||
#else
|
||||
viewer->setMainQmlFile(QLatin1String("qml/harmattan/main.qml"));
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ Item {
|
|||
id: serverLabel
|
||||
text: qsTr("Server:")
|
||||
width: parent.width
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
fontSize: "small"
|
||||
}
|
||||
TextField {
|
||||
id: server
|
||||
|
|
@ -69,7 +69,7 @@ Item {
|
|||
id: usernameLabel
|
||||
text: qsTr("Username:")
|
||||
width: parent.width
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
fontSize: "small"
|
||||
}
|
||||
TextField {
|
||||
id: username
|
||||
|
|
@ -90,7 +90,7 @@ Item {
|
|||
id: passwordLabel
|
||||
text: qsTr("Password:")
|
||||
width: parent.width
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
fontSize: "small"
|
||||
}
|
||||
TextField {
|
||||
id: password
|
||||
|
|
@ -183,7 +183,7 @@ Item {
|
|||
|
||||
function startLogin() {
|
||||
var ttrss = rootWindow.getTTRSS();
|
||||
ttrss.clearState();
|
||||
ttrss.initState();
|
||||
ttrss.setLoginDetails(username.text, password.text, server.text);
|
||||
// BUGFIX since somehow the silica QML Image can not display images coming from a secure line
|
||||
if (settings.ignoreSSLErrors && server.text.substring(0, 5) === "https")
|
||||
|
|
@ -195,45 +195,44 @@ Item {
|
|||
ttrss.login(loginSuccessfull);
|
||||
}
|
||||
|
||||
function loginSuccessfull(retcode, text) {
|
||||
if(retcode) {
|
||||
function loginSuccessfull(successful, errorMessage) {
|
||||
if(!successful) {
|
||||
//login failed....don't autlogin
|
||||
settings.autologin = false
|
||||
|
||||
//Let the user know
|
||||
// loginErrorDialog.text = text;
|
||||
// loginErrorDialog.text = errorMessage;
|
||||
// loginErrorDialog.open();
|
||||
}
|
||||
else {
|
||||
//Login succeeded, auto login next Time
|
||||
settings.autologin = true
|
||||
rootWindow.getTTRSS().updateConfig(configSuccessfull);
|
||||
rootWindow.getTTRSS().getConfig(configDone);
|
||||
}
|
||||
}
|
||||
|
||||
function configSuccessfull(retcode, text) {
|
||||
if(retcode) {
|
||||
function configDone(successful, errorMessage) {
|
||||
if(!successful) {
|
||||
//Let the user know
|
||||
// loginErrorDialog.text = text;
|
||||
// loginErrorDialog.open();
|
||||
return
|
||||
}
|
||||
else {
|
||||
categories.update()
|
||||
pageStack.clear()
|
||||
//Now show the categories View
|
||||
if (settings.useAllFeedsOnStartup) {
|
||||
var ttrss = rootWindow.getTTRSS()
|
||||
pageStack.push("Feeds.qml", {
|
||||
category: {
|
||||
categoryId: ttrss.constants['categories']['ALL'],
|
||||
title: constant.allFeeds,
|
||||
unreadcount: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
else
|
||||
pageStack.push(Qt.resolvedUrl('Categories.qml'))
|
||||
categories.update()
|
||||
pageStack.clear()
|
||||
//Now show the categories View
|
||||
if (settings.useAllFeedsOnStartup) {
|
||||
var ttrss = rootWindow.getTTRSS()
|
||||
pageStack.push("Feeds.qml", {
|
||||
category: {
|
||||
categoryId: ttrss.constants['categories']['ALL'],
|
||||
title: constant.allFeeds,
|
||||
unreadcount: 0
|
||||
}
|
||||
})
|
||||
}
|
||||
else
|
||||
pageStack.push(Qt.resolvedUrl('Categories.qml'))
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ DEFINES += TARGET=\\\"it.mardy.ttrss\\\"
|
|||
|
||||
QT += quick qml
|
||||
|
||||
target.path = /usr/bin
|
||||
CLICK_DIR = $${OUT_PWD}/click
|
||||
CLICK_ARCH = $$system("dpkg-architecture -qDEB_BUILD_ARCH")
|
||||
|
||||
target.path = $${CLICK_DIR}
|
||||
INSTALLS += target
|
||||
|
||||
CONFIG += link_pkgconfig
|
||||
|
|
@ -16,22 +19,35 @@ CONFIG += link_pkgconfig
|
|||
OTHER_FILES += \
|
||||
$$files(qml/ttrss/ubuntu-touch/*.qml)
|
||||
|
||||
qml_1.files = qml/ttrss/ubuntu-touch
|
||||
qml_1.path = $${CLICK_DIR}/qml
|
||||
qml_2.files = qml/ttrss/models
|
||||
qml_2.path = $$INSTALL_ROOT/usr/share/$$TARGET/qml
|
||||
qml_2.path = $${CLICK_DIR}/qml
|
||||
qml_3.files = qml/ttrss/resources
|
||||
qml_3.path = $$INSTALL_ROOT/usr/share/$$TARGET/qml
|
||||
INSTALLS += qml_2 qml_3
|
||||
qml_3.path = $${CLICK_DIR}/qml
|
||||
INSTALLS += qml_1 qml_2 qml_3
|
||||
|
||||
icon.files = images/$${TARGET}.png
|
||||
icon.path = /usr/share/icons/hicolor/86x86/apps
|
||||
resources.files = images/resources
|
||||
resources.path = $${CLICK_DIR}/qml
|
||||
INSTALLS += resources
|
||||
|
||||
icon.files = images/ttrss.svg
|
||||
icon.path = $${CLICK_DIR}
|
||||
INSTALLS += icon
|
||||
|
||||
desktop.files = $${TARGET}.desktop
|
||||
desktop.path = /usr/share/applications
|
||||
QMAKE_SUBSTITUTES += ubuntu/ttrss.desktop.in
|
||||
desktop.files = ubuntu/ttrss.desktop
|
||||
desktop.path = $${CLICK_DIR}
|
||||
INSTALLS += desktop
|
||||
|
||||
RESOURCES += \
|
||||
harmattan.qrc
|
||||
apparmor.files = ubuntu/ttrss.json
|
||||
apparmor.path = $${CLICK_DIR}
|
||||
INSTALLS += apparmor
|
||||
|
||||
QMAKE_SUBSTITUTES += ubuntu/manifest.json.in
|
||||
manifest.files = ubuntu/manifest.json
|
||||
manifest.path = $${CLICK_DIR}
|
||||
INSTALLS += manifest
|
||||
|
||||
HEADERS += \
|
||||
settings.hh \
|
||||
|
|
@ -43,11 +59,6 @@ SOURCES += main.cpp \
|
|||
mynetworkmanager.cpp \
|
||||
qmlutils.cpp
|
||||
|
||||
OTHER_FILES += rpm/$${TARGET}.spec \
|
||||
rpm/$${TARGET}.yaml \
|
||||
$$files(rpm/*) \
|
||||
$$files(qml/ttrss/harmattan/*)
|
||||
|
||||
TS_FILE = $${_PRO_FILE_PWD_}/i18n/$${TARGET}.ts
|
||||
|
||||
# Translation source directories
|
||||
|
|
|
|||
15
ubuntu/manifest.json.in
Normal file
15
ubuntu/manifest.json.in
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
{
|
||||
\"description\": \"Tiny Tiny RSS client\",
|
||||
\"framework\": \"ubuntu-sdk-14.10-qml\",
|
||||
\"hooks\": {
|
||||
\"ttrss\": {
|
||||
\"apparmor\": \"ttrss.json\",
|
||||
\"desktop\": \"ttrss.desktop\"
|
||||
}
|
||||
},
|
||||
\"architecture\": \"$${CLICK_ARCH}\",
|
||||
\"maintainer\": \"Alberto Mardegan <info@mardy.it>\",
|
||||
\"name\": \"it.mardy.ttrss\",
|
||||
\"title\": \"Tiny Tiny RSS\",
|
||||
\"version\": \"0.1\"
|
||||
}
|
||||
7
ubuntu/ttrss.desktop.in
Normal file
7
ubuntu/ttrss.desktop.in
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Name=Tiny Tiny RSS
|
||||
Exec=./$${TARGET}
|
||||
Icon=ttrss.svg
|
||||
Terminal=false
|
||||
Type=Application
|
||||
X-Ubuntu-Touch=true
|
||||
6
ubuntu/ttrss.json
Normal file
6
ubuntu/ttrss.json
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"policy_groups": [
|
||||
"networking"
|
||||
],
|
||||
"policy_version": 1.2
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue