diff --git a/linphone-app/src/components/settings/SettingsModel.cpp b/linphone-app/src/components/settings/SettingsModel.cpp index 634a2470f..92ab848a7 100644 --- a/linphone-app/src/components/settings/SettingsModel.cpp +++ b/linphone-app/src/components/settings/SettingsModel.cpp @@ -1745,6 +1745,14 @@ bool SettingsModel::getShowHomePage() const { return !!mConfig->getInt(UiSection, "show_home_page", true); } +bool SettingsModel::getShowHomeInviteButton() const { + return !!mConfig->getInt(UiSection, "show_home_invite_button", true); +} + +QString SettingsModel::getDefaultOtherSipAccountDomain() const { + return Utils::coreStringToAppString(mConfig->getString(UiSection, "default_other_sip_account_domain", "")); +} + bool SettingsModel::isMipmapEnabled() const{ return !!mConfig->getInt(UiSection, "mipmap_enabled", 0); } diff --git a/linphone-app/src/components/settings/SettingsModel.hpp b/linphone-app/src/components/settings/SettingsModel.hpp index b7c9bdf82..509b4687c 100644 --- a/linphone-app/src/components/settings/SettingsModel.hpp +++ b/linphone-app/src/components/settings/SettingsModel.hpp @@ -220,6 +220,8 @@ class SettingsModel : public QObject { Q_PROPERTY(bool showLocalSipAccount READ getShowLocalSipAccount CONSTANT) Q_PROPERTY(bool showStartChatButton READ getShowStartChatButton CONSTANT) Q_PROPERTY(bool showStartVideoCallButton READ getShowStartVideoCallButton CONSTANT) + Q_PROPERTY(bool showHomeInviteButton READ getShowHomeInviteButton CONSTANT) + Q_PROPERTY(QString defaultOtherSipAccountDomain READ getDefaultOtherSipAccountDomain CONSTANT) Q_PROPERTY(bool mipmapEnabled READ isMipmapEnabled WRITE setMipmapEnabled NOTIFY mipmapEnabledChanged) Q_PROPERTY(bool useMinimalTimelineFilter READ useMinimalTimelineFilter WRITE setUseMinimalTimelineFilter NOTIFY useMinimalTimelineFilterChanged) @@ -628,6 +630,9 @@ public: Q_INVOKABLE int getShowDefaultPage() const; // -1 : default Q_INVOKABLE int getShowForcedAssistantPage() const; // -1 : no force Q_INVOKABLE bool getShowHomePage() const; + Q_INVOKABLE bool getShowHomeInviteButton() const; + Q_INVOKABLE QString getDefaultOtherSipAccountDomain() const; + bool isMipmapEnabled() const; void setMipmapEnabled(const bool& enabled); diff --git a/linphone-app/ui/modules/Linphone/Blocks/CardBlock.qml b/linphone-app/ui/modules/Linphone/Blocks/CardBlock.qml index 8aa752acf..b1da4abff 100644 --- a/linphone-app/ui/modules/Linphone/Blocks/CardBlock.qml +++ b/linphone-app/ui/modules/Linphone/Blocks/CardBlock.qml @@ -14,7 +14,7 @@ Column { // --------------------------------------------------------------------------- spacing: CardBlockStyle.spacing - width: CardBlockStyle.width + width: visible ? CardBlockStyle.width : 0 Icon { id: icon diff --git a/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml index 7a99322a0..78aa2c626 100644 --- a/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml +++ b/linphone-app/ui/modules/Linphone/Styles/Blocks/CardBlockStyle.qml @@ -23,7 +23,7 @@ QtObject { property QtObject icon: QtObject { property int bottomMargin: 20 - property int size: 148 + property int size: 140 } property QtObject title: QtObject { diff --git a/linphone-app/ui/views/App/Main/Assistant/UseOtherSipAccount.qml b/linphone-app/ui/views/App/Main/Assistant/UseOtherSipAccount.qml index 9113c9d98..d645c8a0b 100644 --- a/linphone-app/ui/views/App/Main/Assistant/UseOtherSipAccount.qml +++ b/linphone-app/ui/views/App/Main/Assistant/UseOtherSipAccount.qml @@ -143,6 +143,7 @@ import Common.Styles 1.0 TextField { id: sipDomain + text: SettingsModel.getDefaultOtherSipAccountDomain() } } } diff --git a/linphone-app/ui/views/App/Main/Home.qml b/linphone-app/ui/views/App/Main/Home.qml index 8ab01ef8e..aaae8763d 100644 --- a/linphone-app/ui/views/App/Main/Home.qml +++ b/linphone-app/ui/views/App/Main/Home.qml @@ -31,54 +31,49 @@ Rectangle { spacing: HomeStyle.spacing height: parent.height + width: { - var width = CardBlockStyle.width * count + (count - 1) * spacing + var itemCount = 0; + for(var i = 0 ; i < count ; ++i) + if(model[i].$visible) + ++itemCount; + var width = CardBlockStyle.width * itemCount + (itemCount - 1) * spacing return parent.width < width ? parent.width : width } - model: ListModel { - // TODO: Uncomment me when smart tooltip will be available. - // ListElement { - // $component: 'checkBox' - // $componentText: qsTr('showTooltips') - // $description: qsTr('howToDescription') - // $icon: 'home_use_linphone' - // $title: qsTr('howToTitle') - // } - - ListElement { - $component: 'button' - $componentText: qsTr('inviteButton') - $description: qsTr('inviteDescription') - $view: 'InviteFriends' - $icon: 'home_invite_friends' - $title: qsTr('inviteTitle') - } - - ListElement { - $component: 'button' - $componentText: qsTr('assistantButton') - $description: qsTr('accountAssistantDescription') - $icon: 'home_account_assistant' - $title: qsTr('accountAssistantTitle') - $view: 'Assistant' - } - } + model: [{ + $component: 'button', + $componentText: qsTr('inviteButton'), + $description: qsTr('inviteDescription'), + $view: 'InviteFriends', + $icon: 'home_invite_friends', + $title: qsTr('inviteTitle'), + $visible: SettingsModel.getShowHomeInviteButton() + },{ + $component: 'button', + $componentText: qsTr('assistantButton'), + $description: qsTr('accountAssistantDescription'), + $icon: 'home_account_assistant', + $title: qsTr('accountAssistantTitle'), + $view: 'Assistant', + $visible: true + }] delegate: CardBlock { anchors.verticalCenter: parent.verticalCenter - description: $description.replace('%1', Utils.capitalizeFirstLetter(Qt.application.name)) - icon: $icon - title: $title.replace('%1', Qt.application.name.toUpperCase()) - + description: modelData.$description.replace('%1', Utils.capitalizeFirstLetter(Qt.application.name)) + icon: modelData.$icon + title: modelData.$title.replace('%1', Qt.application.name.toUpperCase()) + visible: modelData.$visible + Loader { Component { id: button TextButtonB { - text: $componentText - onClicked: window.setView($view) + text: modelData.$componentText + onClicked: window.setView(modelData.$view) } } @@ -86,12 +81,12 @@ Rectangle { id: checkBox CheckBoxText { - text: $componentText + text: modelData.$componentText } } anchors.horizontalCenter: parent.horizontalCenter - sourceComponent: $component === 'button' ? button : checkBox + sourceComponent: modelData.$component === 'button' ? button : checkBox } } } diff --git a/linphone-app/ui/views/App/Main/MainWindow.qml b/linphone-app/ui/views/App/Main/MainWindow.qml index d6fd8105d..3b86da049 100644 --- a/linphone-app/ui/views/App/Main/MainWindow.qml +++ b/linphone-app/ui/views/App/Main/MainWindow.qml @@ -192,6 +192,7 @@ ApplicationWindow { id: smartSearchBar Layout.fillWidth: true + Layout.maximumWidth: parent.width - telKeypad.width - x maxMenuHeight: MainWindowStyle.searchBox.maxHeight placeholderText: qsTr('mainSearchBarPlaceholder')