mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-23 14:48:15 +00:00
feat(manageAccounts): new manageAccounts view
This commit is contained in:
parent
5d43f4a99e
commit
fd30f4d668
25 changed files with 591 additions and 23 deletions
18
tests/imgs/led_absent.svg
Normal file
18
tests/imgs/led_absent.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>led_inprogress</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-7038.000000, -2116.000000)">
|
||||
<g id="led_inprogress" sketch:type="MSLayerGroup" transform="translate(7010.000000, 2089.000000)">
|
||||
<rect id="Rectangle-232-Copy-6" fill-opacity="0" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="90" height="90"></rect>
|
||||
<g id="led_inprogress-copy" transform="translate(30.000000, 30.000000)" sketch:type="MSShapeGroup">
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Fill-1" fill="#FFA645"></path>
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Stroke-2" stroke="#FFFFFF" stroke-width="5"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
18
tests/imgs/led_connected.svg
Normal file
18
tests/imgs/led_connected.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>led_connected</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-7038.000000, -1852.000000)">
|
||||
<g id="led_connected" sketch:type="MSLayerGroup" transform="translate(7010.000000, 1825.000000)">
|
||||
<rect id="Rectangle-232-Copy-8" fill-opacity="0" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="90" height="90"></rect>
|
||||
<g id="led_connected-copy" transform="translate(30.000000, 30.000000)" sketch:type="MSShapeGroup">
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Fill-1" fill="#96C11F"></path>
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Stroke-2" stroke="#FFFFFF" stroke-width="5"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
18
tests/imgs/led_disconnected.svg
Normal file
18
tests/imgs/led_disconnected.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>led_disconnected</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-7038.000000, -2235.000000)">
|
||||
<g id="led_disconnected" sketch:type="MSLayerGroup" transform="translate(7010.000000, 2208.000000)">
|
||||
<rect id="Rectangle-232-Copy-5" fill-opacity="0" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="90" height="90"></rect>
|
||||
<g id="led_disconnected-copy" transform="translate(30.000000, 30.000000)" sketch:type="MSShapeGroup">
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Fill-1" fill="#E1E1E1"></path>
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Stroke-2" stroke="#FFFFFF" stroke-width="5"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
18
tests/imgs/led_do_not_disturb.svg
Normal file
18
tests/imgs/led_do_not_disturb.svg
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="35px" height="35px" viewBox="0 0 35 35" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>led_error</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-7038.000000, -1993.000000)">
|
||||
<g id="led_error" sketch:type="MSLayerGroup" transform="translate(7010.000000, 1966.000000)">
|
||||
<rect id="Rectangle-232-Copy-7" fill-opacity="0" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="90" height="90"></rect>
|
||||
<g id="led_error-copy" transform="translate(30.000000, 30.000000)" sketch:type="MSShapeGroup">
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Fill-1" fill="#FF0000"></path>
|
||||
<path d="M29.6572727,14.9745455 C29.6572727,23.0081818 23.1445455,29.52 15.1109091,29.52 C7.07727273,29.52 0.566363636,23.0081818 0.566363636,14.9745455 C0.566363636,6.94181818 7.07727273,0.429090909 15.1109091,0.429090909 C23.1445455,0.429090909 29.6572727,6.94181818 29.6572727,14.9745455 L29.6572727,14.9745455 Z" id="Stroke-2" stroke="#FFFFFF" stroke-width="5"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.8 KiB |
17
tests/imgs/valid.svg
Normal file
17
tests/imgs/valid.svg
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg width="82px" height="56px" viewBox="0 0 82 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns">
|
||||
<!-- Generator: Sketch 3.3.3 (12081) - http://www.bohemiancoding.com/sketch -->
|
||||
<title>valid</title>
|
||||
<desc>Created with Sketch.</desc>
|
||||
<defs></defs>
|
||||
<g id="OUTILS" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage">
|
||||
<g id="linphone_v2.0_icones_buttons" sketch:type="MSArtboardGroup" transform="translate(-1444.000000, -7601.000000)">
|
||||
<g id="valid" sketch:type="MSLayerGroup" transform="translate(1426.000000, 7569.000000)">
|
||||
<g transform="translate(21.000000, 35.000000)" stroke="#444444" id="Stroke-3" stroke-width="5" sketch:type="MSShapeGroup" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M0.4395,19.6931204 L32.8369959,49.7658833 L76.2135,0.0261166985"></path>
|
||||
</g>
|
||||
<rect id="Rectangle-232-Copy-29" opacity="0" fill-opacity="0.7" fill="#FFFFFF" sketch:type="MSShapeGroup" x="0" y="0" width="120" height="120"></rect>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -8,4 +8,59 @@
|
|||
<translation>Search contact, start call, start chat...</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>manage_accounts</name>
|
||||
<message>
|
||||
<source>manageAccountsTitle</source>
|
||||
<translation>Presence and accounts</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>manageAccountsDescription</source>
|
||||
<translation>Select your active account and choose all necessary presence status.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>awayPresence</source>
|
||||
<translation>Away</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>beRightBackPresence</source>
|
||||
<translation>Be right back</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>busyPresence</source>
|
||||
<translation>Busy</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>doNotDisturbPresence</source>
|
||||
<translation>Away</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>movedPresence</source>
|
||||
<translation>Moved</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>offlinePresence</source>
|
||||
<translation>Disconnected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>onThePhonePresence</source>
|
||||
<translation>On the phone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>onlinePresence</source>
|
||||
<translation>Connected</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>outToLunchPresence</source>
|
||||
<translation>Out to lunch</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>usingAnotherMessagingServicePresence</source>
|
||||
<translation>Using another messaging service</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>validate</source>
|
||||
<translation>VALIDATE</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
|||
|
|
@ -8,4 +8,59 @@
|
|||
<translation>Chercher contact, commencer appel ou chat...</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>manage_accounts</name>
|
||||
<message>
|
||||
<source>manageAccountsTitle</source>
|
||||
<translation>Présence et comptes</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>manageAccountsDescription</source>
|
||||
<translation>Sélectionner votre compte actif ainsi que vos status de présence.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>awayPresence</source>
|
||||
<translation>Absent</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>beRightBackPresence</source>
|
||||
<translation>De retour</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>busyPresence</source>
|
||||
<translation>Occupé</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>doNotDisturbPresence</source>
|
||||
<translation>Ne pas déranger</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>movedPresence</source>
|
||||
<translation>Parti</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>offlinePresence</source>
|
||||
<translation>Déconnecté</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>onThePhonePresence</source>
|
||||
<translation>Au téléphone</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>onlinePresence</source>
|
||||
<translation>Disponible</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>outToLunchPresence</source>
|
||||
<translation>A table</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>usingAnotherMessagingServicePresence</source>
|
||||
<translation>Utilisation d'un autre service de messagerie</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>validate</source>
|
||||
<translation>VALIDER</translation>
|
||||
</message>
|
||||
</context>
|
||||
</TS>
|
||||
|
|
|
|||
|
|
@ -6,11 +6,13 @@ TEMPLATE = app
|
|||
SOURCES = \
|
||||
src/app.cpp \
|
||||
src/main.cpp \
|
||||
src/views/main_window.cpp
|
||||
src/models/settings/AccountSettingsModel.cpp \
|
||||
src/models/settings/SettingsModel.cpp
|
||||
|
||||
HEADERS = \
|
||||
src/app.hpp \
|
||||
src/views/main_window.hpp
|
||||
src/models/settings/AccountSettingsModel.hpp \
|
||||
src/models/settings/SettingsModel.hpp
|
||||
|
||||
TRANSLATIONS = \
|
||||
languages/en.ts \
|
||||
|
|
@ -19,7 +21,7 @@ TRANSLATIONS = \
|
|||
lupdate_only{
|
||||
# Each component folder must be added explicitly.
|
||||
SOURCES = \
|
||||
ui/components/Form/*.qml \
|
||||
ui/components/form/*.qml \
|
||||
ui/views/*.qml
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,13 +5,21 @@
|
|||
<file>languages/fr.qm</file>
|
||||
|
||||
<!-- UI. -->
|
||||
<file>ui/components/Form/Collapse.qml</file>
|
||||
<file>ui/components/Form/RoundButton.qml</file>
|
||||
<file>ui/components/Form/ToolBarButton.qml</file>
|
||||
<file>ui/components/form/Collapse.qml</file>
|
||||
<file>ui/components/form/DialogButton.qml</file>
|
||||
<file>ui/components/form/DialogComboBox.qml</file>
|
||||
<file>ui/components/form/RoundButton.qml</file>
|
||||
<file>ui/components/form/ToolBarButton.qml</file>
|
||||
<file>ui/views/main_window.qml</file>
|
||||
<file>ui/views/manage_accounts.qml</file>
|
||||
|
||||
<!-- Images. -->
|
||||
<file>imgs/collapse.svg</file>
|
||||
<file>imgs/led_absent.svg</file>
|
||||
<file>imgs/led_connected.svg</file>
|
||||
<file>imgs/led_disconnected.svg</file>
|
||||
<file>imgs/led_do_not_disturb.svg</file>
|
||||
<file>imgs/start_conference.svg</file>
|
||||
<file>imgs/valid.svg</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
|
||||
#include "app.hpp"
|
||||
|
||||
#define APPLICATION_NAME "Linphone"
|
||||
#define LANGUAGES_PATH ":/languages/"
|
||||
|
||||
// ===================================================================
|
||||
|
|
@ -17,7 +16,4 @@ App::App(int &argc, char **argv) : QGuiApplication(argc, argv) {
|
|||
} else {
|
||||
qWarning() << "No translation found.";
|
||||
}
|
||||
|
||||
// Set application name.
|
||||
QCoreApplication::setApplicationName(APPLICATION_NAME);
|
||||
}
|
||||
|
|
|
|||
16
tests/src/models/settings/AccountSettingsListModel.cpp
Normal file
16
tests/src/models/settings/AccountSettingsListModel.cpp
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
#include "AccountSettingsListModel.hpp"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
AccountSettingsListModel::AccountSettingsListModel (QObject *parent) :
|
||||
QObject(parent) {
|
||||
}
|
||||
|
||||
int AccountSettingsListModel::getDefaultAccount () const {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void AccountSettingsListModel::setDefaultAccount (int index) {
|
||||
// NOTHING TODO.
|
||||
(void)index;
|
||||
}
|
||||
23
tests/src/models/settings/AccountSettingsListModel.hpp
Normal file
23
tests/src/models/settings/AccountSettingsListModel.hpp
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef ACCOUNT_SETTINGS_LIST_MODEL_H_
|
||||
#define ACCOUNT_SETTINGS_LIST_MODEL_H_
|
||||
|
||||
#include <QObject>
|
||||
|
||||
// ===================================================================
|
||||
|
||||
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
|
||||
28
tests/src/models/settings/AccountSettingsModel.cpp
Normal file
28
tests/src/models/settings/AccountSettingsModel.cpp
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
#include "AccountSettingsModel.hpp"
|
||||
|
||||
typedef AccountSettingsModel::Presence Presence;
|
||||
|
||||
// ===================================================================
|
||||
|
||||
AccountSettingsModel::AccountSettingsModel (QObject *parent) :
|
||||
QObject(parent) {
|
||||
}
|
||||
|
||||
QString AccountSettingsModel::getUsername () const {
|
||||
return "Toto";
|
||||
}
|
||||
|
||||
void AccountSettingsModel::setUsername (const QString &username) {
|
||||
// NOTHING TODO.
|
||||
(void)username;
|
||||
}
|
||||
|
||||
|
||||
Presence AccountSettingsModel::getPresence () const {
|
||||
return Presence::Away;
|
||||
}
|
||||
|
||||
void AccountSettingsModel::setPresence (Presence presence) {
|
||||
// NOTHING TODO.
|
||||
(void)presence;
|
||||
}
|
||||
45
tests/src/models/settings/AccountSettingsModel.hpp
Normal file
45
tests/src/models/settings/AccountSettingsModel.hpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#ifndef ACCOUNT_SETTINGS_MODEL_H_
|
||||
#define ACCOUNT_SETTINGS_MODEL_H_
|
||||
|
||||
#include <QObject>
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class AccountSettingsModel : public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
Q_PROPERTY(QString username
|
||||
READ getUsername
|
||||
WRITE setUsername);
|
||||
|
||||
Q_PROPERTY(Presence presence
|
||||
READ getPresence
|
||||
WRITE setPresence);
|
||||
|
||||
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);
|
||||
};
|
||||
|
||||
#endif // ACCOUNT_SETTINGS_MODEL_H_
|
||||
7
tests/src/models/settings/SettingsModel.cpp
Normal file
7
tests/src/models/settings/SettingsModel.cpp
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
#include "SettingsModel.hpp"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
SettingsModel::SettingsModel (QObject *parent) :
|
||||
QObject(parent) {
|
||||
}
|
||||
20
tests/src/models/settings/SettingsModel.hpp
Normal file
20
tests/src/models/settings/SettingsModel.hpp
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#ifndef SETTINGS_MODEL_H_
|
||||
#define SETTINGS_MODEL_H_
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include "AccountSettingsModel.hpp"
|
||||
|
||||
// ===================================================================
|
||||
|
||||
class SettingsModel : public QObject {
|
||||
Q_OBJECT;
|
||||
|
||||
public:
|
||||
SettingsModel (QObject *parent = Q_NULLPTR);
|
||||
|
||||
private:
|
||||
QList<AccountSettingsModel *> accountsSettings;
|
||||
};
|
||||
|
||||
#endif // SETTINGS_MODEL_H_
|
||||
|
|
@ -1 +0,0 @@
|
|||
#include "main_window.hpp"
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
#ifndef MAIN_WINDOW_H_
|
||||
#define MAIN_WINDOW_H_
|
||||
|
||||
class MainWindow {
|
||||
// TODO.
|
||||
};
|
||||
|
||||
#endif // MAIN_WINDOW_
|
||||
18
tests/ui/components/form/DialogButton.qml
Normal file
18
tests/ui/components/form/DialogButton.qml
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
Button {
|
||||
background: Rectangle {
|
||||
color: button.down ? '#FE5E00' : '#434343'
|
||||
implicitWidth: 120
|
||||
implicitHeight: 30
|
||||
radius: 4
|
||||
}
|
||||
contentItem: Text {
|
||||
color: '#FFFFFF'
|
||||
text: button.text
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
id: button
|
||||
}
|
||||
9
tests/ui/components/form/DialogComboBox.qml
Normal file
9
tests/ui/components/form/DialogComboBox.qml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
|
||||
ComboBox {
|
||||
background: Rectangle {
|
||||
color: 'transparent'
|
||||
}
|
||||
id: comboBox
|
||||
}
|
||||
|
|
@ -7,5 +7,6 @@ Button {
|
|||
Image {
|
||||
anchors.fill: parent
|
||||
id: backgroundImage
|
||||
fillMode: Image.PreserveAspectFit
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import QtQuick 2.5
|
||||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
|
||||
import 'qrc:/ui/components/Form'
|
||||
import 'qrc:/ui/components/form'
|
||||
|
||||
ApplicationWindow {
|
||||
header: ToolBar {
|
||||
|
|
@ -17,7 +17,7 @@ ApplicationWindow {
|
|||
|
||||
// Collapse.
|
||||
Collapse {
|
||||
image: '/imgs/collapse.svg'
|
||||
image: 'qrc:/imgs/collapse.svg'
|
||||
onCollapsed: {
|
||||
mainWindow.height = collapsed ? 480 : 70
|
||||
}
|
||||
|
|
@ -26,6 +26,15 @@ ApplicationWindow {
|
|||
// User info.
|
||||
// TODO
|
||||
|
||||
// User actions.
|
||||
ToolBarButton {
|
||||
onClicked: {
|
||||
var component = Qt.createComponent("qrc:/ui/views/manage_accounts.qml");
|
||||
var win = component.createObject(mainWindow);
|
||||
win.show();
|
||||
}
|
||||
}
|
||||
|
||||
// Search.
|
||||
TextField {
|
||||
signal searchTextChanged (string text)
|
||||
|
|
@ -42,12 +51,13 @@ ApplicationWindow {
|
|||
|
||||
// Start conference.
|
||||
ToolBarButton {
|
||||
image: '/imgs/start_conference.svg'
|
||||
image: 'qrc:/imgs/start_conference.svg'
|
||||
}
|
||||
}
|
||||
}
|
||||
id: mainWindow
|
||||
minimumHeight: 70
|
||||
minimumWidth: 640
|
||||
title: 'Linphone'
|
||||
visible: true
|
||||
}
|
||||
|
|
|
|||
195
tests/ui/views/manage_accounts.qml
Normal file
195
tests/ui/views/manage_accounts.qml
Normal file
|
|
@ -0,0 +1,195 @@
|
|||
import QtQuick 2.7
|
||||
import QtQuick.Controls 2.0
|
||||
import QtQuick.Layouts 1.3
|
||||
import QtQuick.Window 2.2
|
||||
|
||||
import 'qrc:/ui/components/form'
|
||||
|
||||
Window {
|
||||
id: window
|
||||
minimumHeight: 328
|
||||
minimumWidth: 480
|
||||
modality: Qt.WindowModal
|
||||
title: qsTr('manageAccountsTitle')
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 0
|
||||
|
||||
// Window description.
|
||||
Item {
|
||||
Layout.alignment : Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
height: 90
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: 50
|
||||
anchors.rightMargin: 50
|
||||
font.pointSize: 12
|
||||
text: qsTr('manageAccountsDescription')
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
wrapMode: Text.WordWrap
|
||||
}
|
||||
}
|
||||
|
||||
// Accounts list.
|
||||
Item {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
id: listViewContainer
|
||||
|
||||
ListView {
|
||||
anchors.fill: parent
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip: true
|
||||
highlightRangeMode: ListView.ApplyRange
|
||||
id: accountsList
|
||||
spacing: 0
|
||||
horizontalScrollBarPolicy: Qt.ScrollBarAlwaysOn
|
||||
// TODO: Remove, use C++ model instead.
|
||||
model: ListModel {
|
||||
ListElement {
|
||||
presence: 'connected'
|
||||
sipAddress: 'jim.williams.zzzz.yyyy.kkkk.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'connected'
|
||||
sipAddress: 'toto.lala.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'disconnected'
|
||||
sipAddress: 'machin.truc.sip.linphone.org'
|
||||
isDefault: true
|
||||
}
|
||||
ListElement {
|
||||
presence: 'absent'
|
||||
sipAddress: 'hey.listen.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'do_not_disturb'
|
||||
sipAddress: 'valentin.cognito.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'do_not_disturb'
|
||||
sipAddress: 'charles.henri.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'disconnected'
|
||||
sipAddress: 'yesyes.nono.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
ListElement {
|
||||
presence: 'connected'
|
||||
sipAddress: 'nsa.sip.linphone.org'
|
||||
isDefault: false
|
||||
}
|
||||
}
|
||||
delegate: Item {
|
||||
height: 34
|
||||
width: parent.width
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
color: isDefault ? '#EAEAEA' : 'transparent'
|
||||
id: accountLine
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: 15
|
||||
anchors.leftMargin: 15
|
||||
anchors.rightMargin: 15
|
||||
|
||||
// Default account.
|
||||
Item {
|
||||
Layout.fillHeight: parent.height
|
||||
Layout.preferredWidth: 20
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: isDefault ? 'qrc:/imgs/valid.svg' : ''
|
||||
}
|
||||
}
|
||||
|
||||
// Sip account.
|
||||
Item {
|
||||
Layout.fillHeight: parent.height
|
||||
Layout.fillWidth: true
|
||||
|
||||
Text {
|
||||
anchors.fill: parent
|
||||
clip: true
|
||||
color: '#59575A'
|
||||
text: sipAddress;
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Presence.
|
||||
Item {
|
||||
Layout.fillHeight: parent.height
|
||||
Layout.preferredWidth: 20
|
||||
|
||||
Image {
|
||||
anchors.fill: parent
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: 'qrc:/imgs/led_' + presence + '.svg'
|
||||
}
|
||||
}
|
||||
|
||||
// Update presence.
|
||||
Item {
|
||||
Layout.fillHeight: parent.height
|
||||
Layout.preferredWidth: 160
|
||||
|
||||
DialogComboBox {
|
||||
anchors.fill: parent
|
||||
model: ListModel {
|
||||
ListElement { key: qsTr('onlinePresence'); value: 1 }
|
||||
ListElement { key: qsTr('busyPresence'); value: 2 }
|
||||
ListElement { key: qsTr('beRightBackPresence'); value: 3 }
|
||||
ListElement { key: qsTr('awayPresence'); value: 4 }
|
||||
ListElement { key: qsTr('onThePhonePresence'); value: 5 }
|
||||
ListElement { key: qsTr('outToLunchPresence'); value: 6 }
|
||||
ListElement { key: qsTr('doNotDisturbPresence'); value: 7 }
|
||||
ListElement { key: qsTr('movedPresence'); value: 8 }
|
||||
ListElement { key: qsTr('usingAnotherMessagingServicePresence'); value: 9 }
|
||||
ListElement { key: qsTr('offlinePresence'); value: 10 }
|
||||
}
|
||||
textRole: 'key'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Validate
|
||||
Rectangle {
|
||||
Layout.alignment: Qt.AlignTop
|
||||
Layout.fillWidth: true
|
||||
height: 100
|
||||
|
||||
DialogButton {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.bottomMargin: 30
|
||||
anchors.left: parent.left
|
||||
anchors.leftMargin: 54
|
||||
text: qsTr('validate')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue