disable call forward setting

fix button ui
This commit is contained in:
Gaelle Braud 2026-03-12 16:05:05 +01:00
parent c32f2a1c00
commit 1188c5dd30
7 changed files with 45 additions and 42 deletions

View file

@ -124,6 +124,7 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
INIT_CORE_MEMBER(DisableMeetingsFeature, settingsModel) INIT_CORE_MEMBER(DisableMeetingsFeature, settingsModel)
INIT_CORE_MEMBER(ShowPastMeetings, settingsModel) INIT_CORE_MEMBER(ShowPastMeetings, settingsModel)
INIT_CORE_MEMBER(DisableBroadcastFeature, settingsModel) INIT_CORE_MEMBER(DisableBroadcastFeature, settingsModel)
INIT_CORE_MEMBER(DisableCallForward, settingsModel)
INIT_CORE_MEMBER(HideSettings, settingsModel) INIT_CORE_MEMBER(HideSettings, settingsModel)
INIT_CORE_MEMBER(HideAccountSettings, settingsModel) INIT_CORE_MEMBER(HideAccountSettings, settingsModel)
INIT_CORE_MEMBER(DisableCallRecordings, settingsModel) INIT_CORE_MEMBER(DisableCallRecordings, settingsModel)
@ -204,6 +205,7 @@ SettingsCore::SettingsCore(const SettingsCore &settingsCore) {
mDisableMeetingsFeature = settingsCore.mDisableMeetingsFeature; mDisableMeetingsFeature = settingsCore.mDisableMeetingsFeature;
mShowPastMeetings = settingsCore.mShowPastMeetings; mShowPastMeetings = settingsCore.mShowPastMeetings;
mDisableBroadcastFeature = settingsCore.mDisableBroadcastFeature; mDisableBroadcastFeature = settingsCore.mDisableBroadcastFeature;
mDisableCallForward = settingsCore.mDisableCallForward;
mHideSettings = settingsCore.mHideSettings; mHideSettings = settingsCore.mHideSettings;
mHideAccountSettings = settingsCore.mHideAccountSettings; mHideAccountSettings = settingsCore.mHideAccountSettings;
mHideFps = settingsCore.mHideFps; mHideFps = settingsCore.mHideFps;
@ -317,6 +319,7 @@ void SettingsCore::reloadSettings() {
setDisableMeetingsFeature(settingsModel->getDisableMeetingsFeature()); setDisableMeetingsFeature(settingsModel->getDisableMeetingsFeature());
setShowPastMeetings(settingsModel->getShowPastMeetings()); setShowPastMeetings(settingsModel->getShowPastMeetings());
setDisableBroadcastFeature(settingsModel->getDisableBroadcastFeature()); setDisableBroadcastFeature(settingsModel->getDisableBroadcastFeature());
setDisableCallForward(settingsModel->getDisableCallForward());
setHideSettings(settingsModel->getHideSettings()); setHideSettings(settingsModel->getHideSettings());
setHideAccountSettings(settingsModel->getHideAccountSettings()); setHideAccountSettings(settingsModel->getHideAccountSettings());
@ -571,6 +574,8 @@ void SettingsCore::setSelf(QSharedPointer<SettingsCore> me) {
showPastMeetings, ShowPastMeetings) showPastMeetings, ShowPastMeetings)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool,
disableBroadcastFeature, DisableBroadcastFeature) disableBroadcastFeature, DisableBroadcastFeature)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool,
disableCallForward, DisableCallForward)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool, hideSettings, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool, hideSettings,
HideSettings) HideSettings)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, settingsModel, bool,
@ -697,6 +702,7 @@ void SettingsCore::reset(const SettingsCore &settingsCore) {
setDisableMeetingsFeature(settingsCore.mDisableMeetingsFeature); setDisableMeetingsFeature(settingsCore.mDisableMeetingsFeature);
setShowPastMeetings(settingsCore.mShowPastMeetings); setShowPastMeetings(settingsCore.mShowPastMeetings);
setDisableBroadcastFeature(settingsCore.mDisableBroadcastFeature); setDisableBroadcastFeature(settingsCore.mDisableBroadcastFeature);
setDisableCallForward(settingsCore.mDisableCallForward);
setHideSettings(settingsCore.mHideSettings); setHideSettings(settingsCore.mHideSettings);
setHideAccountSettings(settingsCore.mHideAccountSettings); setHideAccountSettings(settingsCore.mHideAccountSettings);
setHideFps(settingsCore.mHideFps); setHideFps(settingsCore.mHideFps);
@ -1323,6 +1329,7 @@ void SettingsCore::writeIntoModel(std::shared_ptr<SettingsModel> model) const {
model->setDisableMeetingsFeature(mDisableMeetingsFeature); model->setDisableMeetingsFeature(mDisableMeetingsFeature);
model->setShowPastMeetings(mShowPastMeetings); model->setShowPastMeetings(mShowPastMeetings);
model->setDisableBroadcastFeature(mDisableBroadcastFeature); model->setDisableBroadcastFeature(mDisableBroadcastFeature);
model->setDisableCallForward(mDisableCallForward);
model->setHideSettings(mHideSettings); model->setHideSettings(mHideSettings);
model->setHideAccountSettings(mHideAccountSettings); model->setHideAccountSettings(mHideAccountSettings);
model->setHideFps(mHideFps); model->setHideFps(mHideFps);
@ -1407,6 +1414,7 @@ void SettingsCore::writeFromModel(const std::shared_ptr<SettingsModel> &model) {
mDisableMeetingsFeature = model->getDisableMeetingsFeature(); mDisableMeetingsFeature = model->getDisableMeetingsFeature();
mShowPastMeetings = model->getShowPastMeetings(); mShowPastMeetings = model->getShowPastMeetings();
mDisableBroadcastFeature = model->getDisableBroadcastFeature(); mDisableBroadcastFeature = model->getDisableBroadcastFeature();
mDisableCallForward = model->getDisableCallForward();
mHideSettings = model->getHideSettings(); mHideSettings = model->getHideSettings();
mHideAccountSettings = model->getHideAccountSettings(); mHideAccountSettings = model->getHideAccountSettings();
mHideFps = model->getHideFps(); mHideFps = model->getHideFps();

View file

@ -284,6 +284,7 @@ public:
DECLARE_CORE_GETSET_MEMBER(bool, disableChatFeature, DisableChatFeature) DECLARE_CORE_GETSET_MEMBER(bool, disableChatFeature, DisableChatFeature)
DECLARE_CORE_GETSET_MEMBER(bool, disableMeetingsFeature, DisableMeetingsFeature) DECLARE_CORE_GETSET_MEMBER(bool, disableMeetingsFeature, DisableMeetingsFeature)
DECLARE_CORE_GETSET_MEMBER(bool, disableBroadcastFeature, DisableBroadcastFeature) DECLARE_CORE_GETSET_MEMBER(bool, disableBroadcastFeature, DisableBroadcastFeature)
DECLARE_CORE_GETSET_MEMBER(bool, disableCallForward, DisableCallForward)
DECLARE_CORE_GETSET_MEMBER(bool, hideSettings, HideSettings) DECLARE_CORE_GETSET_MEMBER(bool, hideSettings, HideSettings)
DECLARE_CORE_GETSET_MEMBER(bool, hideAccountSettings, HideAccountSettings) DECLARE_CORE_GETSET_MEMBER(bool, hideAccountSettings, HideAccountSettings)
DECLARE_CORE_GETSET_MEMBER(bool, disableCallRecordings, DisableCallRecordings) DECLARE_CORE_GETSET_MEMBER(bool, disableCallRecordings, DisableCallRecordings)

View file

@ -1043,6 +1043,8 @@ DEFINE_GETSET_CONFIG(SettingsModel,
DisableBroadcastFeature, DisableBroadcastFeature,
"disable_broadcast_feature", "disable_broadcast_feature",
true) true)
DEFINE_GETSET_CONFIG(SettingsModel, bool, Bool, disableCallForward, DisableCallForward, "disable_call_forward", true)
DEFINE_GETSET_CONFIG(SettingsModel, bool, Bool, hideSettings, HideSettings, "hide_settings", false) DEFINE_GETSET_CONFIG(SettingsModel, bool, Bool, hideSettings, HideSettings, "hide_settings", false)
DEFINE_GETSET_CONFIG( DEFINE_GETSET_CONFIG(
SettingsModel, bool, Bool, hideAccountSettings, HideAccountSettings, "hide_account_settings", false) SettingsModel, bool, Bool, hideAccountSettings, HideAccountSettings, "hide_account_settings", false)

View file

@ -208,6 +208,7 @@ public:
// UI // UI
DECLARE_GETSET(bool, disableChatFeature, DisableChatFeature) DECLARE_GETSET(bool, disableChatFeature, DisableChatFeature)
DECLARE_GETSET(bool, disableBroadcastFeature, DisableBroadcastFeature) DECLARE_GETSET(bool, disableBroadcastFeature, DisableBroadcastFeature)
DECLARE_GETSET(bool, disableCallForward, DisableCallForward)
DECLARE_GETSET(bool, hideSettings, HideSettings) DECLARE_GETSET(bool, hideSettings, HideSettings)
DECLARE_GETSET(bool, hideAccountSettings, HideAccountSettings) DECLARE_GETSET(bool, hideAccountSettings, HideAccountSettings)
DECLARE_GETSET(bool, hideFps, HideFps) DECLARE_GETSET(bool, hideFps, HideFps)

View file

@ -161,6 +161,7 @@ Control.Button {
contentItem: Control.StackView { contentItem: Control.StackView {
id: stacklayout id: stacklayout
anchors.centerIn: parent
function updateComponent(){ function updateComponent(){
var item var item
var component = mainItem.text.length != 0 && mainItem.icon.source.toString().length != 0 var component = mainItem.text.length != 0 && mainItem.icon.source.toString().length != 0
@ -194,18 +195,21 @@ Control.Button {
id: imageTextComponent id: imageTextComponent
// Workaround for centering the content when its // Workaround for centering the content when its
// width is smaller than the button width // width is smaller than the button width
Item {
implicitWidth: content.implicitWidth
implicitHeight: content.implicitHeight
RowLayout { RowLayout {
id: content id: content
width: stacklayout.width
height: stacklayout.height
RowLayout {
Layout.alignment: Qt.AlignCenter
spacing: mainItem.spacing spacing: mainItem.spacing
anchors.centerIn: parent
ButtonImage{ ButtonImage{
id: image
Layout.preferredWidth: mainItem.icon.width Layout.preferredWidth: mainItem.icon.width
Layout.preferredHeight: mainItem.icon.height Layout.preferredHeight: mainItem.icon.height
} }
ButtonText { ButtonText {
Layout.maximumWidth: content.width - image.width - content.spacing
Layout.preferredWidth: implicitWidth
} }
} }
} }

View file

@ -14,7 +14,7 @@ AbstractSettingsMenu {
//: "Appels" //: "Appels"
{title: qsTr("settings_calls_title"), layout: "CallSettingsLayout"}, {title: qsTr("settings_calls_title"), layout: "CallSettingsLayout"},
//: "Transfert d'appel" //: "Transfert d'appel"
{title: qsTr("settings_call_forward"), layout: "CallForwardSettingsLayout"}, {title: qsTr("settings_call_forward"), layout: "CallForwardSettingsLayout", visible: !SettingsCpp.disableCallForward},
//: "Conversations" //: "Conversations"
{title: qsTr("settings_conversations_title"), layout: "ChatSettingsLayout", visible: !SettingsCpp.disableChatFeature}, {title: qsTr("settings_conversations_title"), layout: "ChatSettingsLayout", visible: !SettingsCpp.disableChatFeature},
//: "Contacts" //: "Contacts"

View file

@ -237,42 +237,29 @@ AbstractMainPage {
} }
} }
} }
Rectangle { Button {
visible: SettingsCpp.callForwardToAddress.length > 0 visible: SettingsCpp.callForwardToAddress.length > 0 && !SettingsCpp.disableCallForward
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: Utils.getSizeWithScreenRatio(40) Layout.preferredHeight: Utils.getSizeWithScreenRatio(40)
Layout.topMargin: Utils.getSizeWithScreenRatio(18) Layout.topMargin: Utils.getSizeWithScreenRatio(18)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39) Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
color: "transparent"
radius: Utils.getSizeWithScreenRatio(25) radius: Utils.getSizeWithScreenRatio(25)
border.color: DefaultStyle.warning_500_main color: "transparent"
border.width: Utils.getSizeWithScreenRatio(2) borderColor: DefaultStyle.warning_500_main
borderWidth: Utils.getSizeWithScreenRatio(2)
RowLayout {
anchors.centerIn: parent
spacing: Utils.getSizeWithScreenRatio(10)
EffectImage {
fillMode: Image.PreserveAspectFit
imageSource: AppIcons.callForward
colorizationColor: DefaultStyle.warning_500_main
Layout.preferredHeight: Utils.getSizeWithScreenRatio(24)
Layout.preferredWidth: Utils.getSizeWithScreenRatio(24)
}
Text {
text: qsTr("call_forward_to_address_info") + (SettingsCpp.callForwardToAddress == 'voicemail' ? qsTr("call_forward_to_address_info_voicemail") : SettingsCpp.callForwardToAddress) text: qsTr("call_forward_to_address_info") + (SettingsCpp.callForwardToAddress == 'voicemail' ? qsTr("call_forward_to_address_info_voicemail") : SettingsCpp.callForwardToAddress)
color: DefaultStyle.warning_500_main textColor: DefaultStyle.warning_500_main
font: Typography.p1 textSize: Typography.p1.pixelSize
} textWeight: Typography.p1.weight
} icon.source: AppIcons.callForward
contentImageColor: DefaultStyle.warning_500_main
icon.width: Utils.getSizeWithScreenRatio(24)
icon.height: Utils.getSizeWithScreenRatio(24)
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: { onClicked: {
goToCallForwardSettings() goToCallForwardSettings()
} }
} }
}
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true