Commit 4704c5d3 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(app): add many shortcuts, hide settings...

parent 10da9784
...@@ -429,6 +429,10 @@ Server url not configured.</translation> ...@@ -429,6 +429,10 @@ Server url not configured.</translation>
<source>confirm</source> <source>confirm</source>
<translation>CONFIRM</translation> <translation>CONFIRM</translation>
</message> </message>
<message>
<source>inviteFriendsTitle</source>
<translation>Linphone - Invite Friends</translation>
</message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
......
...@@ -428,6 +428,10 @@ Url du serveur non configurée.</translation> ...@@ -428,6 +428,10 @@ Url du serveur non configurée.</translation>
<source>confirm</source> <source>confirm</source>
<translation>CONFIRMER</translation> <translation>CONFIRMER</translation>
</message> </message>
<message>
<source>inviteFriendsTitle</source>
<translation>Linphone - Inviter des amis</translation>
</message>
</context> </context>
<context> <context>
<name>MainWindow</name> <name>MainWindow</name>
......
...@@ -50,10 +50,11 @@ public: ...@@ -50,10 +50,11 @@ public:
QQuickWindow *getCallsWindow () const; QQuickWindow *getCallsWindow () const;
QQuickWindow *getMainWindow () const; QQuickWindow *getMainWindow () const;
QQuickWindow *getSettingsWindow () const;
bool hasFocus () const; bool hasFocus () const;
Q_INVOKABLE QQuickWindow *getSettingsWindow () const;
Q_INVOKABLE QString locale () const { Q_INVOKABLE QString locale () const {
return m_locale; return m_locale;
} }
......
...@@ -37,6 +37,15 @@ Window { ...@@ -37,6 +37,15 @@ Window {
// Handle normal windows close. // Handle normal windows close.
onClosing: !_disableExitStatus && exitStatus(0) onClosing: !_disableExitStatus && exitStatus(0)
// ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: exit(0)
}
// ---------------------------------------------------------------------------
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
......
...@@ -41,6 +41,13 @@ Window { ...@@ -41,6 +41,13 @@ Window {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: window.hide()
}
// ---------------------------------------------------------------------------
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: '#000000' // Not a style. color: '#000000' // Not a style.
......
...@@ -12,17 +12,18 @@ DialogPlus { ...@@ -12,17 +12,18 @@ DialogPlus {
TextButtonA { TextButtonA {
text: qsTr('cancel') text: qsTr('cancel')
onClicked: exit(0) onClicked: exit(-1)
}, },
TextButtonB { TextButtonB {
enabled: email.length && message.length enabled: email.length && message.length
text: qsTr('confirm') text: qsTr('confirm')
onClicked: exit(-1) onClicked: exit(0)
} }
] ]
centeredButtons: true centeredButtons: true
title: qsTr('inviteFriendsTitle')
height: InviteFriendsStyle.height height: InviteFriendsStyle.height
width: InviteFriendsStyle.width width: InviteFriendsStyle.width
......
...@@ -103,6 +103,13 @@ Controls1.ApplicationWindow { ...@@ -103,6 +103,13 @@ Controls1.ApplicationWindow {
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: window.hide()
}
// ---------------------------------------------------------------------------
ColumnLayout { ColumnLayout {
id: container id: container
......
...@@ -2,7 +2,7 @@ import QtQuick 2.7 ...@@ -2,7 +2,7 @@ import QtQuick 2.7
import QtQuick.Controls 1.4 import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4 import QtQuick.Controls.Styles 1.4
import Common 1.0 as Common import Linphone 1.0
import App.Styles 1.0 import App.Styles 1.0
...@@ -109,6 +109,8 @@ import App.Styles 1.0 ...@@ -109,6 +109,8 @@ import App.Styles 1.0
MenuItem { MenuItem {
shortcut: 'Ctrl+P' shortcut: 'Ctrl+P'
text: qsTr('settings') text: qsTr('settings')
onTriggered: App.getSettingsWindow().show()
} }
MenuSeparator {} MenuSeparator {}
...@@ -116,6 +118,8 @@ import App.Styles 1.0 ...@@ -116,6 +118,8 @@ import App.Styles 1.0
MenuItem { MenuItem {
shortcut: StandardKey.Quit shortcut: StandardKey.Quit
text: qsTr('quit') text: qsTr('quit')
onTriggered: Qt.quit()
} }
} }
......
...@@ -19,7 +19,15 @@ ApplicationWindow { ...@@ -19,7 +19,15 @@ ApplicationWindow {
minimumWidth: SettingsWindowStyle.width minimumWidth: SettingsWindowStyle.width
title: qsTr('settingsTitle') title: qsTr('settingsTitle')
visible: true
// ---------------------------------------------------------------------------
Shortcut {
sequence: StandardKey.Close
onActivated: window.hide()
}
// ---------------------------------------------------------------------------
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
......
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