diff options
-rw-r--r-- | message.cpp | 6 | ||||
-rw-r--r-- | message.h | 2 | ||||
-rw-r--r-- | qml/ComposePane.qml | 18 | ||||
-rw-r--r-- | qml/Message.qml | 23 | ||||
-rw-r--r-- | qml/main.qml | 2 |
5 files changed, 34 insertions, 17 deletions
diff --git a/message.cpp b/message.cpp index 6d02db1..89fafca 100644 --- a/message.cpp +++ b/message.cpp @@ -130,6 +130,12 @@ DcMessage::getFilemime() return result; } +QString +DcMessage::getVideochatUrl() +{ + return dc_msg_get_videochat_url(m_message); +} + int DcMessage::getWidth() { @@ -21,6 +21,7 @@ class DcMessage : public QObject { Q_PROPERTY(QString file READ getFile WRITE setFile) Q_PROPERTY(QString fileReadOnly READ getFile CONSTANT) Q_PROPERTY(QString filename READ getFilename CONSTANT) + Q_PROPERTY(QString videochatUrl READ getVideochatUrl CONSTANT) Q_PROPERTY(int width READ getWidth CONSTANT) Q_PROPERTY(int height READ getHeight CONSTANT) Q_PROPERTY(bool showPadlock READ getShowPadlock CONSTANT) @@ -52,6 +53,7 @@ public: Q_INVOKABLE QString getText(); Q_INVOKABLE QString getSubject(); QString getFile(); + QString getVideochatUrl(); QString getFilename(); QString getFilemime(); //uint64_t getFilebytes(); diff --git a/qml/ComposePane.qml b/qml/ComposePane.qml index b2fcf88..d1140ba 100644 --- a/qml/ComposePane.qml +++ b/qml/ComposePane.qml @@ -84,12 +84,6 @@ Pane { else attachFileDialog.open(); } - - action: Action { - shortcut: "Ctrl+O" - onTriggered: attachButton.click() - } - } TextArea { @@ -129,22 +123,14 @@ Pane { text: qsTr("Send") enabled: messageField.length > 0 | attachFileUrl.length > 0 onClicked: { + sendButton.down = true; let msg = root.createMessage(); root.context.sendMessage(root.chatId, msg); + sendButton.down = false; attachFileUrl = ""; messageField.text = ""; root.context.setDraft(chatId, null); } - - action: Action { - shortcut: "Ctrl+S" - onTriggered: { - if (sendButton.enabled == true) - sendButton.click(); - - } - } - } Button { diff --git a/qml/Message.qml b/qml/Message.qml index 37a7546..2798d95 100644 --- a/qml/Message.qml +++ b/qml/Message.qml @@ -276,6 +276,28 @@ RowLayout { } + Component { + id: videoChatView + ColumnLayout { + Loader { + sourceComponent: textMessageView + } + + Button { + text: "Join conference call" + icon.name: "call-start" + Layout.preferredWidth: root.width + Layout.maximumWidth: root.width + hoverEnabled: true + ToolTip.visible: hovered + ToolTip.text: "<u>"+root.message.videochatUrl+"</u>" + //Layout.leftMargin: 30 + //Layout.rightMargin: 30 + onClicked: Qt.openUrlExternally(root.message.videochatUrl) + } + } + } + // This is what show the display name in top of every messages Component { id: textMessageView @@ -347,6 +369,7 @@ RowLayout { : [40, 41].includes(root.message.viewtype) ? audioMessageView : [50].includes(root.message.viewtype) ? videoMessageView : [60].includes(root.message.viewtype) ? anyFileView + : [70].includes(root.message.viewtype) ? videoChatView : textMessageView } diff --git a/qml/main.qml b/qml/main.qml index fc49bb9..f0798fd 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -135,7 +135,7 @@ Kirigami.ApplicationWindow { font.pixelSize: 14 }, Text { - text: "<b>F1</b>: Displays this" + "<br><b>F2</b>: Work on/offline" + "<br><b>F5</b>: Network check" + "<br><b>Shift+S</b>: Account settings" + "<br><b>Alt+C</b>: Clear search" + "<br><b>Alt+Tab</b>: Switch accounts" + "<br><b>Ctrl+F</b>: Search contacts" + "<br><b>Ctrl+N</b>: New chat" + "<br><b>Ctrl+S</b>: Send message" + "<br><b>Ctrl+Tab</b>: Show sidebar" + "<br><b>Ctrl+Q</b>: Quit" + text: "<b>F1</b>: Displays this" + "<br><b>F2</b>: Work on/offline" + "<br><b>F5</b>: Network check" + "<br><b>Shift+Tab</b>: Account settings" + "<br><b>Alt+C</b>: Clear search" + "<br><b>Alt+Tab</b>: Switch accounts" + "<br><b>Ctrl+F</b>: Search contacts" + "<br><b>Ctrl+N</b>: New chat" + "<br><b>Ctrl+S</b>: Send message" + "<br><b>Ctrl+Tab</b>: Show sidebar" + "<br><b>Ctrl+Q</b>: Quit" topPadding: 20 leftPadding: 10 bottomPadding: 20 |