Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-client-qt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-client-qt
Commits
1d7d10a1
Commit
1d7d10a1
authored
1 year ago
by
Sébastien Blin
Committed by
Andreas Traczyk
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
mainapplication: retranslate systray
Change-Id: Ib8e7407fa702f4003b33b688fa0dca517ff9a7fd GitLab:
#1396
parent
c6899974
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/mainapplication.cpp
+27
-13
27 additions, 13 deletions
src/app/mainapplication.cpp
src/app/mainapplication.h
+3
-0
3 additions, 0 deletions
src/app/mainapplication.h
with
30 additions
and
13 deletions
src/app/mainapplication.cpp
+
27
−
13
View file @
1d7d10a1
...
...
@@ -105,7 +105,8 @@ ScreenInfo::onPhysicalDotsPerInchChanged()
}
MainApplication
::
MainApplication
(
int
&
argc
,
char
**
argv
)
:
QApplication
(
argc
,
argv
),
isCleanupped
(
false
)
:
QApplication
(
argc
,
argv
)
,
isCleanupped
(
false
)
{
const
char
*
qtVersion
=
qVersion
();
qInfo
()
<<
"Using Qt runtime version:"
<<
qtVersion
;
...
...
@@ -134,10 +135,19 @@ MainApplication::init()
settingsManager_
=
new
AppSettingsManager
(
this
);
systemTray_
=
new
SystemTray
(
settingsManager_
,
this
);
// These should should be QueuedConnection to ensure that the
// they are executed after the QML engine has been initialized,
// and after the QSystemTrayIcon has been created and shown.
QObject
::
connect
(
settingsManager_
,
&
AppSettingsManager
::
retranslate
,
engine_
.
get
(),
&
QQmlApplicationEngine
::
retranslate
);
&
QQmlApplicationEngine
::
retranslate
,
Qt
::
QueuedConnection
);
QObject
::
connect
(
settingsManager_
,
&
AppSettingsManager
::
retranslate
,
this
,
&
MainApplication
::
initSystray
,
Qt
::
QueuedConnection
);
setWindowIcon
(
QIcon
(
":/images/jami.ico"
));
...
...
@@ -361,7 +371,8 @@ MainApplication::initSystray()
{
systemTray_
->
setIcon
(
QIcon
(
":/images/jami.svg"
));
QMenu
*
systrayMenu
=
new
QMenu
();
// Create a new menu
systemTrayMenu_
.
reset
(
new
QMenu
);
QString
quitString
;
#ifdef Q_OS_WINDOWS
...
...
@@ -370,10 +381,10 @@ MainApplication::initSystray()
quitString
=
tr
(
"&Quit"
);
#endif
QAction
*
quitAction
=
new
QAction
(
quitString
,
this
);
QAction
*
quitAction
=
new
QAction
(
quitString
,
systemTrayMenu_
.
get
()
);
connect
(
quitAction
,
&
QAction
::
triggered
,
this
,
&
MainApplication
::
closeRequested
);
QAction
*
restoreAction
=
new
QAction
(
tr
(
"&Show Jami"
),
this
);
QAction
*
restoreAction
=
new
QAction
(
tr
(
"&Show Jami"
),
systemTrayMenu_
.
get
()
);
connect
(
restoreAction
,
&
QAction
::
triggered
,
this
,
&
MainApplication
::
restoreApp
);
connect
(
systemTray_
,
...
...
@@ -384,18 +395,21 @@ MainApplication::initSystray()
#ifdef Q_OS_WINDOWS
restoreApp
();
#elif !defined(Q_OS_MACOS)
QWindow
*
window
=
focusWindow
();
if
(
window
)
window
->
close
();
else
restoreApp
();
QWindow
*
window
=
focusWindow
();
if
(
window
)
window
->
close
();
else
restoreApp
();
#endif
}
});
systrayMenu
->
addAction
(
restoreAction
);
systrayMenu
->
addAction
(
quitAction
);
systemTray_
->
setContextMenu
(
systrayMenu
);
systemTrayMenu_
->
addAction
(
restoreAction
);
systemTrayMenu_
->
addAction
(
quitAction
);
// Set the new menu as the context menu
systemTray_
->
setContextMenu
(
systemTrayMenu_
.
get
());
systemTray_
->
show
();
}
...
...
This diff is collapsed.
Click to expand it.
src/app/mainapplication.h
+
3
−
0
View file @
1d7d10a1
...
...
@@ -124,5 +124,8 @@ private:
ScreenInfo
screenInfo_
;
// We will recreate the system tray menu when the user changes the language.
QScopedPointer
<
QMenu
>
systemTrayMenu_
;
bool
isCleanupped
;
};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment