Verified Commit 42460ae8 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳 Committed by Linus Jahn

Add feature to copy an invitation URL

parent e6eee8cb
......@@ -65,6 +65,14 @@
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -119,6 +119,14 @@
<source>Back</source>
<translation>Zurück</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -88,6 +88,14 @@
<source>About</source>
<translation>Acerca de</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -111,6 +111,14 @@
<source>Back</source>
<translation>Retour</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -88,6 +88,14 @@
<source>Back</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -107,6 +107,14 @@
<source>Back</source>
<translation>Kembali</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -88,6 +88,14 @@
<source>About</source>
<translation>Om</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -88,6 +88,14 @@
<source>About</source>
<translation>Over</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -88,6 +88,14 @@
<source>About</source>
<translation>Sobre</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -115,6 +115,14 @@
<source>Back</source>
<translation>Назад</translation>
</message>
<message>
<source>Invite friends</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Invitation link copied to clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Kaidan</name>
......
......@@ -36,7 +36,8 @@
#include <QSettings>
#include <QString>
#include <QStandardPaths>
#include <QCoreApplication>
#include <QClipboard>
#include <QGuiApplication>
// Kaidan
#include "AvatarFileStorage.h"
#include "PresenceCache.h"
......@@ -282,3 +283,9 @@ void Kaidan::addOpenUri(QByteArray uri)
openUriCache = QString::fromUtf8(uri);
}
}
void Kaidan::copyToClipboard(QString text)
{
QClipboard *clipboard = QGuiApplication::clipboard();
clipboard->setText(text);
}
......@@ -267,6 +267,11 @@ public:
*/
void addOpenUri(QByteArray uri);
/**
* Copy text to the clipboard
*/
Q_INVOKABLE void copyToClipboard(QString text);
signals:
void rosterModelChanged();
void messageModelChanged();
......
......@@ -45,20 +45,28 @@ Kirigami.GlobalDrawer {
actions: [
Kirigami.Action {
text: qsTr("Log out")
iconName: "system-shutdown"
text: qsTr("Invite friends")
iconName: "mail-invitation"
onTriggered: {
// disconnect (open log in page)
kaidan.mainDisconnect(true);
kaidan.copyToClipboard("https://i.kaidan.im/#" + kaidan.jid)
passiveNotification(qsTr("Invitation link copied to clipboard"))
}
},
Kirigami.Action {
text: qsTr("About")
iconName: "help-about"
onTriggered: {
// open about sheet
aboutDialog.open();
}
}
Kirigami.Action {
text: qsTr("Log out")
iconName: "system-shutdown"
onTriggered: {
// disconnect (open log in page)
kaidan.mainDisconnect(true);
}
},
Kirigami.Action {
text: qsTr("About")
iconName: "help-about"
onTriggered: {
// open about sheet
aboutDialog.open();
}
}
]
}
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