mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-03 22:56:49 +00:00
fix(App): do not open window before sub windows creation
This commit is contained in:
parent
7f62ae905a
commit
bd6072b2de
3 changed files with 19 additions and 14 deletions
|
|
@ -122,13 +122,18 @@ App::~App () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
static QQuickWindow *createSubWindow (QQmlApplicationEngine *engine, const char *path) {
|
||||
qInfo() << QStringLiteral("Creating subwindow: `%1`.").arg(path);
|
||||
|
||||
QQmlComponent component(engine, QUrl(path));
|
||||
if (component.isError()) {
|
||||
qWarning() << component.errors();
|
||||
abort();
|
||||
}
|
||||
qInfo() << QStringLiteral("Subwindow status: `%1`.").arg(component.status());
|
||||
|
||||
QObject *object = component.create();
|
||||
Q_ASSERT(object);
|
||||
|
||||
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
|
||||
object->setParent(engine);
|
||||
|
||||
|
|
@ -231,17 +236,6 @@ void App::initContentApp () {
|
|||
&CoreHandlers::coreStarted,
|
||||
[this, mustBeIconified]() {
|
||||
openAppAfterInit(mustBeIconified);
|
||||
|
||||
// Create other windows.
|
||||
mCallsWindow = createSubWindow(mEngine, QmlViewCallsWindow);
|
||||
mSettingsWindow = createSubWindow(mEngine, QmlViewSettingsWindow);
|
||||
QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [](QWindow::Visibility visibility) {
|
||||
if (visibility == QWindow::Hidden) {
|
||||
qInfo() << QStringLiteral("Update nat policy.");
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
core->setNatPolicy(core->getNatPolicy());
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
@ -536,6 +530,17 @@ QString App::getLocale () const {
|
|||
void App::openAppAfterInit (bool mustBeIconified) {
|
||||
qInfo() << QStringLiteral("Open linphone app.");
|
||||
|
||||
// Create other windows.
|
||||
mCallsWindow = createSubWindow(mEngine, QmlViewCallsWindow);
|
||||
mSettingsWindow = createSubWindow(mEngine, QmlViewSettingsWindow);
|
||||
QObject::connect(mSettingsWindow, &QWindow::visibilityChanged, this, [](QWindow::Visibility visibility) {
|
||||
if (visibility == QWindow::Hidden) {
|
||||
qInfo() << QStringLiteral("Update nat policy.");
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
core->setNatPolicy(core->getNatPolicy());
|
||||
}
|
||||
});
|
||||
|
||||
QQuickWindow *mainWindow = getMainWindow();
|
||||
|
||||
#ifndef __APPLE__
|
||||
|
|
|
|||
|
|
@ -175,8 +175,8 @@ void Notifier::showNotification (QObject *notification, int timeout) {
|
|||
|
||||
// Destroy it after timeout.
|
||||
QObject::connect(timer, &QTimer::timeout, this, [this, notification]() {
|
||||
deleteNotification(QVariant::fromValue(notification));
|
||||
});
|
||||
deleteNotification(QVariant::fromValue(notification));
|
||||
});
|
||||
|
||||
// Called explicitly (by a click on notification for example)
|
||||
QObject::connect(notification, SIGNAL(deleteNotification(QVariant)), this, SLOT(deleteNotification(QVariant)));
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@ DesktopPopup {
|
|||
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
||||
Icon {
|
||||
id: iconSign
|
||||
|
||||
|
|
@ -53,6 +54,5 @@ DesktopPopup {
|
|||
|
||||
iconSize: NotificationStyle.iconSize
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue