Skip to content
Snippets Groups Projects
Commit 60617a28 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

misc: improve UX when disconnected/disabled

Show a notification in the conversation like Anroid when the account
is disabled or when there is no network connectivity

Change-Id: I0f875fd24a2b29b8f7f48746651b156451e1250f
parent 0996b167
Branches
Tags
No related merge requests found
......@@ -305,6 +305,8 @@ Item {
property string showPlugins: qsTr("Show available plugins")
property string addToConversations: qsTr("Add to conversations")
property string backendError: qsTr("This is the error from the backend: %0")
property string disabledAccount: qsTr("The account is disabled")
property string noNetworkConnectivity: qsTr("No network connectivity")
// Chatview footer
property string jumpToLatest: qsTr("Jump to latest")
......
......@@ -136,6 +136,25 @@ Rectangle {
}
}
Connections {
target: CurrentConversation
enabled: LRCInstance.debugMode()
function onErrorsChanged() {
if (CurrentConversation.errors.length > 0) {
errorRect.errorLabel.text = CurrentConversation.errors[0]
errorRect.backendErrorToolTip.text = JamiStrings.backendError.arg(CurrentConversation.backendErrors[0])
}
errorRect.visible = CurrentConversation.errors.length > 0
}
}
GenericErrorsRow {
id: genericError
Layout.fillWidth: true
Layout.preferredHeight: JamiTheme.chatViewHeaderPreferredHeight
}
ConversationErrorsRow {
id: errorRect
Layout.fillWidth: true
......
/*
* Copyright (C) 2022 Savoir-faire Linux Inc.
*
* This program 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.
*
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import Qt5Compat.GraphicalEffects
import net.jami.Models 1.1
import net.jami.Adapters 1.1
import net.jami.Constants 1.1
import "../../commoncomponents"
Rectangle {
id: root
opacity: visible
property alias text: errorLabel.text
color: JamiTheme.filterBadgeColor
visible: CurrentAccount.status === Account.Status.UNREGISTERED
RowLayout {
anchors.fill: parent
anchors.margins: JamiTheme.preferredMarginSize
Text {
id: errorLabel
Layout.alignment: Qt.AlignVCenter
text: CurrentAccount.enabled? JamiStrings.noNetworkConnectivity : JamiStrings.disabledAccount
color: JamiTheme.filterBadgeTextColor
font.pixelSize: JamiTheme.headerFontSize
elide: Text.ElideRight
}
}
Behavior on opacity {
NumberAnimation {
from: 0
duration: JamiTheme.shortFadeDuration
}
}
}
\ No newline at end of file
......@@ -1649,7 +1649,7 @@ CallModelPimpl::slotConferenceCreated(const QString& accountId, const QString& c
void
CallModelPimpl::slotConferenceChanged(const QString& accountId,
const QString& confId,
const QString& state)
const QString&)
{
if (accountId != linked.owner.id)
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment