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
1d53011f
Commit
1d53011f
authored
Mar 03, 2017
by
Ronan Abhamon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(src/app/App): show window if a secondary instance is created
parent
52cba384
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
11 deletions
+18
-11
App.cpp
linphone-desktop/src/app/App.cpp
+11
-2
main.cpp
linphone-desktop/src/main.cpp
+7
-9
No files found.
linphone-desktop/src/app/App.cpp
View file @
1d53011f
...
...
@@ -60,7 +60,7 @@ inline bool installLocale (App &app, QTranslator &translator, const QLocale &loc
return
translator
.
load
(
locale
,
LANGUAGES_PATH
)
&&
app
.
installTranslator
(
&
translator
);
}
App
::
App
(
int
&
argc
,
char
*
argv
[])
:
SingleApplication
(
argc
,
argv
)
{
App
::
App
(
int
&
argc
,
char
*
argv
[])
:
SingleApplication
(
argc
,
argv
,
true
)
{
setApplicationVersion
(
"4.0"
);
setWindowIcon
(
QIcon
(
WINDOW_ICON_PATH
));
...
...
@@ -143,7 +143,7 @@ void App::initContentApp () {
}
}
// Register types
and create sub-windows
.
// Register types.
registerTypes
();
// Enable notifications.
...
...
@@ -155,7 +155,9 @@ void App::initContentApp () {
core
->
setParent
(
this
);
}
// Create sub windows.
createSubWindows
();
// Load main view.
qInfo
()
<<
"Loading main view..."
;
m_engine
.
load
(
QUrl
(
QML_VIEW_MAIN_WINDOW
));
...
...
@@ -177,6 +179,13 @@ void App::initContentApp () {
if
(
m_parser
.
isSet
(
"selftest"
))
QTimer
::
singleShot
(
300
,
this
,
&
App
::
quit
);
QObject
::
connect
(
this
,
&
App
::
receivedMessage
,
this
,
[
this
](
int
,
QByteArray
message
)
{
if
(
message
==
"show"
)
getMainWindow
()
->
showNormal
();
}
);
}
// -----------------------------------------------------------------------------
...
...
linphone-desktop/src/main.cpp
View file @
1d53011f
...
...
@@ -32,23 +32,21 @@ using namespace std;
int
main
(
int
argc
,
char
*
argv
[])
{
Logger
::
init
();
// Force OpenGLES & shader version 2.0.
QCoreApplication
::
setAttribute
(
Qt
::
AA_UseOpenGLES
,
true
);
// Force shader version 2.0.
QSurfaceFormat
fmt
;
fmt
.
setVersion
(
2
,
0
);
QSurfaceFormat
::
setDefaultFormat
(
fmt
);
/*
* TODO: Uncomment me in the future!
* Disabled for a moment.
* `QXcbConnection: XCB error` errors on Cinnamon.
* QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
*/
App
app
(
argc
,
argv
);
app
.
parseArgs
();
if
(
app
.
isSecondary
())
{
app
.
sendMessage
(
"show"
,
0
);
return
0
;
}
app
.
initContentApp
();
// Run!
...
...
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