mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
Chat settings: refactor chat settings
GitLab: #1369 Change-Id: I1bd9dfab7526a9cd0d84205817ab4eae951dba90
This commit is contained in:
parent
baeb90bced
commit
811a93cc27
9 changed files with 304 additions and 179 deletions
|
@ -844,4 +844,10 @@ Item {
|
||||||
property string donationText: qsTr("If you enjoy using Jami and believe in our mission, would you make a donation?")
|
property string donationText: qsTr("If you enjoy using Jami and believe in our mission, would you make a donation?")
|
||||||
property string notNow: qsTr("Not now")
|
property string notNow: qsTr("Not now")
|
||||||
property string enableDonation: qsTr("Enable donation campaign")
|
property string enableDonation: qsTr("Enable donation campaign")
|
||||||
|
|
||||||
|
//Chat setting page
|
||||||
|
property string enter: qsTr("ENTER")
|
||||||
|
property string shiftEnter: qsTr("SHIFT+ENTER")
|
||||||
|
property string textFormattingDescription: qsTr("ENTER or SHIFT+ENTER to insert a new line")
|
||||||
|
property string textFormatting: qsTr("Text formatting")
|
||||||
}
|
}
|
||||||
|
|
|
@ -492,6 +492,7 @@ Item {
|
||||||
|
|
||||||
// MessageBar
|
// MessageBar
|
||||||
property int messageBarMarginSize: 10
|
property int messageBarMarginSize: 10
|
||||||
|
property int messageBarMinimumWidth: 438
|
||||||
|
|
||||||
// InvitationView
|
// InvitationView
|
||||||
property real invitationViewAvatarSize: 112
|
property real invitationViewAvatarSize: 112
|
||||||
|
@ -666,4 +667,9 @@ Item {
|
||||||
function setTheme(dark) {
|
function setTheme(dark) {
|
||||||
darkTheme = dark;
|
darkTheme = dark;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Chat setting page
|
||||||
|
property color chatSettingButtonBackgroundColor: "#F0EFEF"
|
||||||
|
property color chatSettingButtonBorderColor: "#005699"
|
||||||
|
property color chatSettingButtonTextColor: "#000000"
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,12 +141,10 @@ RowLayout {
|
||||||
|
|
||||||
onWidthChanged: {
|
onWidthChanged: {
|
||||||
height = Qt.binding(() => root.height);
|
height = Qt.binding(() => root.height);
|
||||||
if (width < 468) {
|
if (width < JamiTheme.messageBarMinimumWidth) {
|
||||||
showTypoSecond = false;
|
showTypoSecond = false;
|
||||||
} else {
|
} else {
|
||||||
if (width >= 468) {
|
showTypoSecond = true;
|
||||||
showTypoSecond = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -307,6 +305,8 @@ RowLayout {
|
||||||
context: Qt.ApplicationShortcut
|
context: Qt.ApplicationShortcut
|
||||||
onActivated: {
|
onActivated: {
|
||||||
showTypo = !showTypo;
|
showTypo = !showTypo;
|
||||||
|
messageBarTextArea.isShowTypo = showTypo;
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.ShowMardownOption, showTypo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -761,7 +761,7 @@ RowLayout {
|
||||||
id: markdownPopup
|
id: markdownPopup
|
||||||
y: 1.5 * parent.height
|
y: 1.5 * parent.height
|
||||||
x: -parent.width * 2
|
x: -parent.width * 2
|
||||||
width: 155
|
width: 105
|
||||||
height: JamiTheme.chatViewFooterButtonSize
|
height: JamiTheme.chatViewFooterButtonSize
|
||||||
|
|
||||||
menuTypoActionsSecond: listViewTypoSecond.menuTypoActionsSecond
|
menuTypoActionsSecond: listViewTypoSecond.menuTypoActionsSecond
|
||||||
|
@ -817,20 +817,6 @@ RowLayout {
|
||||||
onTriggered: function clickAction() {
|
onTriggered: function clickAction() {
|
||||||
listViewTypo.addPrefixStyle(root.text, messageBarTextArea.selectionStart, messageBarTextArea.selectionEnd, "", true);
|
listViewTypo.addPrefixStyle(root.text, messageBarTextArea.selectionStart, messageBarTextArea.selectionEnd, "", true);
|
||||||
}
|
}
|
||||||
},
|
|
||||||
Action {
|
|
||||||
id: shiftEnterActiom
|
|
||||||
property var iconSrc: JamiResources.shift_enter_black_24dp_svg
|
|
||||||
property var shortcutText: chatViewEnterIsNewLine ? JamiStrings.enterNewLine : JamiStrings.shiftEnterNewLine
|
|
||||||
property var imageColor: chatViewEnterIsNewLine ? JamiTheme.chatViewFooterImgHoverColor : "#7f7f7f"
|
|
||||||
property var normalColor: chatViewEnterIsNewLine ? JamiTheme.hoveredButtonColor : JamiTheme.transparentColor
|
|
||||||
property var hasShortcut: false
|
|
||||||
property var shortcutKey: null
|
|
||||||
property bool isStyle: false
|
|
||||||
onTriggered: function clickAction() {
|
|
||||||
root.chatViewEnterIsNewLine = !root.chatViewEnterIsNewLine;
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.ChatViewEnterIsNewLine, chatViewEnterIsNewLine);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -906,17 +892,11 @@ RowLayout {
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
showTypo = !showTypo;
|
showTypo = !showTypo;
|
||||||
|
messageBarTextArea.isShowTypo = showTypo;
|
||||||
if (messageBar.width < messageBarLayoutMaximumWidth + sendMessageButton.width + 2 * JamiTheme.preferredMarginSize)
|
if (messageBar.width < messageBarLayoutMaximumWidth + sendMessageButton.width + 2 * JamiTheme.preferredMarginSize)
|
||||||
showTypoSecond = false;
|
showTypoSecond = false;
|
||||||
if (!showDefault)
|
if (!showDefault)
|
||||||
showDefault = true;
|
showDefault = true;
|
||||||
if (showTypo) {
|
|
||||||
root.chatViewEnterIsNewLine = true;
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.ChatViewEnterIsNewLine, true);
|
|
||||||
} else {
|
|
||||||
root.chatViewEnterIsNewLine = false;
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.ChatViewEnterIsNewLine, false);
|
|
||||||
}
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.ShowMardownOption, showTypo);
|
UtilsAdapter.setAppValue(Settings.Key.ShowMardownOption, showTypo);
|
||||||
UtilsAdapter.setAppValue(Settings.Key.ShowSendOption, !showDefault);
|
UtilsAdapter.setAppValue(Settings.Key.ShowSendOption, !showDefault);
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ JamiFlickable {
|
||||||
property alias selectionStart: textArea.selectionStart
|
property alias selectionStart: textArea.selectionStart
|
||||||
property alias selectionEnd: textArea.selectionEnd
|
property alias selectionEnd: textArea.selectionEnd
|
||||||
property bool showPreview: false
|
property bool showPreview: false
|
||||||
|
property bool isShowTypo: UtilsAdapter.getAppValue(Settings.Key.ShowMardownOption)
|
||||||
|
|
||||||
ScrollBar.vertical.visible: textArea.text
|
ScrollBar.vertical.visible: textArea.text
|
||||||
ScrollBar.horizontal.visible: textArea.text
|
ScrollBar.horizontal.visible: textArea.text
|
||||||
|
@ -206,7 +207,13 @@ JamiFlickable {
|
||||||
const isEnterNewLine = UtilsAdapter.getAppValue(Settings.Key.ChatViewEnterIsNewLine);
|
const isEnterNewLine = UtilsAdapter.getAppValue(Settings.Key.ChatViewEnterIsNewLine);
|
||||||
const isShiftPressed = (keyEvent.modifiers & Qt.ShiftModifier);
|
const isShiftPressed = (keyEvent.modifiers & Qt.ShiftModifier);
|
||||||
const isCtrlPressed = (keyEvent.modifiers & Qt.ControlModifier);
|
const isCtrlPressed = (keyEvent.modifiers & Qt.ControlModifier);
|
||||||
if (!isEnterNewLine && !isShiftPressed || isCtrlPressed) {
|
if (!root.isShowTypo && !isShiftPressed) {
|
||||||
|
root.sendMessagesRequired();
|
||||||
|
keyEvent.accepted = true;
|
||||||
|
} else if (isCtrlPressed) {
|
||||||
|
root.sendMessagesRequired();
|
||||||
|
keyEvent.accepted = true;
|
||||||
|
} else if (!isEnterNewLine && !isShiftPressed) {
|
||||||
root.sendMessagesRequired();
|
root.sendMessagesRequired();
|
||||||
keyEvent.accepted = true;
|
keyEvent.accepted = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,10 +70,10 @@ SidePanelBase {
|
||||||
"title": JamiStrings.appearance
|
"title": JamiStrings.appearance
|
||||||
}, {
|
}, {
|
||||||
"id": 7,
|
"id": 7,
|
||||||
"title": JamiStrings.locationSharingLabel
|
"title": JamiStrings.chatSettingsTitle
|
||||||
}, {
|
}, {
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"title": JamiStrings.fileTransfer
|
"title": JamiStrings.locationSharingLabel
|
||||||
}, {
|
}, {
|
||||||
"id": 9,
|
"id": 9,
|
||||||
"title": JamiStrings.callRecording
|
"title": JamiStrings.callRecording
|
||||||
|
|
|
@ -42,8 +42,8 @@ ListSelectionView {
|
||||||
"AdvancedSettingsPage": Qt.resolvedUrl("components/AdvancedSettingsPage.qml"),
|
"AdvancedSettingsPage": Qt.resolvedUrl("components/AdvancedSettingsPage.qml"),
|
||||||
"SystemSettingsPage": Qt.resolvedUrl("components/SystemSettingsPage.qml"),
|
"SystemSettingsPage": Qt.resolvedUrl("components/SystemSettingsPage.qml"),
|
||||||
"AppearanceSettingsPage": Qt.resolvedUrl("components/AppearanceSettingsPage.qml"),
|
"AppearanceSettingsPage": Qt.resolvedUrl("components/AppearanceSettingsPage.qml"),
|
||||||
|
"Chat": Qt.resolvedUrl("components/ChatSettingsPage.qml"),
|
||||||
"LocationSharingSettingsPage": Qt.resolvedUrl("components/LocationSharingSettingsPage.qml"),
|
"LocationSharingSettingsPage": Qt.resolvedUrl("components/LocationSharingSettingsPage.qml"),
|
||||||
"FileTransferSettingsPage": Qt.resolvedUrl("components/FileTransferSettingsPage.qml"),
|
|
||||||
"CallRecordingSettingsPage": Qt.resolvedUrl("components/CallRecordingSettingsPage.qml"),
|
"CallRecordingSettingsPage": Qt.resolvedUrl("components/CallRecordingSettingsPage.qml"),
|
||||||
"TroubleshootSettingsPage": Qt.resolvedUrl("components/TroubleshootSettingsPage.qml"),
|
"TroubleshootSettingsPage": Qt.resolvedUrl("components/TroubleshootSettingsPage.qml"),
|
||||||
"UpdateSettingsPage": Qt.resolvedUrl("components/UpdateSettingsPage.qml"),
|
"UpdateSettingsPage": Qt.resolvedUrl("components/UpdateSettingsPage.qml"),
|
||||||
|
@ -119,10 +119,10 @@ ListSelectionView {
|
||||||
replace(currentItem, viewNode.resources["AppearanceSettingsPage"], StackView.Immediate);
|
replace(currentItem, viewNode.resources["AppearanceSettingsPage"], StackView.Immediate);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
replace(currentItem, viewNode.resources["LocationSharingSettingsPage"], StackView.Immediate);
|
replace(currentItem, viewNode.resources["Chat"], StackView.Immediate);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
replace(currentItem, viewNode.resources["FileTransferSettingsPage"], StackView.Immediate);
|
replace(currentItem, viewNode.resources["LocationSharingSettingsPage"], StackView.Immediate);
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
replace(currentItem, viewNode.resources["CallRecordingSettingsPage"], StackView.Immediate);
|
replace(currentItem, viewNode.resources["CallRecordingSettingsPage"], StackView.Immediate);
|
||||||
|
|
|
@ -42,60 +42,6 @@ SettingsPageBase {
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: JamiTheme.preferredSettingsMarginSize
|
anchors.leftMargin: JamiTheme.preferredSettingsMarginSize
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
id: generalSettings
|
|
||||||
|
|
||||||
width: parent.width
|
|
||||||
spacing: JamiTheme.settingsCategorySpacing
|
|
||||||
|
|
||||||
Text {
|
|
||||||
id: enableAccountTitle
|
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignLeft
|
|
||||||
Layout.preferredWidth: parent.width
|
|
||||||
|
|
||||||
text: JamiStrings.generalSettingsTitle
|
|
||||||
color: JamiTheme.textColor
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
wrapMode: Text.WordWrap
|
|
||||||
|
|
||||||
font.pixelSize: JamiTheme.settingsTitlePixelSize
|
|
||||||
font.kerning: true
|
|
||||||
}
|
|
||||||
|
|
||||||
ToggleSwitch {
|
|
||||||
id: enableTypingIndicatorCheckbox
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
checked: UtilsAdapter.getAppValue(Settings.EnableTypingIndicator)
|
|
||||||
labelText: JamiStrings.enableTypingIndicator
|
|
||||||
descText: JamiStrings.enableTypingIndicatorDescription
|
|
||||||
tooltipText: JamiStrings.enableTypingIndicator
|
|
||||||
|
|
||||||
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.EnableTypingIndicator, checked)
|
|
||||||
}
|
|
||||||
|
|
||||||
ToggleSwitch {
|
|
||||||
id: displayImagesCheckbox
|
|
||||||
visible: WITH_WEBENGINE
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
checked: UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews)
|
|
||||||
|
|
||||||
labelText: JamiStrings.displayHyperlinkPreviews
|
|
||||||
descText: JamiStrings.displayHyperlinkPreviewsDescription
|
|
||||||
|
|
||||||
tooltipText: JamiStrings.displayHyperlinkPreviews
|
|
||||||
|
|
||||||
onSwitchToggled: {
|
|
||||||
UtilsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: themeSettings
|
id: themeSettings
|
||||||
|
|
||||||
|
@ -308,11 +254,7 @@ SettingsPageBase {
|
||||||
preferredWidth: defaultSettingsTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
|
preferredWidth: defaultSettingsTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
enableTypingIndicatorCheckbox.checked = UtilsAdapter.getDefault(Settings.Key.EnableTypingIndicator);
|
|
||||||
displayImagesCheckbox.checked = UtilsAdapter.getDefault(Settings.Key.DisplayHyperlinkPreviews);
|
|
||||||
zoomSpinBox.value = Math.round(UtilsAdapter.getDefault(Settings.BaseZoom) * 100.0);
|
zoomSpinBox.value = Math.round(UtilsAdapter.getDefault(Settings.BaseZoom) * 100.0);
|
||||||
UtilsAdapter.setToDefault(Settings.Key.EnableTypingIndicator);
|
|
||||||
UtilsAdapter.setToDefault(Settings.Key.DisplayHyperlinkPreviews);
|
|
||||||
UtilsAdapter.setToDefault(Settings.Key.AppTheme);
|
UtilsAdapter.setToDefault(Settings.Key.AppTheme);
|
||||||
UtilsAdapter.setToDefault(Settings.Key.BaseZoom);
|
UtilsAdapter.setToDefault(Settings.Key.BaseZoom);
|
||||||
themeSettings.isComplete();
|
themeSettings.isComplete();
|
||||||
|
|
273
src/app/settingsview/components/ChatSettingsPage.qml
Normal file
273
src/app/settingsview/components/ChatSettingsPage.qml
Normal file
|
@ -0,0 +1,273 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
||||||
|
* Author: Fadi Shehadeh <fadi.shehadeh@savoirfairelinux.com>
|
||||||
|
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
|
||||||
|
*
|
||||||
|
* 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import net.jami.Models 1.1
|
||||||
|
import net.jami.Adapters 1.1
|
||||||
|
import net.jami.Enums 1.1
|
||||||
|
import net.jami.Constants 1.1
|
||||||
|
import net.jami.Helpers 1.1
|
||||||
|
import "../../commoncomponents"
|
||||||
|
import "../../mainview/components"
|
||||||
|
import "../../mainview/js/contactpickercreation.js" as ContactPickerCreation
|
||||||
|
|
||||||
|
SettingsPageBase {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property int itemWidth: 188
|
||||||
|
title: JamiStrings.chatSettingsTitle
|
||||||
|
|
||||||
|
flickableContent: ColumnLayout {
|
||||||
|
id: callSettingsColumnLayout
|
||||||
|
|
||||||
|
anchors.topMargin: 10
|
||||||
|
width: contentFlickableWidth
|
||||||
|
spacing: 2 * JamiTheme.settingsCategorySpacing
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: JamiTheme.preferredSettingsMarginSize
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: generalSettings
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
spacing: JamiTheme.settingsCategorySpacing
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: enableAccountTitle
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
|
text: "View"
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
font.pixelSize: JamiTheme.settingsTitlePixelSize
|
||||||
|
font.kerning: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ToggleSwitch {
|
||||||
|
id: enableTypingIndicatorCheckbox
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
checked: UtilsAdapter.getAppValue(Settings.EnableTypingIndicator)
|
||||||
|
labelText: JamiStrings.enableTypingIndicator
|
||||||
|
descText: JamiStrings.enableTypingIndicatorDescription
|
||||||
|
tooltipText: JamiStrings.enableTypingIndicator
|
||||||
|
|
||||||
|
onSwitchToggled: UtilsAdapter.setAppValue(Settings.Key.EnableTypingIndicator, checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
ToggleSwitch {
|
||||||
|
id: displayImagesCheckbox
|
||||||
|
visible: WITH_WEBENGINE
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
checked: UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews)
|
||||||
|
|
||||||
|
labelText: JamiStrings.displayHyperlinkPreviews
|
||||||
|
descText: JamiStrings.displayHyperlinkPreviewsDescription
|
||||||
|
|
||||||
|
tooltipText: JamiStrings.displayHyperlinkPreviews
|
||||||
|
|
||||||
|
onSwitchToggled: {
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: textFormattingSettings
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
spacing: JamiTheme.settingsCategorySpacing
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: textFormattingTitle
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
|
text: JamiStrings.textFormatting
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
font.pixelSize: JamiTheme.settingsTitlePixelSize
|
||||||
|
font.kerning: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: textFormattingDescription
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
|
text: JamiStrings.textFormattingDescription
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Flow {
|
||||||
|
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
Layout.preferredHeight: childrenRect.height
|
||||||
|
spacing: 10
|
||||||
|
|
||||||
|
ButtonGroup {
|
||||||
|
id: optionsB
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialRadioButton {
|
||||||
|
id: enterButton
|
||||||
|
|
||||||
|
width: 120
|
||||||
|
height: 40
|
||||||
|
backgroundColor: JamiTheme.chatSettingButtonBackgroundColor
|
||||||
|
textColor: JamiTheme.chatSettingButtonTextColor
|
||||||
|
checkedColor: JamiTheme.chatSettingButtonBorderColor
|
||||||
|
borderColor: JamiTheme.chatSettingButtonBorderColor
|
||||||
|
|
||||||
|
text: JamiStrings.enter
|
||||||
|
ButtonGroup.group: optionsB
|
||||||
|
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked)
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.ChatViewEnterIsNewLine, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialRadioButton {
|
||||||
|
id: shiftEnterButton
|
||||||
|
|
||||||
|
width: 180
|
||||||
|
height: 40
|
||||||
|
backgroundColor: JamiTheme.chatSettingButtonBackgroundColor
|
||||||
|
textColor: JamiTheme.chatSettingButtonTextColor
|
||||||
|
checkedColor: JamiTheme.chatSettingButtonBorderColor
|
||||||
|
borderColor: JamiTheme.chatSettingButtonBorderColor
|
||||||
|
|
||||||
|
text: JamiStrings.shiftEnter
|
||||||
|
ButtonGroup.group: optionsB
|
||||||
|
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked)
|
||||||
|
UtilsAdapter.setAppValue(Settings.Key.ChatViewEnterIsNewLine, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
if (UtilsAdapter.getAppValue(Settings.Key.ChatViewEnterIsNewLine))
|
||||||
|
enterButton.checked = true;
|
||||||
|
else
|
||||||
|
shiftEnterButton.checked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: fileTransferSettings
|
||||||
|
|
||||||
|
width: parent.width
|
||||||
|
spacing: JamiTheme.settingsCategorySpacing
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: fileTransferTitle
|
||||||
|
|
||||||
|
Layout.alignment: Qt.AlignLeft
|
||||||
|
Layout.preferredWidth: parent.width
|
||||||
|
|
||||||
|
text: JamiStrings.fileTransfer
|
||||||
|
color: JamiTheme.textColor
|
||||||
|
horizontalAlignment: Text.AlignLeft
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
font.pixelSize: JamiTheme.settingsTitlePixelSize
|
||||||
|
font.kerning: true
|
||||||
|
}
|
||||||
|
|
||||||
|
ToggleSwitch {
|
||||||
|
id: autoAcceptFilesCheckbox
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
checked: CurrentAccount.autoTransferFromTrusted
|
||||||
|
labelText: JamiStrings.autoAcceptFiles
|
||||||
|
tooltipText: JamiStrings.autoAcceptFiles
|
||||||
|
onSwitchToggled: CurrentAccount.autoTransferFromTrusted = checked
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingSpinBox {
|
||||||
|
id: acceptTransferBelowSpinBox
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
title: JamiStrings.acceptTransferBelow
|
||||||
|
tooltipText: JamiStrings.acceptTransferTooltip
|
||||||
|
itemWidth: root.itemWidth
|
||||||
|
bottomValue: 0
|
||||||
|
|
||||||
|
valueField: CurrentAccount.autoTransferSizeThreshold
|
||||||
|
onNewValue: CurrentAccount.autoTransferSizeThreshold = valueField
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
MaterialButton {
|
||||||
|
id: defaultSettings
|
||||||
|
|
||||||
|
Layout.topMargin: 20
|
||||||
|
|
||||||
|
TextMetrics {
|
||||||
|
id: defaultSettingsTextSize
|
||||||
|
font.weight: Font.Bold
|
||||||
|
font.pixelSize: JamiTheme.wizardViewButtonFontPixelSize
|
||||||
|
font.capitalization: Font.AllUppercase
|
||||||
|
text: defaultSettings.text
|
||||||
|
}
|
||||||
|
|
||||||
|
secondary: true
|
||||||
|
|
||||||
|
text: JamiStrings.defaultSettings
|
||||||
|
preferredWidth: defaultSettingsTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
autoAcceptFilesCheckbox.checked = UtilsAdapter.getDefault(Settings.Key.AutoAcceptFiles);
|
||||||
|
acceptTransferBelowSpinBox.valueField = UtilsAdapter.getDefault(Settings.Key.AcceptTransferBelow);
|
||||||
|
UtilsAdapter.setToDefault(Settings.Key.AutoAcceptFiles);
|
||||||
|
UtilsAdapter.setToDefault(Settings.Key.AcceptTransferBelow);
|
||||||
|
UtilsAdapter.setToDefault(Settings.Key.EnableTypingIndicator);
|
||||||
|
UtilsAdapter.setToDefault(Settings.Key.ChatViewEnterIsNewLine);
|
||||||
|
UtilsAdapter.setToDefault(Settings.Key.DisplayHyperlinkPreviews);
|
||||||
|
enableTypingIndicatorCheckbox.checked = UtilsAdapter.getAppValue(Settings.EnableTypingIndicator);
|
||||||
|
displayImagesCheckbox.checked = UtilsAdapter.getAppValue(Settings.DisplayHyperlinkPreviews);
|
||||||
|
if (UtilsAdapter.getAppValue(Settings.Key.ChatViewEnterIsNewLine))
|
||||||
|
enterButton.checked = true;
|
||||||
|
else
|
||||||
|
shiftEnterButton.checked = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,89 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
|
||||||
* Author: Fadi Shehadeh <fadi.shehadeh@savoirfairelinux.com>
|
|
||||||
* Author: Sébastien Blin <sebastien.blin@savoirfairelinux.com>
|
|
||||||
*
|
|
||||||
* 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import net.jami.Models 1.1
|
|
||||||
import net.jami.Adapters 1.1
|
|
||||||
import net.jami.Enums 1.1
|
|
||||||
import net.jami.Constants 1.1
|
|
||||||
import net.jami.Helpers 1.1
|
|
||||||
import "../../commoncomponents"
|
|
||||||
|
|
||||||
SettingsPageBase {
|
|
||||||
id: root
|
|
||||||
|
|
||||||
property int itemWidth: 164
|
|
||||||
title: JamiStrings.fileTransfer
|
|
||||||
|
|
||||||
flickableContent: ColumnLayout {
|
|
||||||
id: callSettingsColumnLayout
|
|
||||||
|
|
||||||
width: contentFlickableWidth
|
|
||||||
spacing: JamiTheme.settingsCategorySpacing
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: JamiTheme.preferredSettingsMarginSize
|
|
||||||
|
|
||||||
ToggleSwitch {
|
|
||||||
id: autoAcceptFilesCheckbox
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
checked: CurrentAccount.autoTransferFromTrusted
|
|
||||||
labelText: JamiStrings.autoAcceptFiles
|
|
||||||
tooltipText: JamiStrings.autoAcceptFiles
|
|
||||||
onSwitchToggled: CurrentAccount.autoTransferFromTrusted = checked
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingSpinBox {
|
|
||||||
id: acceptTransferBelowSpinBox
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
title: JamiStrings.acceptTransferBelow
|
|
||||||
tooltipText: JamiStrings.acceptTransferTooltip
|
|
||||||
itemWidth: root.itemWidth
|
|
||||||
bottomValue: 0
|
|
||||||
|
|
||||||
valueField: CurrentAccount.autoTransferSizeThreshold
|
|
||||||
onNewValue: CurrentAccount.autoTransferSizeThreshold = valueField
|
|
||||||
}
|
|
||||||
|
|
||||||
MaterialButton {
|
|
||||||
id: defaultSettings
|
|
||||||
|
|
||||||
TextMetrics {
|
|
||||||
id: defaultSettingsTextSize
|
|
||||||
font.weight: Font.Bold
|
|
||||||
font.pixelSize: JamiTheme.wizardViewButtonFontPixelSize
|
|
||||||
font.capitalization: Font.AllUppercase
|
|
||||||
text: defaultSettings.text
|
|
||||||
}
|
|
||||||
|
|
||||||
secondary: true
|
|
||||||
|
|
||||||
text: JamiStrings.defaultSettings
|
|
||||||
preferredWidth: defaultSettingsTextSize.width + 2 * JamiTheme.buttontextWizzardPadding
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
autoAcceptFilesCheckbox.checked = UtilsAdapter.getDefault(Settings.Key.AutoAcceptFiles);
|
|
||||||
acceptTransferBelowSpinBox.valueField = UtilsAdapter.getDefault(Settings.Key.AcceptTransferBelow);
|
|
||||||
UtilsAdapter.setToDefault(Settings.Key.AutoAcceptFiles);
|
|
||||||
UtilsAdapter.setToDefault(Settings.Key.AcceptTransferBelow);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue