Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linphone-desktop
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
linphone-desktop
Commits
5dd0161a
Commit
5dd0161a
authored
Jan 22, 2018
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(app): try to support menu bar between qt 5.9 and qt 5.10
parent
b59e8c29
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
25 deletions
+184
-25
resources.qrc
resources.qrc
+2
-0
App.cpp
src/app/App.cpp
+10
-2
MainWindowMenuBar.qml
ui/views/App/Main/+5.9/MainWindowMenuBar.qml
+79
-0
MainWindowMenuBar.qml
ui/views/App/Main/+mac/MainWindowMenuBar.qml
+79
-0
MainWindowMenuBar.qml
ui/views/App/Main/MainWindowMenuBar.qml
+14
-23
No files found.
resources.qrc
View file @
5dd0161a
...
@@ -395,6 +395,7 @@
...
@@ -395,6 +395,7 @@
<file>
ui/views/App/Calls/IncomingCall.qml
</file>
<file>
ui/views/App/Calls/IncomingCall.qml
</file>
<file>
ui/views/App/Calls/OutgoingCall.qml
</file>
<file>
ui/views/App/Calls/OutgoingCall.qml
</file>
<file>
ui/views/App/Calls/ZrtpTokenAuthentication.qml
</file>
<file>
ui/views/App/Calls/ZrtpTokenAuthentication.qml
</file>
<file>
ui/views/App/Main/+5.9/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml
</file>
<file>
ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithEmail.qml
</file>
<file>
ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithPhoneNumber.qml
</file>
<file>
ui/views/App/Main/Assistant/ActivateLinphoneSipAccountWithPhoneNumber.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantAbstractView.qml
</file>
<file>
ui/views/App/Main/Assistant/AssistantAbstractView.qml
</file>
...
@@ -419,6 +420,7 @@
...
@@ -419,6 +420,7 @@
<file>
ui/views/App/Main/Dialogs/ManageAccounts.qml
</file>
<file>
ui/views/App/Main/Dialogs/ManageAccounts.qml
</file>
<file>
ui/views/App/Main/Home.qml
</file>
<file>
ui/views/App/Main/Home.qml
</file>
<file>
ui/views/App/Main/InviteFriends.qml
</file>
<file>
ui/views/App/Main/InviteFriends.qml
</file>
<file>
ui/views/App/Main/+mac/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindow.js
</file>
<file>
ui/views/App/Main/MainWindow.js
</file>
<file>
ui/views/App/Main/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindowMenuBar.qml
</file>
<file>
ui/views/App/Main/MainWindow.qml
</file>
<file>
ui/views/App/Main/MainWindow.qml
</file>
...
...
src/app/App.cpp
View file @
5dd0161a
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include <QCommandLineParser>
#include <QCommandLineParser>
#include <QDir>
#include <QDir>
#include <QFileSelector>
#include <QFileSelector>
#include <QLibraryInfo>
#include <QMenu>
#include <QMenu>
#include <QQmlFileSelector>
#include <QQmlFileSelector>
#include <QSystemTrayIcon>
#include <QSystemTrayIcon>
...
@@ -197,8 +198,15 @@ void App::initContentApp () {
...
@@ -197,8 +198,15 @@ void App::initContentApp () {
// Init engine content.
// Init engine content.
mEngine
=
new
QQmlApplicationEngine
();
mEngine
=
new
QQmlApplicationEngine
();
// Provide `+custom` folders for custom components.
// Provide `+custom` folders for custom components and `5.9` for old components.
(
new
QQmlFileSelector
(
mEngine
,
mEngine
))
->
setExtraSelectors
(
QStringList
(
"custom"
));
// TODO: Remove 5.9 support in 6 months. (~ July 2018).
{
QStringList
selectors
(
"custom"
);
const
QVersionNumber
&
version
=
QLibraryInfo
::
version
();
if
(
version
.
majorVersion
()
==
5
&&
version
.
minorVersion
()
==
9
)
selectors
.
push_back
(
"5.9"
);
(
new
QQmlFileSelector
(
mEngine
,
mEngine
))
->
setExtraSelectors
(
selectors
);
}
qInfo
()
<<
QStringLiteral
(
"Activated selectors:"
)
<<
QQmlFileSelector
::
get
(
mEngine
)
->
selector
()
->
allSelectors
();
qInfo
()
<<
QStringLiteral
(
"Activated selectors:"
)
<<
QQmlFileSelector
::
get
(
mEngine
)
->
selector
()
->
allSelectors
();
// Set modules paths.
// Set modules paths.
...
...
ui/views/App/Main/+5.9/MainWindowMenuBar.qml
0 → 100644
View file @
5dd0161a
import
QtQuick
2.7
// Experimental.
import
Qt
.
labs
.
platform
1.0
import
Linphone
1.0
// =============================================================================
Item
{
function
open
()
{
menu
.
open
()
}
// ---------------------------------------------------------------------------
// Shortcuts.
// ---------------------------------------------------------------------------
Shortcut
{
id
:
settingsShortcut
sequence
:
'
Ctrl+P
'
onActivated
:
App
.
smartShowWindow
(
App
.
getSettingsWindow
())
}
Shortcut
{
id
:
quitShortcut
context
:
Qt
.
ApplicationShortcut
sequence
:
StandardKey
.
Quit
onActivated
:
Qt
.
quit
()
}
Shortcut
{
id
:
aboutShortcut
sequence
:
StandardKey
.
HelpContents
onActivated
:
{
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
Dialogs/About.qml
'
))
}
}
// ---------------------------------------------------------------------------
// Menu.
// ---------------------------------------------------------------------------
MenuBar
{
Menu
{
id
:
menu
MenuItem
{
role
:
MenuItem
.
PreferencesRole
shortcut
:
settingsShortcut
.
sequence
text
:
qsTr
(
'
settings
'
)
onTriggered
:
settingsShortcut
.
onActivated
()
}
MenuItem
{
role
:
MenuItem
.
AboutRole
text
:
qsTr
(
'
about
'
)
onTriggered
:
aboutShortcut
.
onActivated
()
}
MenuItem
{
role
:
MenuItem
.
QuitRole
shortcut
:
quitShortcut
.
sequence
text
:
qsTr
(
'
quit
'
)
onTriggered
:
quitShortcut
.
onActivated
()
}
}
}
}
ui/views/App/Main/+mac/MainWindowMenuBar.qml
0 → 100644
View file @
5dd0161a
import
QtQuick
2.7
// Experimental.
import
Qt
.
labs
.
platform
1.0
import
Linphone
1.0
// =============================================================================
Item
{
function
open
()
{
menu
.
open
()
}
// ---------------------------------------------------------------------------
// Shortcuts.
// ---------------------------------------------------------------------------
Shortcut
{
id
:
settingsShortcut
sequence
:
'
Ctrl+P
'
onActivated
:
App
.
smartShowWindow
(
App
.
getSettingsWindow
())
}
Shortcut
{
id
:
quitShortcut
context
:
Qt
.
ApplicationShortcut
sequence
:
StandardKey
.
Quit
onActivated
:
Qt
.
quit
()
}
Shortcut
{
id
:
aboutShortcut
sequence
:
StandardKey
.
HelpContents
onActivated
:
{
window
.
detachVirtualWindow
()
window
.
attachVirtualWindow
(
Qt
.
resolvedUrl
(
'
Dialogs/About.qml
'
))
}
}
// ---------------------------------------------------------------------------
// Menu.
// ---------------------------------------------------------------------------
MenuBar
{
Menu
{
id
:
menu
MenuItem
{
role
:
MenuItem
.
PreferencesRole
shortcut
:
settingsShortcut
.
sequence
text
:
qsTr
(
'
settings
'
)
onTriggered
:
settingsShortcut
.
onActivated
()
}
MenuItem
{
role
:
MenuItem
.
AboutRole
text
:
qsTr
(
'
about
'
)
onTriggered
:
aboutShortcut
.
onActivated
()
}
MenuItem
{
role
:
MenuItem
.
QuitRole
shortcut
:
quitShortcut
.
sequence
text
:
qsTr
(
'
quit
'
)
onTriggered
:
quitShortcut
.
onActivated
()
}
}
}
}
ui/views/App/Main/MainWindowMenuBar.qml
View file @
5dd0161a
import
QtQuick
2.7
import
QtQuick
2.7
import
QtQuick
.
Controls
2.3
// Experimental.
import
Qt
.
labs
.
platform
1.0
import
Linphone
1.0
import
Linphone
1.0
...
@@ -48,32 +46,25 @@ Item {
...
@@ -48,32 +46,25 @@ Item {
// Menu.
// Menu.
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
MenuBar
{
Menu
{
Menu
{
id
:
menu
id
:
menu
MenuItem
{
MenuItem
{
role
:
MenuItem
.
PreferencesRole
text
:
qsTr
(
'
settings
'
)
shortcut
:
settingsShortcut
.
sequence
text
:
qsTr
(
'
settings
'
)
onTriggered
:
settingsShortcut
.
onActivated
()
onTriggered
:
settingsShortcut
.
onActivated
()
}
}
MenuItem
{
MenuItem
{
role
:
MenuItem
.
AboutRole
text
:
qsTr
(
'
about
'
)
text
:
qsTr
(
'
about
'
)
onTriggered
:
aboutShortcut
.
onActivated
()
onTriggered
:
aboutShortcut
.
onActivated
()
}
}
MenuItem
{
MenuItem
{
role
:
MenuItem
.
QuitRole
text
:
qsTr
(
'
quit
'
)
shortcut
:
quitShortcut
.
sequence
text
:
qsTr
(
'
quit
'
)
onTriggered
:
quitShortcut
.
onActivated
()
onTriggered
:
quitShortcut
.
onActivated
()
}
}
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment