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

View file

@ -284,6 +284,7 @@ public:
DECLARE_CORE_GETSET_MEMBER(bool, disableChatFeature, DisableChatFeature)
DECLARE_CORE_GETSET_MEMBER(bool, disableMeetingsFeature, DisableMeetingsFeature)
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, hideAccountSettings, HideAccountSettings)
DECLARE_CORE_GETSET_MEMBER(bool, disableCallRecordings, DisableCallRecordings)

View file

@ -1043,6 +1043,8 @@ DEFINE_GETSET_CONFIG(SettingsModel,
DisableBroadcastFeature,
"disable_broadcast_feature",
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, hideAccountSettings, HideAccountSettings, "hide_account_settings", false)

View file

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

View file

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

View file

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

View file

@ -237,42 +237,29 @@ AbstractMainPage {
}
}
}
Rectangle {
visible: SettingsCpp.callForwardToAddress.length > 0
Layout.fillWidth: true
Layout.preferredHeight: Utils.getSizeWithScreenRatio(40)
Layout.topMargin: Utils.getSizeWithScreenRatio(18)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
color: "transparent"
radius: Utils.getSizeWithScreenRatio(25)
border.color: DefaultStyle.warning_500_main
border.width: Utils.getSizeWithScreenRatio(2)
Button {
visible: SettingsCpp.callForwardToAddress.length > 0 && !SettingsCpp.disableCallForward
Layout.fillWidth: true
Layout.preferredHeight: Utils.getSizeWithScreenRatio(40)
Layout.topMargin: Utils.getSizeWithScreenRatio(18)
Layout.rightMargin: Utils.getSizeWithScreenRatio(39)
radius: Utils.getSizeWithScreenRatio(25)
color: "transparent"
borderColor: DefaultStyle.warning_500_main
borderWidth: Utils.getSizeWithScreenRatio(2)
text: qsTr("call_forward_to_address_info") + (SettingsCpp.callForwardToAddress == 'voicemail' ? qsTr("call_forward_to_address_info_voicemail") : SettingsCpp.callForwardToAddress)
textColor: DefaultStyle.warning_500_main
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)
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)
color: DefaultStyle.warning_500_main
font: Typography.p1
}
}
MouseArea {
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
onClicked: {
goToCallForwardSettings()
}
}
}
onClicked: {
goToCallForwardSettings()
}
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true