diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f4f1a7ba4..2f8acfe02 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -32,7 +32,6 @@ set(SOURCES
src/components/contacts/ContactsListModel.cpp
src/components/contacts/ContactsListProxyModel.cpp
src/components/notification/Notification.cpp
- src/components/settings/AccountSettingsListModel.cpp
src/components/settings/AccountSettingsModel.cpp
src/components/settings/SettingsModel.cpp
src/logger.cpp
@@ -46,7 +45,6 @@ set(HEADERS
src/components/contacts/ContactsListProxyModel.hpp
src/components/notification/Notification.hpp
src/components/presence/Presence.hpp
- src/components/settings/AccountSettingsListModel.hpp
src/components/settings/AccountSettingsModel.hpp
src/components/settings/SettingsModel.hpp
src/logger.hpp
@@ -56,7 +54,7 @@ set(QRC_RESOURCES
resources.qrc
)
-set(LANGUAGES_DIRECTORY languages)
+set(LANGUAGES_DIRECTORY assets/languages)
set(I18N_FILENAME i18n.qrc)
set(LANGUAGES en fr)
diff --git a/tests/assets/images/auto_answer_active.svg b/tests/assets/images/auto_answer_active.svg
new file mode 100644
index 000000000..9d3e4c878
--- /dev/null
+++ b/tests/assets/images/auto_answer_active.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/auto_answer_inactive.svg b/tests/assets/images/auto_answer_inactive.svg
new file mode 100644
index 000000000..4751e1c0c
--- /dev/null
+++ b/tests/assets/images/auto_answer_inactive.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/call_hovered.svg b/tests/assets/images/call_hovered.svg
new file mode 100644
index 000000000..a41351654
--- /dev/null
+++ b/tests/assets/images/call_hovered.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/call_normal.svg b/tests/assets/images/call_normal.svg
new file mode 100644
index 000000000..0bab66f77
--- /dev/null
+++ b/tests/assets/images/call_normal.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/call_pressed.svg b/tests/assets/images/call_pressed.svg
new file mode 100644
index 000000000..8d26c8b71
--- /dev/null
+++ b/tests/assets/images/call_pressed.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/chevron_green.svg b/tests/assets/images/chevron_green.svg
new file mode 100644
index 000000000..a1cfb74ab
--- /dev/null
+++ b/tests/assets/images/chevron_green.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/chevron_orange.svg b/tests/assets/images/chevron_orange.svg
new file mode 100644
index 000000000..60e37c283
--- /dev/null
+++ b/tests/assets/images/chevron_orange.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/chevron_red.svg b/tests/assets/images/chevron_red.svg
new file mode 100644
index 000000000..3332d4311
--- /dev/null
+++ b/tests/assets/images/chevron_red.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/chevron_white.svg b/tests/assets/images/chevron_white.svg
new file mode 100644
index 000000000..6a0e645c3
--- /dev/null
+++ b/tests/assets/images/chevron_white.svg
@@ -0,0 +1,13 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/collapse.svg b/tests/assets/images/collapse.svg
new file mode 100644
index 000000000..aa34c7c00
--- /dev/null
+++ b/tests/assets/images/collapse.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/contact_normal.svg b/tests/assets/images/contact_normal.svg
new file mode 100644
index 000000000..f429be3bd
--- /dev/null
+++ b/tests/assets/images/contact_normal.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/contact_selected.svg b/tests/assets/images/contact_selected.svg
new file mode 100644
index 000000000..61833222b
--- /dev/null
+++ b/tests/assets/images/contact_selected.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/history.svg b/tests/assets/images/history.svg
new file mode 100644
index 000000000..bfba0d0e1
--- /dev/null
+++ b/tests/assets/images/history.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/home_normal.svg b/tests/assets/images/home_normal.svg
new file mode 100644
index 000000000..33bf3cf08
--- /dev/null
+++ b/tests/assets/images/home_normal.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/home_selected.svg b/tests/assets/images/home_selected.svg
new file mode 100644
index 000000000..953dc8bfe
--- /dev/null
+++ b/tests/assets/images/home_selected.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/led_green.svg b/tests/assets/images/led_green.svg
new file mode 100644
index 000000000..0b52ba0d5
--- /dev/null
+++ b/tests/assets/images/led_green.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/led_orange.svg b/tests/assets/images/led_orange.svg
new file mode 100644
index 000000000..ec43d7553
--- /dev/null
+++ b/tests/assets/images/led_orange.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/led_red.svg b/tests/assets/images/led_red.svg
new file mode 100644
index 000000000..fe18567ef
--- /dev/null
+++ b/tests/assets/images/led_red.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/led_white.svg b/tests/assets/images/led_white.svg
new file mode 100644
index 000000000..bc3132dd3
--- /dev/null
+++ b/tests/assets/images/led_white.svg
@@ -0,0 +1,18 @@
+
+
\ No newline at end of file
diff --git a/tests/imgs/linphone.png b/tests/assets/images/linphone.png
similarity index 100%
rename from tests/imgs/linphone.png
rename to tests/assets/images/linphone.png
diff --git a/tests/assets/images/search.svg b/tests/assets/images/search.svg
new file mode 100644
index 000000000..d72633397
--- /dev/null
+++ b/tests/assets/images/search.svg
@@ -0,0 +1,12 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/video_call_hovered.svg b/tests/assets/images/video_call_hovered.svg
new file mode 100644
index 000000000..81b4c9ad1
--- /dev/null
+++ b/tests/assets/images/video_call_hovered.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/video_call_normal.svg b/tests/assets/images/video_call_normal.svg
new file mode 100644
index 000000000..b6d8b5ed6
--- /dev/null
+++ b/tests/assets/images/video_call_normal.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/images/video_call_pressed.svg b/tests/assets/images/video_call_pressed.svg
new file mode 100644
index 000000000..b6d2500ab
--- /dev/null
+++ b/tests/assets/images/video_call_pressed.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/languages/CMakeLists.txt b/tests/assets/languages/CMakeLists.txt
similarity index 100%
rename from tests/languages/CMakeLists.txt
rename to tests/assets/languages/CMakeLists.txt
diff --git a/tests/languages/en.ts b/tests/assets/languages/en.ts
similarity index 100%
rename from tests/languages/en.ts
rename to tests/assets/languages/en.ts
diff --git a/tests/languages/fr.ts b/tests/assets/languages/fr.ts
similarity index 100%
rename from tests/languages/fr.ts
rename to tests/assets/languages/fr.ts
diff --git a/tests/imgs/add_field.svg b/tests/assets/old_images/add_field.svg
similarity index 100%
rename from tests/imgs/add_field.svg
rename to tests/assets/old_images/add_field.svg
diff --git a/tests/imgs/call.svg b/tests/assets/old_images/call.svg
similarity index 100%
rename from tests/imgs/call.svg
rename to tests/assets/old_images/call.svg
diff --git a/tests/imgs/cam.svg b/tests/assets/old_images/cam.svg
similarity index 100%
rename from tests/imgs/cam.svg
rename to tests/assets/old_images/cam.svg
diff --git a/tests/imgs/cat_contact.jpg b/tests/assets/old_images/cat_contact.jpg
similarity index 100%
rename from tests/imgs/cat_contact.jpg
rename to tests/assets/old_images/cat_contact.jpg
diff --git a/tests/imgs/chat.svg b/tests/assets/old_images/chat.svg
similarity index 100%
rename from tests/imgs/chat.svg
rename to tests/assets/old_images/chat.svg
diff --git a/tests/imgs/chat_attachment.svg b/tests/assets/old_images/chat_attachment.svg
similarity index 100%
rename from tests/imgs/chat_attachment.svg
rename to tests/assets/old_images/chat_attachment.svg
diff --git a/tests/imgs/collapse.svg b/tests/assets/old_images/collapse.svg
similarity index 100%
rename from tests/imgs/collapse.svg
rename to tests/assets/old_images/collapse.svg
diff --git a/tests/imgs/conference.svg b/tests/assets/old_images/conference.svg
similarity index 100%
rename from tests/imgs/conference.svg
rename to tests/assets/old_images/conference.svg
diff --git a/tests/imgs/contact.svg b/tests/assets/old_images/contact.svg
similarity index 100%
rename from tests/imgs/contact.svg
rename to tests/assets/old_images/contact.svg
diff --git a/tests/imgs/contacts_list.svg b/tests/assets/old_images/contacts_list.svg
similarity index 100%
rename from tests/imgs/contacts_list.svg
rename to tests/assets/old_images/contacts_list.svg
diff --git a/tests/imgs/delete.svg b/tests/assets/old_images/delete.svg
similarity index 100%
rename from tests/imgs/delete.svg
rename to tests/assets/old_images/delete.svg
diff --git a/tests/imgs/hangup.svg b/tests/assets/old_images/hangup.svg
similarity index 100%
rename from tests/imgs/hangup.svg
rename to tests/assets/old_images/hangup.svg
diff --git a/tests/imgs/history.svg b/tests/assets/old_images/history.svg
similarity index 100%
rename from tests/imgs/history.svg
rename to tests/assets/old_images/history.svg
diff --git a/tests/imgs/home.svg b/tests/assets/old_images/home.svg
similarity index 100%
rename from tests/imgs/home.svg
rename to tests/assets/old_images/home.svg
diff --git a/tests/imgs/incoming_call.svg b/tests/assets/old_images/incoming_call.svg
similarity index 100%
rename from tests/imgs/incoming_call.svg
rename to tests/assets/old_images/incoming_call.svg
diff --git a/tests/imgs/led_green.svg b/tests/assets/old_images/led_green.svg
similarity index 100%
rename from tests/imgs/led_green.svg
rename to tests/assets/old_images/led_green.svg
diff --git a/tests/imgs/led_orange.svg b/tests/assets/old_images/led_orange.svg
similarity index 100%
rename from tests/imgs/led_orange.svg
rename to tests/assets/old_images/led_orange.svg
diff --git a/tests/imgs/led_red.svg b/tests/assets/old_images/led_red.svg
similarity index 100%
rename from tests/imgs/led_red.svg
rename to tests/assets/old_images/led_red.svg
diff --git a/tests/imgs/led_white.svg b/tests/assets/old_images/led_white.svg
similarity index 100%
rename from tests/imgs/led_white.svg
rename to tests/assets/old_images/led_white.svg
diff --git a/tests/imgs/lost_incoming_call.svg b/tests/assets/old_images/lost_incoming_call.svg
similarity index 100%
rename from tests/imgs/lost_incoming_call.svg
rename to tests/assets/old_images/lost_incoming_call.svg
diff --git a/tests/imgs/lost_outgoing_call.svg b/tests/assets/old_images/lost_outgoing_call.svg
similarity index 100%
rename from tests/imgs/lost_outgoing_call.svg
rename to tests/assets/old_images/lost_outgoing_call.svg
diff --git a/tests/imgs/micro.svg b/tests/assets/old_images/micro.svg
similarity index 100%
rename from tests/imgs/micro.svg
rename to tests/assets/old_images/micro.svg
diff --git a/tests/imgs/right_arrow.svg b/tests/assets/old_images/right_arrow.svg
similarity index 100%
rename from tests/imgs/right_arrow.svg
rename to tests/assets/old_images/right_arrow.svg
diff --git a/tests/imgs/speaker.svg b/tests/assets/old_images/speaker.svg
similarity index 100%
rename from tests/imgs/speaker.svg
rename to tests/assets/old_images/speaker.svg
diff --git a/tests/imgs/valid.svg b/tests/assets/old_images/valid.svg
similarity index 100%
rename from tests/imgs/valid.svg
rename to tests/assets/old_images/valid.svg
diff --git a/tests/assets/ressources_svg/avatar_L.svg b/tests/assets/ressources_svg/avatar_L.svg
new file mode 100644
index 000000000..2d1335ae5
--- /dev/null
+++ b/tests/assets/ressources_svg/avatar_L.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/ressources_svg/avatar_s.svg b/tests/assets/ressources_svg/avatar_s.svg
new file mode 100644
index 000000000..2105b3aa5
--- /dev/null
+++ b/tests/assets/ressources_svg/avatar_s.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/ressources_svg/avatar_xs.svg b/tests/assets/ressources_svg/avatar_xs.svg
new file mode 100644
index 000000000..da2b5a335
--- /dev/null
+++ b/tests/assets/ressources_svg/avatar_xs.svg
@@ -0,0 +1,23 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/ressources_svg/chat_clic.svg b/tests/assets/ressources_svg/chat_clic.svg
new file mode 100644
index 000000000..a66c4971b
--- /dev/null
+++ b/tests/assets/ressources_svg/chat_clic.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/ressources_svg/chat_default.svg b/tests/assets/ressources_svg/chat_default.svg
new file mode 100644
index 000000000..dd5e5408c
--- /dev/null
+++ b/tests/assets/ressources_svg/chat_default.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/assets/ressources_svg/chat_over.svg b/tests/assets/ressources_svg/chat_over.svg
new file mode 100644
index 000000000..18c5cf6aa
--- /dev/null
+++ b/tests/assets/ressources_svg/chat_over.svg
@@ -0,0 +1,15 @@
+
+
\ No newline at end of file
diff --git a/tests/resources.qrc b/tests/resources.qrc
index 6a9c3a51f..c056a8060 100644
--- a/tests/resources.qrc
+++ b/tests/resources.qrc
@@ -1,31 +1,60 @@
- imgs/add_field.svg
- imgs/call.svg
- imgs/cam.svg
- imgs/cat_contact.jpg
- imgs/chat_attachment.svg
- imgs/chat.svg
- imgs/collapse.svg
- imgs/conference.svg
- imgs/contacts_list.svg
- imgs/contact.svg
- imgs/delete.svg
- imgs/hangup.svg
- imgs/history.svg
- imgs/home.svg
- imgs/incoming_call.svg
- imgs/led_green.svg
- imgs/led_orange.svg
- imgs/led_red.svg
- imgs/led_white.svg
- imgs/linphone.png
- imgs/lost_incoming_call.svg
- imgs/lost_outgoing_call.svg
- imgs/micro.svg
- imgs/right_arrow.svg
- imgs/speaker.svg
- imgs/valid.svg
+ assets/images/auto_answer_active.svg
+ assets/images/auto_answer_inactive.svg
+ assets/images/call_hovered.svg
+ assets/images/call_normal.svg
+ assets/images/call_pressed.svg
+ assets/images/chevron_green.svg
+ assets/images/chevron_orange.svg
+ assets/images/chevron_red.svg
+ assets/images/chevron_white.svg
+ assets/images/collapse.svg
+ assets/images/contact_normal.svg
+ assets/images/contact_selected.svg
+ assets/images/history.svg
+ assets/images/home_normal.svg
+ assets/images/home_selected.svg
+ assets/images/led_green.svg
+ assets/images/led_orange.svg
+ assets/images/led_red.svg
+ assets/images/led_white.svg
+ assets/images/linphone.png
+ assets/images/search.svg
+ assets/images/video_call_hovered.svg
+ assets/images/video_call_normal.svg
+ assets/images/video_call_pressed.svg
+ assets/old_images/add_field.svg
+ assets/old_images/call.svg
+ assets/old_images/cam.svg
+ assets/old_images/cat_contact.jpg
+ assets/old_images/chat_attachment.svg
+ assets/old_images/chat.svg
+ assets/old_images/collapse.svg
+ assets/old_images/conference.svg
+ assets/old_images/contacts_list.svg
+ assets/old_images/contact.svg
+ assets/old_images/delete.svg
+ assets/old_images/hangup.svg
+ assets/old_images/history.svg
+ assets/old_images/home.svg
+ assets/old_images/incoming_call.svg
+ assets/old_images/led_green.svg
+ assets/old_images/led_orange.svg
+ assets/old_images/led_red.svg
+ assets/old_images/led_white.svg
+ assets/old_images/lost_incoming_call.svg
+ assets/old_images/lost_outgoing_call.svg
+ assets/old_images/micro.svg
+ assets/old_images/right_arrow.svg
+ assets/old_images/speaker.svg
+ assets/old_images/valid.svg
+ assets/ressources_svg/avatar_L.svg
+ assets/ressources_svg/avatar_s.svg
+ assets/ressources_svg/avatar_xs.svg
+ assets/ressources_svg/chat_clic.svg
+ assets/ressources_svg/chat_default.svg
+ assets/ressources_svg/chat_over.svg
ui/modules/Common/Animations/CaterpillarAnimation.qml
ui/modules/Common/Borders.qml
ui/modules/Common/Collapse.qml
@@ -81,6 +110,7 @@
ui/modules/Common/Styles/qmldir
ui/modules/Common/Styles/SearchBoxStyle.qml
ui/modules/Common/View/ScrollableListView.qml
+ ui/modules/Linphone/Account/AccountStatus.qml
ui/modules/Linphone/Call/CallControls.qml
ui/modules/Linphone/Chat/Chat.qml
ui/modules/Linphone/Chat/Event.qml
@@ -93,6 +123,7 @@
ui/modules/Linphone/Contact/PresenceLevel.qml
ui/modules/Linphone/qmldir
ui/modules/Linphone/Select/SelectContact.qml
+ ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml
ui/modules/Linphone/Styles/Contact/AvatarStyle.qml
ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml
ui/modules/Linphone/Styles/Contact/ContactStyle.qml
@@ -101,16 +132,19 @@
ui/modules/Linphone/Timeline.qml
ui/scripts/Utils/qmldir
ui/scripts/Utils/utils.js
- ui/views/Calls/Calls.qml
- ui/views/Calls/StartingCall.qml
- ui/views/Calls/StartingIncomingCall.qml
- ui/views/Calls/StartingOutgoingCall.qml
- ui/views/MainWindow/Contact.qml
- ui/views/MainWindow/Contacts.qml
- ui/views/MainWindow/Conversation.qml
- ui/views/MainWindow/Home.qml
- ui/views/MainWindow/MainWindow.qml
- ui/views/ManageAccounts.qml
- ui/views/NewCall.qml
+ ui/views/App/Calls/Calls.qml
+ ui/views/App/Calls/StartingCall.qml
+ ui/views/App/Calls/StartingIncomingCall.qml
+ ui/views/App/Calls/StartingOutgoingCall.qml
+ ui/views/App/MainWindow/Contact.qml
+ ui/views/App/MainWindow/Contacts.qml
+ ui/views/App/MainWindow/Conversation.qml
+ ui/views/App/MainWindow/Home.qml
+ ui/views/App/MainWindow/MainWindow.qml
+ ui/views/App/ManageAccounts.qml
+ ui/views/App/NewCall.qml
+ ui/views/App/qmldir
+ ui/views/App/Styles/MainWindow/MainWindowStyle.qml
+ ui/views/App/Styles/qmldir
diff --git a/tests/src/app.cpp b/tests/src/app.cpp
index c14c61acb..8101f3714 100644
--- a/tests/src/app.cpp
+++ b/tests/src/app.cpp
@@ -18,5 +18,5 @@ App::App (int &argc, char **argv) : QApplication(argc, argv) {
qWarning() << "No translation found.";
}
- this->setWindowIcon(QIcon(":/imgs/linphone.png"));
+ this->setWindowIcon(QIcon(":/assets/images/linphone.png"));
}
diff --git a/tests/src/components/settings/AccountSettingsListModel.cpp b/tests/src/components/settings/AccountSettingsListModel.cpp
deleted file mode 100644
index 182d2cfab..000000000
--- a/tests/src/components/settings/AccountSettingsListModel.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-#include "AccountSettingsListModel.hpp"
-
-// ===================================================================
-
-AccountSettingsListModel::AccountSettingsListModel (QObject *parent) :
- QObject(parent) {
-}
-
-int AccountSettingsListModel::getDefaultAccount () const {
- return 1;
-}
-
-void AccountSettingsListModel::setDefaultAccount (int index) {
- // NOTHING TODO.
- (void)index;
-}
diff --git a/tests/src/components/settings/AccountSettingsListModel.hpp b/tests/src/components/settings/AccountSettingsListModel.hpp
deleted file mode 100644
index 7ab41b8b7..000000000
--- a/tests/src/components/settings/AccountSettingsListModel.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef ACCOUNT_SETTINGS_LIST_MODEL_H_
-#define ACCOUNT_SETTINGS_LIST_MODEL_H_
-
-#include
-
-// ===================================================================
-
-class AccountSettingsListModel : public QObject {
- Q_OBJECT
-
- Q_PROPERTY(int index
- READ getDefaultAccount
- WRITE setDefaultAccount);
-
-public:
- AccountSettingsListModel (QObject *parent = Q_NULLPTR);
-
-private:
- int getDefaultAccount () const;
- void setDefaultAccount (int index);
-};
-
-#endif
diff --git a/tests/src/components/settings/AccountSettingsModel.cpp b/tests/src/components/settings/AccountSettingsModel.cpp
index 545321b44..e35e76072 100644
--- a/tests/src/components/settings/AccountSettingsModel.cpp
+++ b/tests/src/components/settings/AccountSettingsModel.cpp
@@ -1,7 +1,5 @@
#include "AccountSettingsModel.hpp"
-typedef AccountSettingsModel::Presence Presence;
-
// ===================================================================
AccountSettingsModel::AccountSettingsModel (QObject *parent) :
@@ -9,7 +7,7 @@ AccountSettingsModel::AccountSettingsModel (QObject *parent) :
}
QString AccountSettingsModel::getUsername () const {
- return "Toto";
+ return "Edward Miller ";
}
void AccountSettingsModel::setUsername (const QString &username) {
@@ -17,12 +15,14 @@ void AccountSettingsModel::setUsername (const QString &username) {
(void)username;
}
-
-Presence AccountSettingsModel::getPresence () const {
- return Presence::Away;
+Presence::PresenceLevel AccountSettingsModel::getPresenceLevel () const {
+ return Presence::Green;
}
-void AccountSettingsModel::setPresence (Presence presence) {
- // NOTHING TODO.
- (void)presence;
+Presence::PresenceStatus AccountSettingsModel::getPresenceStatus () const {
+ return Presence::Online;
+}
+
+QString AccountSettingsModel::getSipAddress () const {
+ return QString("e.miller@sip-linphone.org");
}
diff --git a/tests/src/components/settings/AccountSettingsModel.hpp b/tests/src/components/settings/AccountSettingsModel.hpp
index a891cc476..ffd4925c0 100644
--- a/tests/src/components/settings/AccountSettingsModel.hpp
+++ b/tests/src/components/settings/AccountSettingsModel.hpp
@@ -3,6 +3,8 @@
#include
+#include "../presence/Presence.hpp"
+
// ===================================================================
class AccountSettingsModel : public QObject {
@@ -15,35 +17,34 @@ class AccountSettingsModel : public QObject {
);
Q_PROPERTY(
- Presence presence
- READ getPresence
- WRITE setPresence
+ QString sipAddress
+ READ getSipAddress
+ CONSTANT
+ );
+
+ Q_PROPERTY(
+ Presence::PresenceLevel presenceLevel
+ READ getPresenceLevel
+ CONSTANT
+ );
+
+ Q_PROPERTY(
+ Presence::PresenceStatus presenceStatus
+ READ getPresenceStatus
+ CONSTANT
);
public:
- // See: https://tools.ietf.org/html/rfc4480#section-3.2
- // Activities, section 3.2 of RFC 4480
- enum Presence {
- Away,
- BeRightBack,
- Busy,
- DoNotDisturb,
- Moved,
- Offline,
- OnThePhone,
- Online,
- OutToLunch,
- UsingAnotherMessagingService
- };
-
AccountSettingsModel (QObject *parent = Q_NULLPTR);
private:
QString getUsername () const;
void setUsername (const QString &username);
- Presence getPresence () const;
- void setPresence (Presence presence);
+ Presence::PresenceLevel getPresenceLevel () const;
+ Presence::PresenceStatus getPresenceStatus () const;
+
+ QString getSipAddress () const;
};
#endif // ACCOUNT_SETTINGS_MODEL_H_
diff --git a/tests/src/main.cpp b/tests/src/main.cpp
index 1317e34fb..b49b3340d 100644
--- a/tests/src/main.cpp
+++ b/tests/src/main.cpp
@@ -10,6 +10,7 @@
#include "app.hpp"
#include "components/contacts/ContactsListProxyModel.hpp"
#include "components/notification/Notification.hpp"
+#include "components/settings/AccountSettingsModel.hpp"
#include "logger.hpp"
// ===================================================================
@@ -42,7 +43,7 @@ void setTrayIcon (QQmlApplicationEngine &engine) {
menu->addAction(quit_action);
tray_icon->setContextMenu(menu);
- tray_icon->setIcon(QIcon(":/imgs/linphone.png"));
+ tray_icon->setIcon(QIcon(":/assets/images/linphone.png"));
tray_icon->setToolTip("Linphone");
tray_icon->show();
}
@@ -58,15 +59,20 @@ void registerTypes () {
void addContextProperties (QQmlApplicationEngine &engine) {
QQmlContext *context = engine.rootContext();
- QQmlComponent component(&engine, QUrl("qrc:/ui/views/Calls/Calls.qml"));
-
- context->setContextProperty("Notification", new Notification());
+ QQmlComponent component(&engine, QUrl("qrc:/ui/views/App/Calls/Calls.qml"));
+ // Windows.
if (component.isError()) {
qWarning() << component.errors();
} else {
context->setContextProperty("CallsWindow", component.create());
}
+
+ // Models.
+ context->setContextProperty("AccountSettingsModel", new AccountSettingsModel());
+
+ // Other.
+ context->setContextProperty("Notification", new Notification());
}
// ===================================================================
@@ -87,8 +93,13 @@ int main (int argc, char *argv[]) {
// Set modules paths.
engine.addImportPath(":/ui/modules");
engine.addImportPath(":/ui/scripts");
+ engine.addImportPath(":/ui/views");
- engine.load(QUrl("qrc:/ui/views/MainWindow/MainWindow.qml"));
+ // Load context properties.
+ addContextProperties(engine);
+
+ // Load main view.
+ engine.load(QUrl("qrc:/ui/views/App/MainWindow/MainWindow.qml"));
if (engine.rootObjects().isEmpty()) {
qWarning() << "Unable to open main window.";
return EXIT_FAILURE;
@@ -100,8 +111,6 @@ int main (int argc, char *argv[]) {
else
setTrayIcon(engine);
- addContextProperties(engine);
-
// Run!
return app.exec();
}
diff --git a/tests/tools/update_resources b/tests/tools/update_resources
index ac09e3c9f..0548423ce 100755
--- a/tests/tools/update_resources
+++ b/tests/tools/update_resources
@@ -18,7 +18,7 @@ cd $SCRIPT_DIR/..
echo '
' > $RESOURCES_FILE
-for filename in $(find ui/ imgs/ -type f | sort)
+for filename in $(find ui/ assets/ -type f | sort)
do
basename="${filename##*/}"
extension="${filename##*.}"
diff --git a/tests/ui/modules/Common/Collapse.qml b/tests/ui/modules/Common/Collapse.qml
index 961c9e414..c2a9c9b13 100644
--- a/tests/ui/modules/Common/Collapse.qml
+++ b/tests/ui/modules/Common/Collapse.qml
@@ -25,6 +25,9 @@ Item {
// -----------------------------------------------------------------
+ implicitWidth: button.iconSize
+ implicitHeight: button.iconSize
+
ActionButton {
id: button
@@ -32,6 +35,7 @@ Item {
background: CollapseStyle.background
icon: 'collapse'
iconSize: CollapseStyle.iconSize
+ useStates: false
onClicked: _collapsed = !_collapsed
}
diff --git a/tests/ui/modules/Common/Colors.qml b/tests/ui/modules/Common/Colors.qml
index 8e1d40e25..65f5693e6 100644
--- a/tests/ui/modules/Common/Colors.qml
+++ b/tests/ui/modules/Common/Colors.qml
@@ -12,12 +12,8 @@ QtObject {
property color f: '#808080' // Popup shadow.
- property color g: '#8E8E8E' // MenuEntry Normal.
- property color h: '#707070' // MenuEntry Hovered.
- property color i: '#FE5E00' // MenuEntry Pressed.
- property color j: '#434343' // MenuEntry Selected.
- property color k: '#FFFFFF' // Text color.
+
property color l: '#000000' // Text color.
property color m: '#D1D1D1' // SmallButton Normal.
@@ -33,4 +29,17 @@ QtObject {
property color s: '#D64D00'
property color t: '#FF8600'
+
+ // -----------------------------------------------------------------
+ // OK.
+ // -----------------------------------------------------------------
+
+ property color g: '#6B7A86'
+ property color h: '#687680'
+ property color i: '#FE5E00'
+ property color j: '#4B5964'
+ property color j75: '#BF4B5964'
+ property color k: '#FFFFFF'
+ property color k50: '#32FFFFFF'
+ property color u: '#B1B1B1'
}
diff --git a/tests/ui/modules/Common/Constants.qml b/tests/ui/modules/Common/Constants.qml
index ff54ac951..465fa9d8a 100644
--- a/tests/ui/modules/Common/Constants.qml
+++ b/tests/ui/modules/Common/Constants.qml
@@ -7,4 +7,7 @@ QtObject {
property int zPopup: 999
property int zMax: 999999
property int sizeMax: 999999
+
+ property string imagesFormat: '.svg'
+ property string imagesPath: 'qrc:/assets/images/'
}
diff --git a/tests/ui/modules/Common/Form/ActionButton.qml b/tests/ui/modules/Common/Form/ActionButton.qml
index 0cfa3dc21..d72e53ab8 100644
--- a/tests/ui/modules/Common/Form/ActionButton.qml
+++ b/tests/ui/modules/Common/Form/ActionButton.qml
@@ -4,14 +4,35 @@ import QtQuick.Controls 2.0
import Common 1.0
// ===================================================================
-// An animated small button with an image.
+// An animated (or not) button with image(s).
// ===================================================================
Button {
- property alias icon: icon.icon
+ id: button
+
+ property bool useStates: true
property int iconSize
- flat: true
+ // If `useStates` = true, the used icons are:
+ // `icon`_pressed, `icon`_hovered and `icon`_normal.
+ property string icon
+
+ function _getIcon () {
+ if (!useStates) {
+ return button.icon
+ }
+
+ return button.icon + (
+ button.down
+ ? '_pressed'
+ : (button.hovered ? '_hovered' : '_normal')
+ )
+ }
+
+ background: Rectangle {
+ color: 'transparent'
+ }
+ hoverEnabled: true
// Ugly hack, use current size, ActionBar size,
// or other parent height.
@@ -22,5 +43,6 @@ Button {
id: icon
anchors.fill: parent
+ icon: _getIcon()
}
}
diff --git a/tests/ui/modules/Common/Image/Icon.qml b/tests/ui/modules/Common/Image/Icon.qml
index c59b790a4..fb25c88be 100644
--- a/tests/ui/modules/Common/Image/Icon.qml
+++ b/tests/ui/modules/Common/Image/Icon.qml
@@ -1,5 +1,7 @@
import QtQuick 2.7
+import Common 1.0
+
// ===================================================================
// An icon image properly resized.
// ===================================================================
@@ -13,6 +15,6 @@ Image {
fillMode: Image.PreserveAspectFit
source: icon
- ? 'qrc:/imgs/' + icon + '.svg'
+ ? Constants.imagesPath + icon + Constants.imagesFormat
: ''
}
diff --git a/tests/ui/modules/Common/Menu/Menu.qml b/tests/ui/modules/Common/Menu/Menu.qml
index 6cbb1ff7a..dfb3a3cbc 100644
--- a/tests/ui/modules/Common/Menu/Menu.qml
+++ b/tests/ui/modules/Common/Menu/Menu.qml
@@ -51,26 +51,35 @@ ColumnLayout {
Icon {
Layout.preferredHeight: MenuStyle.entry.iconSize
Layout.preferredWidth: MenuStyle.entry.iconSize
- icon: modelData.icon
+ icon: modelData.icon + (
+ _selectedEntry === index
+ ? '_selected'
+ : '_normal'
+ )
}
Text {
Layout.fillWidth: true
- color: MenuStyle.entry.text.color
+ color: _selectedEntry === index
+ ? MenuStyle.entry.text.color.selected
+ : MenuStyle.entry.text.color.normal
font.pointSize: MenuStyle.entry.text.fontSize
height: parent.height
text: modelData.entryName
verticalAlignment: Text.AlignVCenter
}
+ }
- Icon {
- Layout.alignment: Qt.AlignRight
- Layout.preferredHeight: MenuStyle.entry.selectionIconSize
- Layout.preferredWidth: MenuStyle.entry.selectionIconSize
- icon: _selectedEntry === index
- ? 'right_arrow'
- : ''
+ Rectangle {
+ anchors {
+ left: parent.left
}
+
+ height: parent.height
+ color: _selectedEntry === index
+ ? MenuStyle.entry.indicator.color
+ : 'transparent'
+ width: MenuStyle.entry.indicator.width
}
MouseArea {
diff --git a/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml b/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml
index d2bacee4a..f737e99ec 100644
--- a/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml
+++ b/tests/ui/modules/Common/Popup/DropDownDynamicMenu.qml
@@ -1,3 +1,5 @@
+import Utils 1.0
+
// ===================================================================
// Menu which supports `ListView`.
// ===================================================================
@@ -7,8 +9,16 @@ AbstractDropDownMenu {
property int maxMenuHeight
function _computeHeight () {
- var model = _content[0].model
- var height = model.count * entryHeight
+ var list = _content[0]
+
+ Utils.assert(list != null, 'No list found.')
+ Utils.assert(
+ Utils.qmlTypeof(list, 'QQuickListView'),
+ 'No list view parameter.'
+ )
+
+ var height = list.count * entryHeight
+
return (maxMenuHeight !== undefined && height > maxMenuHeight)
? maxMenuHeight
: height
diff --git a/tests/ui/modules/Common/SearchBox.qml b/tests/ui/modules/Common/SearchBox.qml
index 2d950c5dd..0b9825928 100644
--- a/tests/ui/modules/Common/SearchBox.qml
+++ b/tests/ui/modules/Common/SearchBox.qml
@@ -77,6 +77,18 @@ Item {
onActiveFocusChanged: activeFocus && searchBox.showMenu()
onTextChanged: _filter()
+
+ Icon {
+ anchors {
+ right: parent.right
+ rightMargin: parent.rightPadding
+ verticalCenter: parent.verticalCenter
+ }
+
+ icon: 'search'
+ iconSize: parent.contentHeight
+ visible: !parent.text
+ }
}
// Wrap the search box menu in a window.
diff --git a/tests/ui/modules/Common/Styles/CollapseStyle.qml b/tests/ui/modules/Common/Styles/CollapseStyle.qml
index 1ee68d3ea..ad033335b 100644
--- a/tests/ui/modules/Common/Styles/CollapseStyle.qml
+++ b/tests/ui/modules/Common/Styles/CollapseStyle.qml
@@ -5,7 +5,7 @@ import QtQuick 2.7
QtObject {
property int animationDuration: 200
- property int iconSize: 32
+ property int iconSize: 14
property Rectangle background: Rectangle {
// Do not use `Colors` singleton.
diff --git a/tests/ui/modules/Common/Styles/Menu/MenuStyle.qml b/tests/ui/modules/Common/Styles/Menu/MenuStyle.qml
index f5a308209..47a71e71f 100644
--- a/tests/ui/modules/Common/Styles/Menu/MenuStyle.qml
+++ b/tests/ui/modules/Common/Styles/Menu/MenuStyle.qml
@@ -6,13 +6,12 @@ import Common 1.0
// ===================================================================
QtObject {
- property int spacing: 2
+ property int spacing: 0
property QtObject entry: QtObject {
property int iconSize: 24
property int leftMargin: 20
property int rightMargin: 20
- property int selectionIconSize: 12
property int spacing: 18
property QtObject color: QtObject {
@@ -22,9 +21,18 @@ QtObject {
property color selected: Colors.j
}
+ property QtObject indicator: QtObject {
+ property color color: Colors.i
+ property int width: 5
+ }
+
property QtObject text: QtObject {
- property color color: Colors.k
property int fontSize: 13
+
+ property QtObject color: QtObject {
+ property color normal: Colors.k50
+ property color selected: Colors.k
+ }
}
}
}
diff --git a/tests/ui/modules/Common/Styles/qmldir b/tests/ui/modules/Common/Styles/qmldir
index 6ffce45fb..c8557336f 100644
--- a/tests/ui/modules/Common/Styles/qmldir
+++ b/tests/ui/modules/Common/Styles/qmldir
@@ -2,7 +2,8 @@
module Common.Styles
-# Components styles.
+# Components styles --------------------------------------------------
+
singleton CaterpillarAnimationStyle 1.0 Animations/CaterpillarAnimationStyle.qml
singleton CollapseStyle 1.0 CollapseStyle.qml
diff --git a/tests/ui/modules/Linphone/Account/AccountStatus.qml b/tests/ui/modules/Linphone/Account/AccountStatus.qml
new file mode 100644
index 000000000..1c2bb6f54
--- /dev/null
+++ b/tests/ui/modules/Linphone/Account/AccountStatus.qml
@@ -0,0 +1,39 @@
+import QtQuick 2.7
+
+import Linphone.Styles 1.0
+import Utils 1.0
+
+// ===================================================================
+
+Item {
+ Column {
+ anchors.fill: parent
+
+ Text {
+ clip: true
+ color: AccountStatusStyle.username.color
+ elide: Text.ElideRight
+ font.bold: true
+ font.pointSize: AccountStatusStyle.username.fontSize
+ height: parent.height / 2
+ text: AccountSettingsModel.username
+ verticalAlignment: Text.AlignBottom
+ width: parent.width
+ }
+
+ Text {
+ color: AccountStatusStyle.sipAddress.color
+ elide: Text.ElideRight
+ font.pointSize: AccountStatusStyle.sipAddress.fontSize
+ height: parent.height / 2
+ text: AccountSettingsModel.sipAddress
+ verticalAlignment: Text.AlignTop
+ width: parent.width
+ }
+ }
+
+ MouseArea {
+ anchors.fill: parent
+ onClicked: Utils.openWindow('ManageAccounts', this)
+ }
+}
diff --git a/tests/ui/modules/Linphone/Call/CallControls.qml b/tests/ui/modules/Linphone/Call/CallControls.qml
index fee795f5a..1a93692b5 100644
--- a/tests/ui/modules/Linphone/Call/CallControls.qml
+++ b/tests/ui/modules/Linphone/Call/CallControls.qml
@@ -18,10 +18,7 @@ RowLayout {
id: contact
anchors.fill: parent
- presenceLevel: Presence.Green
- sipAddress: 'math.hart@sip-linphone.org'
sipAddressColor: '#FFFFFF'
- username: 'Mathilda Hart'
usernameColor: '#FFFFFF'
}
}
diff --git a/tests/ui/modules/Linphone/Contact/Contact.qml b/tests/ui/modules/Linphone/Contact/Contact.qml
index de325e542..558930811 100644
--- a/tests/ui/modules/Linphone/Contact/Contact.qml
+++ b/tests/ui/modules/Linphone/Contact/Contact.qml
@@ -9,13 +9,11 @@ import Linphone.Styles 1.0
Item {
property alias actions: actionBar.data
- property alias image: avatar.image
- property alias presenceLevel: avatar.presenceLevel
- property alias sipAddress: description.sipAddress
property alias sipAddressColor: description.sipAddressColor
- property alias username: avatar.username
property alias usernameColor: description.usernameColor
+ property var contact
+
height: ContactStyle.height
RowLayout {
@@ -29,6 +27,9 @@ Item {
Layout.preferredHeight: ContactStyle.contentHeight
Layout.preferredWidth: ContactStyle.contentHeight
+ image: contact.image
+ presenceLevel: contact.presenceLevel
+ username: contact.username
}
ContactDescription {
@@ -36,6 +37,7 @@ Item {
Layout.fillHeight: true
Layout.fillWidth: true
+ sipAddress: contact.sipAddress
username: avatar.username
}
diff --git a/tests/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml b/tests/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml
new file mode 100644
index 000000000..d5f6a6a03
--- /dev/null
+++ b/tests/ui/modules/Linphone/Styles/Account/AccountStatusStyle.qml
@@ -0,0 +1,16 @@
+pragma Singleton
+import QtQuick 2.7
+
+import Common 1.0
+
+QtObject {
+ property QtObject sipAddress: QtObject {
+ property color color: Colors.j75
+ property int fontSize: 10
+ }
+
+ property QtObject username: QtObject {
+ property color color: Colors.j
+ property int fontSize: 11
+ }
+}
diff --git a/tests/ui/modules/Linphone/Styles/TimelineStyle.qml b/tests/ui/modules/Linphone/Styles/TimelineStyle.qml
index c47fe27e8..7c75ee38e 100644
--- a/tests/ui/modules/Linphone/Styles/TimelineStyle.qml
+++ b/tests/ui/modules/Linphone/Styles/TimelineStyle.qml
@@ -5,19 +5,14 @@ import Common 1.0
QtObject {
property QtObject legend: QtObject {
- property color color: Colors.d
-
+ property color backgroundColor: Colors.u
+ property color color: Colors.k
property int bottomMargin: 10
- property int fontSize: 13
- property int iconSize: 26
- property int leftMargin: 18
- property int spacing: 16
- property int topMargin: 10
- }
-
- property QtObject separator: QtObject {
- property color color: Colors.e
-
- property int height: 1
+ property int fontSize: 12
+ property int height: 30
+ property int iconSize: 10
+ property int leftMargin: 17
+ property int rightMargin: 17
+ property int spacing: 8
}
}
diff --git a/tests/ui/modules/Linphone/Styles/qmldir b/tests/ui/modules/Linphone/Styles/qmldir
index 817c66db4..4d649d9e3 100644
--- a/tests/ui/modules/Linphone/Styles/qmldir
+++ b/tests/ui/modules/Linphone/Styles/qmldir
@@ -2,9 +2,11 @@
module Linphone.Style
-# Components styles.
-singleton TimelineStyle 1.0 TimelineStyle.qml
+# Components styles --------------------------------------------------
-singleton AvatarStyle 1.0 Contact/AvatarStyle.qml
-singleton ContactDescriptionStyle 1.0 Contact/ContactDescriptionStyle.qml
-singleton ContactStyle 1.0 Contact/ContactStyle.qml
+singleton AccountStatusStyle 1.0 Account/AccountStatusStyle.qml
+singleton AvatarStyle 1.0 Contact/AvatarStyle.qml
+singleton ContactDescriptionStyle 1.0 Contact/ContactDescriptionStyle.qml
+singleton ContactStyle 1.0 Contact/ContactStyle.qml
+
+singleton TimelineStyle 1.0 TimelineStyle.qml
diff --git a/tests/ui/modules/Linphone/Timeline.qml b/tests/ui/modules/Linphone/Timeline.qml
index 9c113a18e..858a15fd5 100644
--- a/tests/ui/modules/Linphone/Timeline.qml
+++ b/tests/ui/modules/Linphone/Timeline.qml
@@ -9,32 +9,35 @@ import Linphone.Styles 1.0
ColumnLayout {
property alias model: view.model
- // Legend.
- Row {
- Layout.bottomMargin: TimelineStyle.legend.bottomMargin
- Layout.leftMargin: TimelineStyle.legend.leftMargin
- Layout.topMargin: TimelineStyle.legend.topMargin
- spacing: TimelineStyle.legend.spacing
-
- Icon {
- icon: 'history'
- iconSize: TimelineStyle.legend.iconSize
- }
-
- Text {
- color: TimelineStyle.legend.color
- font.pointSize: TimelineStyle.legend.fontSize
- height: parent.height
- text: qsTr('timelineTitle')
- verticalAlignment: Text.AlignVCenter
- }
- }
-
- // Separator.
Rectangle {
+ Layout.bottomMargin: TimelineStyle.legend.bottomMargin
Layout.fillWidth: true
- Layout.preferredHeight: TimelineStyle.separator.height
- color: TimelineStyle.separator.color
+ Layout.preferredHeight: TimelineStyle.legend.height
+ color: TimelineStyle.legend.backgroundColor
+
+ // Legend.
+ Row {
+ anchors {
+ fill: parent
+ leftMargin: TimelineStyle.legend.leftMargin
+ rightMargin: TimelineStyle.legend.rightMargin
+ }
+ spacing: TimelineStyle.legend.spacing
+
+ Icon {
+ icon: 'history'
+ iconSize: TimelineStyle.legend.iconSize
+ anchors.verticalCenter: parent.verticalCenter
+ }
+
+ Text {
+ color: TimelineStyle.legend.color
+ font.pointSize: TimelineStyle.legend.fontSize
+ height: parent.height
+ text: qsTr('timelineTitle')
+ verticalAlignment: Text.AlignVCenter
+ }
+ }
}
// History.
@@ -45,9 +48,7 @@ ColumnLayout {
Layout.fillWidth: true
delegate: Contact {
- presenceLevel: $presence
- sipAddress: $sipAddress
- username: $username
+ contact: $contact
width: parent.width
}
}
diff --git a/tests/ui/modules/Linphone/qmldir b/tests/ui/modules/Linphone/qmldir
index e6d552e16..786e73a49 100644
--- a/tests/ui/modules/Linphone/qmldir
+++ b/tests/ui/modules/Linphone/qmldir
@@ -6,20 +6,23 @@ module Linphone
# Components ---------------------------------------------------------
+# Account
+AccountStatus 1.0 Account/AccountStatus.qml
+
# Call
-CallControls 1.0 Call/CallControls.qml
+CallControls 1.0 Call/CallControls.qml
# Chat
-Chat 1.0 Chat/Chat.qml
+Chat 1.0 Chat/Chat.qml
# Contact
-Avatar 1.0 Contact/Avatar.qml
-Contact 1.0 Contact/Contact.qml
-ContactDescription 1.0 Contact/ContactDescription.qml
-PresenceLevel 1.0 Contact/PresenceLevel.qml
+Avatar 1.0 Contact/Avatar.qml
+Contact 1.0 Contact/Contact.qml
+ContactDescription 1.0 Contact/ContactDescription.qml
+PresenceLevel 1.0 Contact/PresenceLevel.qml
# Select
-SelectContact 1.0 Select/SelectContact.qml
+SelectContact 1.0 Select/SelectContact.qml
# Timeline
-Timeline 1.0 Timeline.qml
+Timeline 1.0 Timeline.qml
diff --git a/tests/ui/scripts/Utils/utils.spec.qml b/tests/ui/scripts/Utils/utils.spec.qml
index 3f1077851..c88872f5f 100644
--- a/tests/ui/scripts/Utils/utils.spec.qml
+++ b/tests/ui/scripts/Utils/utils.spec.qml
@@ -117,6 +117,11 @@ TestCase {
component: 'import QtQuick 2.7; ListModel {}',
result: true,
type: 'QQmlListModel'
+ },
+ {
+ component: 'import QtQuick 2.7; ListView {}',
+ result: true,
+ type: 'QQuickListView'
}
]
}
diff --git a/tests/ui/views/Calls/Calls.qml b/tests/ui/views/App/Calls/Calls.qml
similarity index 100%
rename from tests/ui/views/Calls/Calls.qml
rename to tests/ui/views/App/Calls/Calls.qml
diff --git a/tests/ui/views/Calls/StartingCall.qml b/tests/ui/views/App/Calls/StartingCall.qml
similarity index 100%
rename from tests/ui/views/Calls/StartingCall.qml
rename to tests/ui/views/App/Calls/StartingCall.qml
diff --git a/tests/ui/views/Calls/StartingIncomingCall.qml b/tests/ui/views/App/Calls/StartingIncomingCall.qml
similarity index 100%
rename from tests/ui/views/Calls/StartingIncomingCall.qml
rename to tests/ui/views/App/Calls/StartingIncomingCall.qml
diff --git a/tests/ui/views/Calls/StartingOutgoingCall.qml b/tests/ui/views/App/Calls/StartingOutgoingCall.qml
similarity index 100%
rename from tests/ui/views/Calls/StartingOutgoingCall.qml
rename to tests/ui/views/App/Calls/StartingOutgoingCall.qml
diff --git a/tests/ui/views/MainWindow/Contact.qml b/tests/ui/views/App/MainWindow/Contact.qml
similarity index 100%
rename from tests/ui/views/MainWindow/Contact.qml
rename to tests/ui/views/App/MainWindow/Contact.qml
diff --git a/tests/ui/views/MainWindow/Contacts.qml b/tests/ui/views/App/MainWindow/Contacts.qml
similarity index 100%
rename from tests/ui/views/MainWindow/Contacts.qml
rename to tests/ui/views/App/MainWindow/Contacts.qml
diff --git a/tests/ui/views/MainWindow/Conversation.qml b/tests/ui/views/App/MainWindow/Conversation.qml
similarity index 100%
rename from tests/ui/views/MainWindow/Conversation.qml
rename to tests/ui/views/App/MainWindow/Conversation.qml
diff --git a/tests/ui/views/MainWindow/Home.qml b/tests/ui/views/App/MainWindow/Home.qml
similarity index 100%
rename from tests/ui/views/MainWindow/Home.qml
rename to tests/ui/views/App/MainWindow/Home.qml
diff --git a/tests/ui/views/App/MainWindow/MainWindow.qml b/tests/ui/views/App/MainWindow/MainWindow.qml
new file mode 100644
index 000000000..819c519b9
--- /dev/null
+++ b/tests/ui/views/App/MainWindow/MainWindow.qml
@@ -0,0 +1,144 @@
+import QtQuick 2.7
+import QtQuick.Controls 2.0
+import QtQuick.Layouts 1.3
+
+import Common 1.0
+import Linphone 1.0
+import Utils 1.0
+
+import App.Styles 1.0
+
+// ===================================================================
+
+ApplicationWindow {
+ id: window
+
+ function setView (view) {
+ contentLoader.source = view + '.qml'
+ }
+
+ // -----------------------------------------------------------------
+ // Window properties.
+ // -----------------------------------------------------------------
+
+ maximumHeight: MainWindowStyle.toolBar.height
+ minimumHeight: MainWindowStyle.toolBar.height
+ minimumWidth: MainWindowStyle.minimumWidth
+ title: MainWindowStyle.title
+ visible: true
+
+ onActiveFocusItemChanged: activeFocusItem == null &&
+ searchBox.hideMenu()
+
+ // -----------------------------------------------------------------
+ // Toolbar properties.
+ // -----------------------------------------------------------------
+
+ header: ToolBar {
+ background: MainWindowStyle.toolBar.background
+ height: MainWindowStyle.toolBar.height
+
+ RowLayout {
+ anchors.fill: parent
+ anchors.leftMargin: MainWindowStyle.toolBar.leftMargin
+ anchors.rightMargin: MainWindowStyle.toolBar.rightMargin
+ spacing: MainWindowStyle.toolBar.spacing
+
+ Collapse {
+ Layout.fillHeight: parent.height
+ target: window
+ targetHeight: MainWindowStyle.minimumHeight
+ }
+
+ AccountStatus {
+ id: accountStatus
+
+ Layout.fillHeight: parent.height
+ Layout.preferredWidth: MainWindowStyle.accountStatus.width
+ }
+
+ SearchBox {
+ id: searchBox
+
+ Layout.fillWidth: true
+ entryHeight: 50 // TODO: Remove.
+ maxMenuHeight: MainWindowStyle.searchBox.maxHeight
+ placeholderText: qsTr('mainSearchBarPlaceholder')
+
+ model: ContactsListModel {}
+
+ delegate: Contact {
+ contact: $contact
+ width: parent.width
+
+ actions: [
+ ActionButton {
+ icon: 'call'
+ onClicked: CallsWindow.show()
+ },
+
+ ActionButton {
+ icon: 'video_call'
+ onClicked: CallsWindow.show()
+ }
+ ]
+ }
+ }
+ }
+ }
+
+ // -----------------------------------------------------------------
+ // Content.
+ // -----------------------------------------------------------------
+
+ RowLayout {
+ anchors.fill: parent
+ spacing: 0
+
+ // Main menu.
+ ColumnLayout {
+ Layout.fillHeight: true
+ Layout.maximumWidth: MainWindowStyle.menu.width
+ Layout.preferredWidth: MainWindowStyle.menu.width
+ spacing: 0
+
+ Menu {
+ entryHeight: MainWindowStyle.menu.entryHeight
+ entryWidth: parent.width
+
+ entries: [{
+ entryName: qsTr('homeEntry'),
+ icon: 'home'
+ }, {
+ entryName: qsTr('contactsEntry'),
+ icon: 'contact'
+ }]
+
+ onEntrySelected: {
+ if (entry === 0) {
+ setView('Home')
+ } else if (entry === 1) {
+ setView('Contacts')
+ }
+ }
+ }
+
+ // History.
+ Timeline {
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+ model: ContactsListModel {}
+ }
+ }
+
+ // Main content.
+ Loader {
+ id: contentLoader
+
+ Layout.fillHeight: true
+ Layout.fillWidth: true
+
+ Component.onCompleted: setView('Home')
+ }
+ }
+}
diff --git a/tests/ui/views/ManageAccounts.qml b/tests/ui/views/App/ManageAccounts.qml
similarity index 100%
rename from tests/ui/views/ManageAccounts.qml
rename to tests/ui/views/App/ManageAccounts.qml
diff --git a/tests/ui/views/NewCall.qml b/tests/ui/views/App/NewCall.qml
similarity index 100%
rename from tests/ui/views/NewCall.qml
rename to tests/ui/views/App/NewCall.qml
diff --git a/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml
new file mode 100644
index 000000000..3024cd6e0
--- /dev/null
+++ b/tests/ui/views/App/Styles/MainWindow/MainWindowStyle.qml
@@ -0,0 +1,34 @@
+pragma Singleton
+import QtQuick 2.7
+
+// ===================================================================
+
+QtObject {
+ property int minimumHeight: 480
+ property int minimumWidth: 780
+ property string title: 'Linphone'
+
+ property QtObject accountStatus: QtObject {
+ property int width: 200
+ }
+
+ property QtObject menu: QtObject {
+ property int entryHeight: 50
+ property int width: 250
+ }
+
+ property QtObject searchBox: QtObject {
+ property int maxHeight: 300 // See Hick's law for good choice.
+ }
+
+ property QtObject toolBar: QtObject {
+ property int height: 70
+ property int leftMargin: 20
+ property int rightMargin: 20
+ property int spacing: 20
+
+ property var background: Rectangle {
+ color: '#E2E2E2'
+ }
+ }
+}
diff --git a/tests/ui/views/App/Styles/qmldir b/tests/ui/views/App/Styles/qmldir
new file mode 100644
index 000000000..f780f1551
--- /dev/null
+++ b/tests/ui/views/App/Styles/qmldir
@@ -0,0 +1,7 @@
+# See: https://wiki.qt.io/Qml_Styling
+
+module App.Styles
+
+# Views styles -------------------------------------------------------
+
+singleton MainWindowStyle 1.0 MainWindow/MainWindowStyle.qml
diff --git a/tests/ui/views/App/qmldir b/tests/ui/views/App/qmldir
new file mode 100644
index 000000000..8009d313b
--- /dev/null
+++ b/tests/ui/views/App/qmldir
@@ -0,0 +1,10 @@
+# ====================================================================
+# Linphone's views.
+# ====================================================================
+
+module App
+
+# Views --------------------------------------------------------------
+
+ManageAccounts 1.0 ManageAccounts.qml
+NewCall 1.0 NewCall.qml
diff --git a/tests/ui/views/MainWindow/MainWindow.qml b/tests/ui/views/MainWindow/MainWindow.qml
deleted file mode 100644
index 62e0f4120..000000000
--- a/tests/ui/views/MainWindow/MainWindow.qml
+++ /dev/null
@@ -1,302 +0,0 @@
-import QtQuick 2.7
-import QtQuick.Controls 2.0
-import QtQuick.Layouts 1.3
-
-import Common 1.0
-import Linphone 1.0
-import Utils 1.0
-
-ApplicationWindow {
- id: window
-
- function setView (view) {
- loaderContent.source = 'qrc:/ui/views/MainWindow/' + view + '.qml'
- }
-
- function _manageAccounts () {
- Utils.openWindow('ManageAccounts', window)
- }
-
- maximumHeight: 70
- minimumHeight: 70
- minimumWidth: 780
- title: 'Linphone'
- visible: true
-
- header: ToolBar {
- background: Rectangle {
- color: '#EAEAEA'
- }
- height: 70
-
- RowLayout {
- anchors.fill: parent
- anchors.leftMargin: 20
- anchors.rightMargin: 20
- spacing: 20
-
- // Collapse.
- Collapse {
- id: collapse
-
- Layout.fillHeight: parent.height
- Layout.preferredWidth: 25
- target: window
- targetHeight: 480
- }
-
- // User info.
- ContactDescription {
- id: contactDescription
-
- Layout.fillHeight: parent.height
- Layout.preferredWidth: 200
- sipAddress: 'e.miller@sip-linphone.org'
- username: 'Edward Miller'
- }
-
- MouseArea {
- anchors.fill: contactDescription
- onClicked: _manageAccounts()
- }
-
- // User actions.
- ActionButton {
- Layout.preferredWidth: 1
- onClicked: _manageAccounts()
- }
-
- ActionButton {
- Layout.preferredWidth: 16
- onClicked: Utils.openWindow('NewCall', window)
- }
-
- // Search.
- SearchBox {
- id: searchBox
-
- Layout.fillWidth: true
- maxMenuHeight: 300 // See Hick's law for good choice.
- placeholderText: qsTr('mainSearchBarPlaceholder')
- entryHeight: 50
-
- model: model1
-
- delegate: Contact {
- presenceLevel: $presence
- sipAddress: $sipAddress
- username: $username
- width: parent.width
-
- actions: [
- ActionButton {
- icon: 'call'
- onClicked: CallsWindow.show()
- },
-
- ActionButton {
- icon: 'cam'
- onClicked: console.log('cam clicked')
- }
- ]
- }
- }
-
- // Start conference.
- ActionButton {
- Layout.preferredWidth: 32
- Layout.preferredHeight: 32
- icon: 'conference'
- }
- }
- }
-
- onActiveFocusItemChanged: activeFocusItem == null &&
- searchBox.hideMenu()
-
- RowLayout {
- anchors.fill: parent
- spacing: 0
-
- // Main menu.
- ColumnLayout {
- Layout.fillHeight: true
- Layout.maximumWidth: 250
- Layout.preferredWidth: 250
- spacing: 0
-
- Menu {
- entryHeight: 50
- entryWidth: parent.width
-
- entries: [{
- entryName: qsTr('homeEntry'),
- icon: 'home'
- }, {
- entryName: qsTr('contactsEntry'),
- icon: 'contacts_list'
- }]
-
- onEntrySelected: {
- console.log('entry', entry)
-
- if (entry === 0) {
- setView('Home')
- } else if (entry === 1) {
- setView('Contacts')
- }
- }
- }
-
- // History.
- Timeline {
- Layout.fillHeight: true
- Layout.fillWidth: true
-
- model: ListModel {
- ListElement {
- $presence: 0
- $sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'toto.lala.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'machin.truc.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'hey.listen.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'valentin.cognito.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'charles.henri.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'yesyes.nono.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'nsa.sip.linphone.org'
- $username: 'Toto'
- }
- }
- }
-
- // Logo.
- Rectangle {
- Layout.fillWidth: true
- Layout.preferredHeight: 80
- color: '#EAEAEA'
- }
- }
-
- // Main content.
- Loader {
- id: loaderContent
-
- Layout.fillHeight: true
- Layout.fillWidth: true
- source: 'qrc:/ui/views/MainWindow/Home.qml'
- }
- }
-
- ListModel {
- id: model1
-
- ListElement {
- $presence: 0
- $sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'toto.lala.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'machin.truc.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'hey.listen.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'valentin.cognito.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'charles.henri.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'yesyes.nono.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'nsa.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'toto.lala.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'machin.truc.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'hey.listen.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'valentin.cognito.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'charles.henri.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'yesyes.nono.sip.linphone.org'
- $username: 'Toto'
- }
- ListElement {
- $presence: 0
- $sipAddress: 'nsa.sip.linphone.org'
- $username: 'Toto'
- }
- }
-}