Commit 21cb2767 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(MainWindow): supports account status

parent c0bb3fcb
# ==================================================================== # ====================================================================
# languages/CMakeLists.txt # assets/languages/CMakeLists.txt
# ==================================================================== # ====================================================================
# This line prevent `.ts` files deletion. # This line prevent `.ts` files deletion.
......
...@@ -216,6 +216,10 @@ ...@@ -216,6 +216,10 @@
<source>contactsEntry</source> <source>contactsEntry</source>
<translation>Contacts</translation> <translation>Contacts</translation>
</message> </message>
<message>
<source>autoAnswerStatus</source>
<translation>auto</translation>
</message>
</context> </context>
<context> <context>
<name>ManageAccounts</name> <name>ManageAccounts</name>
......
...@@ -216,6 +216,10 @@ ...@@ -216,6 +216,10 @@
<source>contactsEntry</source> <source>contactsEntry</source>
<translation>Contacts</translation> <translation>Contacts</translation>
</message> </message>
<message>
<source>autoAnswerStatus</source>
<translation>auto</translation>
</message>
</context> </context>
<context> <context>
<name>ManageAccounts</name> <name>ManageAccounts</name>
......
...@@ -26,3 +26,7 @@ Presence::PresenceStatus AccountSettingsModel::getPresenceStatus () const { ...@@ -26,3 +26,7 @@ Presence::PresenceStatus AccountSettingsModel::getPresenceStatus () const {
QString AccountSettingsModel::getSipAddress () const { QString AccountSettingsModel::getSipAddress () const {
return QString("e.miller@sip-linphone.org"); return QString("e.miller@sip-linphone.org");
} }
bool AccountSettingsModel::getAutoAnswerStatus () const {
return true;
}
...@@ -34,6 +34,12 @@ class AccountSettingsModel : public QObject { ...@@ -34,6 +34,12 @@ class AccountSettingsModel : public QObject {
CONSTANT CONSTANT
); );
Q_PROPERTY(
bool autoAnswerStatus
READ getAutoAnswerStatus
CONSTANT
);
public: public:
AccountSettingsModel (QObject *parent = Q_NULLPTR); AccountSettingsModel (QObject *parent = Q_NULLPTR);
...@@ -45,6 +51,8 @@ private: ...@@ -45,6 +51,8 @@ private:
Presence::PresenceStatus getPresenceStatus () const; Presence::PresenceStatus getPresenceStatus () const;
QString getSipAddress () const; QString getSipAddress () const;
bool getAutoAnswerStatus () const;
}; };
#endif // ACCOUNT_SETTINGS_MODEL_H_ #endif // ACCOUNT_SETTINGS_MODEL_H_
...@@ -31,14 +31,16 @@ QtObject { ...@@ -31,14 +31,16 @@ QtObject {
// OK. // OK.
// ----------------------------------------------------------------- // -----------------------------------------------------------------
property color g: '#6B7A86' property color c: '#CBCBCB'
property color g10: '#1A6b7a86' property color g: '#6B7A86'
property color g20: '#336b7a86' property color g10: '#1A6B7A86'
property color h: '#687680' property color g20: '#336B7A86'
property color i: '#FE5E00' property color h: '#687680'
property color j: '#4B5964' property color i: '#FE5E00'
property color j: '#4B5964'
property color j75: '#BF4B5964' property color j75: '#BF4B5964'
property color k: '#FFFFFF' property color k: '#FFFFFF'
property color k50: '#32FFFFFF' property color k50: '#32FFFFFF'
property color u: '#B1B1B1' property color u: '#B1B1B1'
property color v: '#E2E2E2'
} }
...@@ -57,6 +57,29 @@ ApplicationWindow { ...@@ -57,6 +57,29 @@ ApplicationWindow {
Layout.preferredWidth: MainWindowStyle.accountStatus.width Layout.preferredWidth: MainWindowStyle.accountStatus.width
} }
Column {
width: MainWindowStyle.autoAnswerStatus.width
Icon {
icon: AccountSettingsModel.autoAnswerStatus
? 'auto_answer_active'
: 'auto_answer_inactive'
iconSize: MainWindowStyle.autoAnswerStatus.iconSize
}
Text {
clip: true
font {
pointSize: MainWindowStyle.autoAnswerStatus.text.fontSize
}
text: qsTr('autoAnswerStatus')
width: parent.width
color: AccountSettingsModel.autoAnswerStatus
? MainWindowStyle.autoAnswerStatus.text.color.enabled
: MainWindowStyle.autoAnswerStatus.text.color.disabled
}
}
SearchBox { SearchBox {
id: searchBox id: searchBox
...@@ -127,7 +150,7 @@ ApplicationWindow { ...@@ -127,7 +150,7 @@ ApplicationWindow {
Timeline { Timeline {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
model: ContactsListModel {} model: ContactsListModel {} // Use History list.
} }
} }
......
pragma Singleton pragma Singleton
import QtQuick 2.7 import QtQuick 2.7
import Common 1.0
// =================================================================== // ===================================================================
QtObject { QtObject {
...@@ -12,6 +14,20 @@ QtObject { ...@@ -12,6 +14,20 @@ QtObject {
property int width: 200 property int width: 200
} }
property QtObject autoAnswerStatus: QtObject {
property int iconSize: 13
property int width: 24
property QtObject text: QtObject {
property int fontSize: 8
property QtObject color: QtObject {
property color enabled: Colors.i
property color disabled: Colors.c
}
}
}
property QtObject menu: QtObject { property QtObject menu: QtObject {
property int entryHeight: 50 property int entryHeight: 50
property int width: 250 property int width: 250
...@@ -29,7 +45,7 @@ QtObject { ...@@ -29,7 +45,7 @@ QtObject {
property int spacing: 20 property int spacing: 20
property var background: Rectangle { property var background: Rectangle {
color: '#E2E2E2' color: Colors.v
} }
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment