mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-24 16:53:51 +02:00
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
This commit is contained in:
parent
0996b167d9
commit
60617a280c
4 changed files with 81 additions and 1 deletions
|
@ -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
|
||||
|
|
59
src/app/mainview/components/GenericErrorsRow.qml
Normal file
59
src/app/mainview/components/GenericErrorsRow.qml
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* 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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue