Commit caba6374 authored by Ronan's avatar Ronan

feat(ui/views/App/Main/MainWindowMenuBar): supports about window

parent 05b09965
......@@ -60,7 +60,7 @@ if(NOT WIN32)
set(CUSTOM_FLAGS "${CUSTOM_FLAGS} -Wsuggest-override -Werror=suggest-override")
endif()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CUSTOM_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG")
# ------------------------------------------------------------------------------
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>About</name>
<message>
<source>ok</source>
<translation>OK</translation>
</message>
</context>
<context>
<name>ActivateLinphoneSipAccountWithEmail</name>
<message>
......@@ -760,14 +767,6 @@ to chat or see the conversation history.</translation>
<source>quit</source>
<translation>Quit</translation>
</message>
<message>
<source>importContacts</source>
<translation>Import contacts from vCards</translation>
</message>
<message>
<source>exportContacts</source>
<translation>Export contacts as vCards</translation>
</message>
</context>
<context>
<name>ManageAccounts</name>
......
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>About</name>
<message>
<source>ok</source>
<translation>OK</translation>
</message>
</context>
<context>
<name>ActivateLinphoneSipAccountWithEmail</name>
<message>
......@@ -759,14 +766,6 @@ chatter ou voir l&apos;historique de conversation.</translation>
<source>quit</source>
<translation>Quitter</translation>
</message>
<message>
<source>importContacts</source>
<translation>Importer des contacts depuis des vCards</translation>
</message>
<message>
<source>exportContacts</source>
<translation>Exporter des contacts sous forme de vCards</translation>
</message>
</context>
<context>
<name>ManageAccounts</name>
......
......@@ -343,6 +343,7 @@
<file>ui/views/App/Calls/Incall.qml</file>
<file>ui/views/App/Calls/IncomingCall.qml</file>
<file>ui/views/App/Calls/OutgoingCall.qml</file>
<file>ui/views/App/Main/About.qml</file>
<file>ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml</file>
<file>ui/views/App/Main/Assistant/AssistantAbstractView.qml</file>
<file>ui/views/App/Main/Assistant/AssistantHome.qml</file>
......@@ -383,6 +384,7 @@
<file>ui/views/App/SplashScreen/SplashScreen.qml</file>
<file>ui/views/App/Styles/Calls/CallStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallsWindowStyle.qml</file>
<file>ui/views/App/Styles/Main/AboutStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/ActivateLinphoneSipAccountWithEmailStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantAbstractViewStyle.qml</file>
<file>ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml</file>
......
......@@ -50,6 +50,10 @@
#define QML_VIEW_SPLASH_SCREEN "qrc:/ui/views/App/SplashScreen/SplashScreen.qml"
#ifndef LINPHONE_VERSION
#define LINPHONE_VERSION "unknown"
#endif // ifndef LINPHONE_VERSION
using namespace std;
// =============================================================================
......@@ -253,6 +257,12 @@ bool App::hasFocus () const {
// -----------------------------------------------------------------------------
QString App::getVersion () const {
return ::Utils::linphoneStringToQString(LINPHONE_VERSION);
}
// -----------------------------------------------------------------------------
#define registerSharedSingletonType(TYPE, NAME, METHOD) qmlRegisterSingletonType<TYPE>( \
"Linphone", 1, 0, NAME, \
[](QQmlEngine *, QJSEngine *) -> QObject *{ \
......
......@@ -37,6 +37,8 @@ class DefaultTranslator;
class App : public SingleApplication {
Q_OBJECT;
Q_PROPERTY(QString version READ getVersion CONSTANT);
Q_PROPERTY(QString configLocale READ getConfigLocale WRITE setConfigLocale NOTIFY configLocaleChanged);
Q_PROPERTY(QString locale READ getLocale CONSTANT);
Q_PROPERTY(QVariantList availableLocales READ getAvailableLocales CONSTANT);
......@@ -76,6 +78,8 @@ signals:
void configLocaleChanged (const QString &locale);
private:
QString getVersion () const;
void registerTypes ();
void setTrayIcon ();
......
......@@ -79,7 +79,7 @@ VcardModel *CoreManager::createDetachedVcardModel () {
void CoreManager::forceRefreshRegisters () {
qInfo() << QStringLiteral("Refresh registers.");
mInstance->mCore->refreshRegisters();
mCore->refreshRegisters();
}
// -----------------------------------------------------------------------------
......@@ -128,8 +128,14 @@ void CoreManager::createLinphoneCore (const QString &configPath) {
// -----------------------------------------------------------------------------
QString CoreManager::getVersion () const {
return ::Utils::linphoneStringToQString(mCore->getVersion());
}
// -----------------------------------------------------------------------------
void CoreManager::iterate () {
mInstance->lockVideoRender();
mInstance->mCore->iterate();
mCore->iterate();
mInstance->unlockVideoRender();
}
......@@ -42,6 +42,8 @@ class QTimer;
class CoreManager : public QObject {
Q_OBJECT;
Q_PROPERTY(QString version READ getVersion CONSTANT);
public:
~CoreManager () = default;
......@@ -121,6 +123,8 @@ private:
void createLinphoneCore (const QString &configPath);
QString getVersion () const;
void iterate ();
std::shared_ptr<linphone::Core> mCore;
......
......@@ -104,7 +104,7 @@ AbstractDropDownMenu {
}
Loader {
property string $label: qsTr("audioStatsLabel")
property string $label: qsTr('audioStatsLabel')
property var $data: callStatistics.call.audioStats
sourceComponent: media
......@@ -112,7 +112,7 @@ AbstractDropDownMenu {
}
Loader {
property string $label: qsTr("videoStatsLabel")
property string $label: qsTr('videoStatsLabel')
property var $data: callStatistics.call.videoStats
sourceComponent: media
......
import QtQuick 2.7
import QtQuick.Layouts 1.3
import Common 1.0
import Linphone 1.0
import App.Styles 1.0
// =============================================================================
DialogPlus {
buttons: [
TextButtonB {
text: qsTr('ok')
onClicked: exit(0)
}
]
centeredButtons: true
height: AboutStyle.height
width: AboutStyle.width
Column {
anchors {
fill: parent
leftMargin: AboutStyle.leftMargin
rightMargin: AboutStyle.rightMargin
}
spacing: AboutStyle.spacing
RowLayout {
spacing: AboutStyle.versionsBlock.spacing
height: AboutStyle.versionsBlock.iconSize
width: parent.width
Icon {
icon: 'linphone_logo'
iconSize: parent.height
}
Column {
Layout.fillWidth: true
Layout.preferredHeight: parent.height
spacing: 0
Text {
color: AboutStyle.versionsBlock.appVersion.color
elide: Text.ElideRight
font.pointSize: AboutStyle.versionsBlock.appVersion.fontSize
text: 'Linphone Desktop ' + App.version
height: parent.height / 2
width: parent.width
verticalAlignment: Text.AlignVCenter
}
Text {
color: AboutStyle.versionsBlock.coreVersion.color
elide: Text.ElideRight
font.pointSize: AboutStyle.versionsBlock.coreVersion.fontSize
text: 'Linphone Core ' + CoreManager.version
height: parent.heigth / 2
width: parent.width
verticalAlignment: Text.AlignVCenter
}
}
}
Column {
spacing: AboutStyle.copyrightBlock.spacing
width: parent.width
Text {
elide: Text.ElideRight
font.pointSize: AboutStyle.copyrightBlock.url.fontSize
linkColor: AboutStyle.copyrightBlock.url.color
text: '<a href="https://www.linphone.org">https://www.linphone.org</a>'
width: parent.width
horizontalAlignment: Text.AlignHCenter
onLinkActivated: Qt.openUrlExternally(link)
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
cursorShape: parent.hoveredLink
? Qt.PointingHandCursor
: Qt.IBeamCursor
}
}
Text {
color: AboutStyle.copyrightBlock.license.color
elide: Text.ElideRight
font.pointSize: AboutStyle.copyrightBlock.license.fontSize
text: 'GNU General Public License V2\n\u00A9 2010-2017 Belledonne Communications'
width: parent.width
horizontalAlignment: Text.AlignHCenter
}
}
}
}
......@@ -7,16 +7,16 @@ import Linphone 1.0
import App.Styles 1.0
// ============================================================================
// =============================================================================
MenuBar {
id: container
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
property bool hide: false
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Workaround to hide toolbar.
// Use private properties of MenuBar.
......@@ -29,7 +29,7 @@ MenuBar {
yScale: Number(!hide)
}
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
style: MenuBarStyle {
background: Rectangle {
......@@ -109,9 +109,12 @@ MenuBar {
}
}
// --------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Options.
// ---------------------------------------------------------------------------
Menu {
title: qsTr('options')
MenuItem {
......@@ -138,36 +141,43 @@ MenuBar {
}
}
// ---------------------------------------------------------------------------
// Tools.
// ---------------------------------------------------------------------------
Menu {
title: qsTr('tools')
MenuItem {
text: qsTr('audioAssistant')
}
MenuSeparator {}
MenuItem {
text: qsTr('importContacts')
}
MenuItem {
text: qsTr('exportContacts')
onTriggered: console.log('TODO')
}
}
// ---------------------------------------------------------------------------
// Help.
// ---------------------------------------------------------------------------
Menu {
title: qsTr('help')
MenuItem {
shortcut: StandardKey.HelpContents
text: qsTr('about')
onTriggered: {
window.detachVirtualWindow()
window.attachVirtualWindow(Qt.resolvedUrl('About.qml'))
}
}
MenuSeparator {}
MenuItem {
text: qsTr('checkForUpdates')
onTriggered: console.log('TODO')
}
}
}
......@@ -30,7 +30,7 @@ Window {
fillMode: Image.PreserveAspectFit
mipmap: true
source: SplashScreenStyle.image
source: Constants.imagesPath + 'splash_screen' + Constants.imagesFormat
BusyIndicator {
height: SplashScreenStyle.busyIndicator.height
......
pragma Singleton
import QtQuick 2.7
import Common 1.0
// =============================================================================
QtObject {
property int height: 225
property int leftMargin: 25
property int rightMargin: 25
property int spacing: 20
property int width: 400
property QtObject copyrightBlock: QtObject {
property int spacing: 10
property QtObject license: QtObject {
property color color: Colors.d
property int fontSize: 10
}
property QtObject url: QtObject {
property color color: Colors.i
property int fontSize: 10
}
}
property QtObject versionsBlock: QtObject {
property int iconSize: 48
property int spacing: 10
property QtObject appVersion: QtObject {
property color color: Colors.d
property int fontSize: 10
}
property QtObject coreVersion: QtObject {
property color color: Colors.d
property int fontSize: 10
}
}
}
......@@ -7,7 +7,6 @@ QtObject {
property color color: '#444444' // Not a `Common.Color`. Specific case.
property int height: 350
property int width: 620
property url image: 'qrc:/assets/images/splash_screen.svg'
property QtObject busyIndicator: QtObject {
property int bottomMargin: 25
......
......@@ -13,6 +13,7 @@ singleton AssistantHomeStyle 1.0 Main/Assistant/AssistantH
singleton CreateLinphoneSipAccountStyle 1.0 Main/Assistant/CreateLinphoneSipAccountStyle.qml
singleton UseLinphoneSipAccountStyle 1.0 Main/Assistant/UseLinphoneSipAccountStyle.qml
singleton AboutStyle 1.0 Main/AboutStyle.qml
singleton AssistantStyle 1.0 Main/AssistantStyle.qml
singleton AuthenticationRequestStyle 1.0 Main/AuthenticationRequestStyle.qml
singleton ContactEditStyle 1.0 Main/ContactEditStyle.qml
......
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