Commit c392047c authored by Ronan's avatar Ronan
Browse files

feat(src/app/App): display Assistant if it's the first time app launch

parent c811ece5
...@@ -144,7 +144,7 @@ void App::initContentApp () { ...@@ -144,7 +144,7 @@ void App::initContentApp () {
qInfo() << QStringLiteral("Received message from other application: `%1`.").arg(QString(message)); qInfo() << QStringLiteral("Received message from other application: `%1`.").arg(QString(message));
if (message == "show") if (message == "show")
App::smartShowWindow(getMainWindow()); smartShowWindow(getMainWindow());
} }
); );
} }
...@@ -391,7 +391,7 @@ void App::setTrayIcon () { ...@@ -391,7 +391,7 @@ void App::setTrayIcon () {
QAction *restoreAction = new QAction("Restore", root); QAction *restoreAction = new QAction("Restore", root);
root->connect(restoreAction, &QAction::triggered, root, [root] { root->connect(restoreAction, &QAction::triggered, root, [root] {
App::smartShowWindow(root); smartShowWindow(root);
}); });
// trayIcon: Left click actions. // trayIcon: Left click actions.
...@@ -402,7 +402,7 @@ void App::setTrayIcon () { ...@@ -402,7 +402,7 @@ void App::setTrayIcon () {
) { ) {
if (reason == QSystemTrayIcon::Trigger) { if (reason == QSystemTrayIcon::Trigger) {
if (root->visibility() == QWindow::Hidden) if (root->visibility() == QWindow::Hidden)
App::smartShowWindow(root); smartShowWindow(root);
else else
root->hide(); root->hide();
} }
...@@ -456,6 +456,8 @@ void App::openAppAfterInit () { ...@@ -456,6 +456,8 @@ void App::openAppAfterInit () {
qInfo() << QStringLiteral("Open linphone app."); qInfo() << QStringLiteral("Open linphone app.");
QQuickWindow *mainWindow = getMainWindow();
#ifndef __APPLE__ #ifndef __APPLE__
// Enable TrayIconSystem. // Enable TrayIconSystem.
if (!QSystemTrayIcon::isSystemTrayAvailable()) if (!QSystemTrayIcon::isSystemTrayAvailable())
...@@ -463,11 +465,20 @@ void App::openAppAfterInit () { ...@@ -463,11 +465,20 @@ void App::openAppAfterInit () {
else else
setTrayIcon(); setTrayIcon();
if (!mParser.isSet("iconified")) smartShowWindow(mainWindow);
App::smartShowWindow(getMainWindow());
#else #else
App::smartShowWindow(getMainWindow()); if (!mParser.isSet("iconified"))
smartShowWindow(mainWindow);
#endif // ifndef __APPLE__ #endif // ifndef __APPLE__
// Display Assistant if it's the first time app launch.
{
shared_ptr<linphone::Config> config = CoreManager::getInstance()->getCore()->getConfig();
if (config->getInt(SettingsModel::UI_SECTION, "force_assistant_at_startup", 1)) {
QMetaObject::invokeMethod(mainWindow, "setView", Q_ARG(QVariant, "Assistant"), Q_ARG(QVariant, ""));
config->setInt(SettingsModel::UI_SECTION, "force_assistant_at_startup", 0);
}
}
} }
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
......
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