sentBanner

Adds a confirmation banner when sending a Toot
This commit is contained in:
molan-git 2020-05-24 19:54:46 +02:00
parent b177884567
commit c8ad3f02cc
21 changed files with 325 additions and 196 deletions

View file

@ -1,116 +1,117 @@
# NOTICE:
#
# Application name defined in TARGET has a corresponding QML filename.
# If name defined in TARGET is changed, the following needs to be done
# to match new name:
# - corresponding QML filename must be changed
# - desktop icon filename must be changed
# - desktop filename must be changed
# - icon definition filename in desktop file must be changed
# - translation filenames have to be changed
# The name of your application
TARGET = harbour-tooter
CONFIG += sailfishapp
QT += network dbus sql
CONFIG += link_pkgconfig
PKGCONFIG += sailfishapp
PKGCONFIG += \
nemonotifications-qt5
DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\""
DEFINES += "APPNAME=\\\"$${TARGET}\\\""
!exists( src/dbusAdaptor.h ) {
system(qdbusxml2cpp config/ba.dysko.harbour.tooter.xml -i dbus.h -a src/dbusAdaptor)
}
config.path = /usr/share/$${TARGET}/config/
config.files = config/icon-lock-harbour-tooter.png
notification_categories.path = /usr/share/lipstick/notificationcategories
notification_categories.files = config/x-harbour.tooter.activity.*
dbus_services.path = /usr/share/dbus-1/services/
dbus_services.files = config/ba.dysko.harbour.tooter.service
interfaces.path = /usr/share/dbus-1/interfaces/
interfaces.files = config/ba.dysko.harbour.tooter.xml
SOURCES += src/harbour-tooter.cpp
SOURCES += src/imageuploader.cpp
SOURCES += src/filedownloader.cpp
SOURCES += src/notifications.cpp
SOURCES += src/dbusAdaptor.cpp
SOURCES += src/dbus.cpp
HEADERS += src/imageuploader.h
HEADERS += src/filedownloader.h
HEADERS += src/notifications.h
HEADERS += src/dbusAdaptor.h
HEADERS += src/dbus.h
DISTFILES += qml/harbour-tooter.qml \
qml/pages/components/VisualContainer.qml \
qml/pages/components/MiniStatus.qml \
qml/pages/components/MiniHeader.qml \
qml/pages/components/ItemUser.qml \
qml/pages/components/MyList.qml \
qml/pages/components/Navigation.qml \
qml/pages/components/ProfileHeader.qml \
qml/pages/components/MediaBlock.qml \
qml/pages/components/MyImage.qml \
qml/pages/components/ImageFullScreen.qml \
qml/cover/CoverPage.qml \
qml/pages/MainPage.qml \
qml/pages/LoginPage.qml \
qml/pages/Conversation.qml \
qml/pages/components/Toot.qml \
qml/pages/Browser.qml \
qml/pages/Profile.qml \
qml/pages/Settings.qml \
qml/lib/API.js \
qml/images/notification.svg \
qml/images/verified.svg \
qml/images/boosted.svg \
qml/images/tooter.svg \
qml/images/emojiselect.svg \
qml/images/icon-m-profile.svg \
qml/images/icon-l-profile.svg \
qml/lib/Mastodon.js \
qml/lib/Worker.js \
config/icon-lock-harbour-tooter.png \
config/x-harbour.tooter.activity.conf \
rpm/harbour-tooter.changes \
rpm/harbour-tooter.changes.run.in \
rpm/harbour-tooter.spec \
rpm/harbour-tooter.yaml \
translations/*.ts \
harbour-tooter.desktop
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
# German translation is enabled as an example. If you aren't
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-tooter-de.ts
TRANSLATIONS += translations/harbour-tooter-el.ts
TRANSLATIONS += translations/harbour-tooter-es.ts
TRANSLATIONS += translations/harbour-tooter-fi.ts
TRANSLATIONS += translations/harbour-tooter-fr.ts
TRANSLATIONS += translations/harbour-tooter-nl.ts
TRANSLATIONS += translations/harbour-tooter-nl_BE.ts
TRANSLATIONS += translations/harbour-tooter-oc.ts
TRANSLATIONS += translations/harbour-tooter-pl.ts
TRANSLATIONS += translations/harbour-tooter-ru.ts
TRANSLATIONS += translations/harbour-tooter-sr.ts
TRANSLATIONS += translations/harbour-tooter-sv.ts
TRANSLATIONS += translations/harbour-tooter-zh_CN.ts
TRANSLATIONS += translations/harbour-tooter-it.ts
# NOTICE:
#
# Application name defined in TARGET has a corresponding QML filename.
# If name defined in TARGET is changed, the following needs to be done
# to match new name:
# - corresponding QML filename must be changed
# - desktop icon filename must be changed
# - desktop filename must be changed
# - icon definition filename in desktop file must be changed
# - translation filenames have to be changed
# The name of your application
TARGET = harbour-tooter
CONFIG += sailfishapp
QT += network dbus sql
CONFIG += link_pkgconfig
PKGCONFIG += sailfishapp
PKGCONFIG += \
nemonotifications-qt5
DEFINES += "APPVERSION=\\\"$${SPECVERSION}\\\""
DEFINES += "APPNAME=\\\"$${TARGET}\\\""
!exists( src/dbusAdaptor.h ) {
system(qdbusxml2cpp config/ba.dysko.harbour.tooter.xml -i dbus.h -a src/dbusAdaptor)
}
config.path = /usr/share/$${TARGET}/config/
config.files = config/icon-lock-harbour-tooter.png
notification_categories.path = /usr/share/lipstick/notificationcategories
notification_categories.files = config/x-harbour.tooter.activity.*
dbus_services.path = /usr/share/dbus-1/services/
dbus_services.files = config/ba.dysko.harbour.tooter.service
interfaces.path = /usr/share/dbus-1/interfaces/
interfaces.files = config/ba.dysko.harbour.tooter.xml
SOURCES += src/harbour-tooter.cpp
SOURCES += src/imageuploader.cpp
SOURCES += src/filedownloader.cpp
SOURCES += src/notifications.cpp
SOURCES += src/dbusAdaptor.cpp
SOURCES += src/dbus.cpp
HEADERS += src/imageuploader.h
HEADERS += src/filedownloader.h
HEADERS += src/notifications.h
HEADERS += src/dbusAdaptor.h
HEADERS += src/dbus.h
DISTFILES += qml/harbour-tooter.qml \
qml/pages/components/InfoBanner.qml \
qml/pages/components/VisualContainer.qml \
qml/pages/components/MiniStatus.qml \
qml/pages/components/MiniHeader.qml \
qml/pages/components/ItemUser.qml \
qml/pages/components/MyList.qml \
qml/pages/components/Navigation.qml \
qml/pages/components/ProfileHeader.qml \
qml/pages/components/MediaBlock.qml \
qml/pages/components/MyImage.qml \
qml/pages/components/ImageFullScreen.qml \
qml/cover/CoverPage.qml \
qml/pages/MainPage.qml \
qml/pages/LoginPage.qml \
qml/pages/Conversation.qml \
qml/pages/components/Toot.qml \
qml/pages/Browser.qml \
qml/pages/Profile.qml \
qml/pages/Settings.qml \
qml/lib/API.js \
qml/images/notification.svg \
qml/images/verified.svg \
qml/images/boosted.svg \
qml/images/tooter.svg \
qml/images/emojiselect.svg \
qml/images/icon-m-profile.svg \
qml/images/icon-l-profile.svg \
qml/lib/Mastodon.js \
qml/lib/Worker.js \
config/icon-lock-harbour-tooter.png \
config/x-harbour.tooter.activity.conf \
rpm/harbour-tooter.changes \
rpm/harbour-tooter.changes.run.in \
rpm/harbour-tooter.spec \
rpm/harbour-tooter.yaml \
translations/*.ts \
harbour-tooter.desktop
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
# to disable building translations every time, comment out the
# following CONFIG line
CONFIG += sailfishapp_i18n
# German translation is enabled as an example. If you aren't
# planning to localize your app, remember to comment out the
# following TRANSLATIONS line. And also do not forget to
# modify the localized app name in the the .desktop file.
TRANSLATIONS += translations/harbour-tooter-de.ts
TRANSLATIONS += translations/harbour-tooter-el.ts
TRANSLATIONS += translations/harbour-tooter-es.ts
TRANSLATIONS += translations/harbour-tooter-fi.ts
TRANSLATIONS += translations/harbour-tooter-fr.ts
TRANSLATIONS += translations/harbour-tooter-nl.ts
TRANSLATIONS += translations/harbour-tooter-nl_BE.ts
TRANSLATIONS += translations/harbour-tooter-oc.ts
TRANSLATIONS += translations/harbour-tooter-pl.ts
TRANSLATIONS += translations/harbour-tooter-ru.ts
TRANSLATIONS += translations/harbour-tooter-sr.ts
TRANSLATIONS += translations/harbour-tooter-sv.ts
TRANSLATIONS += translations/harbour-tooter-zh_CN.ts
TRANSLATIONS += translations/harbour-tooter-it.ts

View file

@ -4,9 +4,11 @@ import harbour.tooter.Uploader 1.0
import "../lib/API.js" as Logic
import "./components/"
Page {
id: conversationPage
property string type
property string headerTitle: ""
property string type
property alias title: header.title
property alias description: header.description
property alias avatar: header.image
@ -40,6 +42,10 @@ Page {
}
}
InfoBanner {
id: sentBanner
}
ListModel {
id: mediaModel
onCountChanged: {
@ -62,7 +68,7 @@ Page {
SilicaListView {
id: conversationList
header: PageHeader {
title: qsTr("Conversation")
title: headerTitle // pageTitle pushed from MainPage.qml or VisualContainer.qml
}
clip: true
anchors {
@ -208,7 +214,6 @@ Page {
|| description.charAt(
0) == '#') ? description + ' ' : ''
height: Math.max(270, Math.min(900, implicitHeight))
//height: implicitHeight
horizontalAlignment: Text.AlignLeft
placeholderText: qsTr("What's on your mind?")
font.pixelSize: Theme.fontSizeSmall
@ -304,7 +309,6 @@ Page {
}
}
IconButton {
id: btnContentWarning
anchors {
top: toot.bottom
@ -426,11 +430,11 @@ Page {
msg.params['spoiler_text'] = warningContent.text
}
worker.sendMessage(msg)
warningContent.text = ""
toot.text = ""
mediaModel.clear()
pageStack.pop()
worker.sendMessage(msg)
warningContent.text = ""
toot.text = ""
mediaModel.clear()
sentBanner.showText(qsTr("Toot sent!"))
}
}

View file

@ -246,7 +246,7 @@ Page {
visible: !isPortrait ? true : !infoPanel.open
icon.source: "image://theme/icon-l-add"
onClicked: {
pageStack.push(Qt.resolvedUrl("Conversation.qml"), {title: qsTr("New Toot"), type: "new"})
pageStack.push(Qt.resolvedUrl("Conversation.qml"), {headerTitle: qsTr("New Toot"), type: "new"})
}
}

View file

@ -0,0 +1,62 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
DockedPanel {
id: root
z: 100;
width: parent.width //- Theme.paddingLarge*4
//x: Theme.paddingLarge*2
height: content.height
dock: Dock.Bottom
Rectangle {
id: content
width: root.width
height: infoLabel.height + 4*Theme.paddingMedium
//anchors.topMargin: 20
color: Theme.highlightBackgroundColor
opacity: 1.0
Label {
id: infoLabel
text : ""
color: Theme.primaryColor
font.family: Theme.fontFamilyHeading
font.pixelSize: Theme.fontSizeMedium
//font.weight: Font.Bold
width: parent.width
wrapMode: Text.WrapAnywhere
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.horizontalPageMargin
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.hide()
autoClose.stop()
}
}
}
function showText(text) {
infoLabel.text = text
root.show()
autoClose.start()
}
Timer {
id: autoClose
interval: 6000
running: false
onTriggered: {
root.hide()
stop()
}
}
}

View file

@ -0,0 +1,61 @@
import QtQuick 2.0
import Sailfish.Silica 1.0
DockedPanel {
id: root
z: 100;
width: parent.width
height: content.height
dock: Dock.Bottom
Rectangle {
id: content
width: root.width
height: infoLabel.height + 4*Theme.paddingMedium
//anchors.topMargin: 20
color: Theme.highlightBackgroundColor
opacity: 1.0
Label {
id: infoLabel
text : ""
color: Theme.primaryColor
font.family: Theme.fontFamilyHeading
font.pixelSize: Theme.fontSizeMedium
//font.weight: Font.Bold
width: parent.width
wrapMode: Text.WrapAnywhere
anchors {
left: parent.left
leftMargin: Theme.horizontalPageMargin
right: parent.right
rightMargin: Theme.ho rizontalPageMargin
verticalCenter: parent.verticalCenter
}
}
MouseArea {
anchors.fill: parent
onClicked: {
root.hide()
autoClose.stop()
}
}
}
function showText(text) {
infoLabel.text = text
root.show()
autoClose.start()
}
Timer {
id: autoClose
interval: 6000
running: false
onTriggered: {
root.hide()
stop()
}
}
}

View file

@ -277,6 +277,7 @@ BackgroundItem {
if (typeof mdl !== "undefined")
m.append(mdl.get(index))
pageStack.push(Qt.resolvedUrl("../Conversation.qml"), {
headerTitle: "Conversation",
toot_id: status_id,
title: account_display_name,
description: '@'+account_acct,

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konversation</translation>
</message>
<message>
<source>Delete</source>
<translation>Löschen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation>Was gibt&apos;s Neues?</translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Συνομιλία</translation>
</message>
<message>
<source>Delete</source>
<translation>Διαγραφή</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversación</translation>
</message>
<message>
<source>Delete</source>
<translation>Borrar</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation>¿En qué estás pensando?</translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete</source>
<translation type="unfinished"></translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversation</translation>
</message>
<message>
<source>Delete</source>
<translation>Supprimer</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation>Qu&apos;avez-vous en tête?</translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -28,52 +28,52 @@
<context>
<name>Conversation</name>
<message>
<location filename="../qml/pages/Conversation.qml" line="65"/>
<source>Conversation</source>
<translation>Conversazione</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="182"/>
<location filename="../qml/pages/Conversation.qml" line="188"/>
<source>Write your warning here</source>
<translation>Contenuto avviso</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="213"/>
<location filename="../qml/pages/Conversation.qml" line="218"/>
<source>What&apos;s on your mind?</source>
<translation>A cosa stai pensando?</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="276"/>
<location filename="../qml/pages/Conversation.qml" line="281"/>
<source>Delete</source>
<translation>Elimina</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="376"/>
<location filename="../qml/pages/Conversation.qml" line="380"/>
<source>Public</source>
<translation>Pubblico</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="379"/>
<location filename="../qml/pages/Conversation.qml" line="383"/>
<source>Unlisted</source>
<translation>Non elencato</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="382"/>
<location filename="../qml/pages/Conversation.qml" line="386"/>
<source>Followers-only</source>
<translation>Solo ai seguaci</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="385"/>
<location filename="../qml/pages/Conversation.qml" line="389"/>
<source>Direct</source>
<translation>Diretto</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="499"/>
<location filename="../qml/pages/Conversation.qml" line="437"/>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="503"/>
<source>Emojis</source>
<translation>Emojis</translation>
</message>
<message>
<location filename="../qml/pages/Conversation.qml" line="500"/>
<location filename="../qml/pages/Conversation.qml" line="504"/>
<source>Tap to insert</source>
<translation>Tap per inserire</translation>
</message>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Gesprek</translation>
</message>
<message>
<source>Delete</source>
<translation>Verwijderen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Gesprek</translation>
</message>
<message>
<source>Delete</source>
<translation>Verwijderen</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Discutida</translation>
</message>
<message>
<source>Delete</source>
<translation>Escafar</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konwersacja</translation>
</message>
<message>
<source>Delete</source>
<translation>Usuń</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Беседа</translation>
</message>
<message>
<source>Delete</source>
<translation>Удалить</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Разговор</translation>
</message>
<message>
<source>Delete</source>
<translation>Обриши</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Konversation</translation>
</message>
<message>
<source>Delete</source>
<translation>Radera</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation></translation>
</message>
<message>
<source>Delete</source>
<translation></translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation>?</translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>

View file

@ -22,10 +22,6 @@
</context>
<context>
<name>Conversation</name>
<message>
<source>Conversation</source>
<translation>Conversation</translation>
</message>
<message>
<source>Delete</source>
<translation>Delete</translation>
@ -62,6 +58,10 @@
<source>What&apos;s on your mind?</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Toot sent!</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>ImageFullScreen</name>