Add --iconified command line option.

This commit is contained in:
Ghislain MARY 2017-02-21 18:08:24 +01:00
parent 8736322634
commit e34016033a
5 changed files with 20 additions and 0 deletions

View file

@ -23,6 +23,10 @@
<source>applicationDescription</source>
<translation>A free SIP video-phone</translation>
</message>
<message>
<source>commandLineOptionIconified</source>
<translation>Start in the system tray, do not show the main interface.</translation>
</message>
</context>
<context>
<name>CallControls</name>

View file

@ -23,6 +23,10 @@
<source>applicationDescription</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>commandLineOptionIconified</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>CallControls</name>

View file

@ -151,6 +151,10 @@ void App::initContentApp () {
}
}
bool App::isInitiallyIconified () const {
return m_parser.isSet("iconified");
}
// -----------------------------------------------------------------------------
void App::parseArgs () {
@ -159,6 +163,9 @@ void App::parseArgs () {
m_parser.addVersionOption();
m_parser.addOptions({
{ "config", tr("commandLineOptionConfig"), "file" },
#ifndef __APPLE__
{ "iconified", tr("commandLineOptionIconified") },
#endif // __APPLE__
{ "selftest", tr("commandLineOptionSelftest") },
{ { "V", "verbose" }, tr("commandLineOptionVerbose") }
});

View file

@ -58,6 +58,8 @@ public:
void initContentApp ();
Q_INVOKABLE bool isInitiallyIconified () const;
Q_INVOKABLE QString locale () const {
return m_locale;
}

View file

@ -105,6 +105,9 @@ Controls1.ApplicationWindow {
Component.onCompleted: Utils.setTimeout(window, 0, function () {
_setView('Home')
if (App.isInitiallyIconified()) {
window.hide()
}
})
onActiveFocusItemChanged: activeFocusItem == null && smartSearchBar.hideMenu()