mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
stop rewrite
This commit is contained in:
parent
2912e6c9d3
commit
2e4c439ee5
4 changed files with 30 additions and 16 deletions
|
|
@ -159,7 +159,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<source>usernameStatusInvalidCharacters</source>
|
||||
<translation>Caractères invalides détectés (regex : `%1`).</translation>
|
||||
<translation>Caractères invalides détectés (regex : `%1`).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>usernameStatusInvalid</source>
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
</message>
|
||||
<message>
|
||||
<source>passwordStatusInvalidCharacters</source>
|
||||
<translation>Caractères invalides détectés (regex : `%1`).</translation>
|
||||
<translation>Caractères invalides détectés (regex : `%1`).</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>passwordStatusMissingCharacters</source>
|
||||
|
|
@ -1883,7 +1883,7 @@ Cliquez ici : <a href="%1">%1</a>
|
|||
</message>
|
||||
<message>
|
||||
<source>serverTooltip</source>
|
||||
<translation>Serveur LDAP. ie : ldap:// pour un serveur local ou ldap://ldap.example.org/</translation>
|
||||
<translation>Serveur LDAP. ie : ldap:// pour un serveur local ou ldap://ldap.example.org/</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>bindDNLabel</source>
|
||||
|
|
|
|||
|
|
@ -697,6 +697,10 @@ void App::registerSharedToolTypes () {
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
void App::setTrayIcon () {
|
||||
if(mSystemTrayIcon){
|
||||
mSystemTrayIcon->hide();
|
||||
delete mSystemTrayIcon;
|
||||
}
|
||||
QQuickWindow *root = getMainWindow();
|
||||
QSystemTrayIcon *systemTrayIcon = new QSystemTrayIcon(mEngine);
|
||||
|
||||
|
|
@ -750,6 +754,7 @@ void App::setTrayIcon () {
|
|||
systemTrayIcon->setIcon(QIcon(Constants::WindowIconPath));
|
||||
systemTrayIcon->setToolTip(APPLICATION_NAME);
|
||||
systemTrayIcon->show();
|
||||
|
||||
mSystemTrayIcon = systemTrayIcon;
|
||||
if(!QSystemTrayIcon::isSystemTrayAvailable())
|
||||
qInfo() << "System tray is not available";
|
||||
|
|
|
|||
|
|
@ -72,7 +72,6 @@ CoreManager::CoreManager (QObject *parent, const QString &configPath) :
|
|||
QObject::connect(coreHandlers, &CoreHandlers::coreStarting, this, &CoreManager::startIterate, Qt::QueuedConnection);
|
||||
QObject::connect(coreHandlers, &CoreHandlers::setLastRemoteProvisioningState, this, &CoreManager::setLastRemoteProvisioningState);
|
||||
QObject::connect(coreHandlers, &CoreHandlers::coreStarted, this, &CoreManager::initCoreManager, Qt::QueuedConnection);
|
||||
QObject::connect(coreHandlers, &CoreHandlers::coreStopped, this, &CoreManager::stopIterate, Qt::QueuedConnection);
|
||||
QObject::connect(coreHandlers, &CoreHandlers::logsUploadStateChanged, this, &CoreManager::handleLogsUploadStateChanged);
|
||||
QTimer::singleShot(10, [this, configPath](){// Delay the creation in order to have the CoreManager instance set before
|
||||
createLinphoneCore(configPath);
|
||||
|
|
@ -134,14 +133,12 @@ void CoreManager::init (QObject *parent, const QString &configPath) {
|
|||
void CoreManager::uninit () {
|
||||
if (mInstance) {
|
||||
connect(mInstance, &QObject::destroyed, []()mutable{
|
||||
mInstance = nullptr;
|
||||
qInfo() << "Core is correctly destroyed";
|
||||
mInstance = nullptr;
|
||||
});
|
||||
QObject::connect(mInstance->getHandlers().get(), &CoreHandlers::coreStopped, mInstance, &QObject::deleteLater, Qt::QueuedConnection); // Delete data only when the core is Off
|
||||
mInstance->stopIterate();
|
||||
|
||||
mInstance->lockVideoRender();// Stop do iterations. We have to protect GUI.
|
||||
mInstance->mCore->stop();
|
||||
mInstance->unlockVideoRender();
|
||||
qInfo() << "Waiting for completion of stopping core";
|
||||
QTest::qWaitFor([&]() {return mInstance == nullptr;},10000);
|
||||
if( mInstance){
|
||||
|
|
@ -348,17 +345,28 @@ void CoreManager::startIterate(){
|
|||
}
|
||||
|
||||
void CoreManager::stopIterate(){
|
||||
qInfo() << QStringLiteral("Stop iterate");
|
||||
mCbsTimer->stop();
|
||||
mCbsTimer->deleteLater();// allow the timer to continue its stuff
|
||||
mCbsTimer = nullptr;
|
||||
qInfo() << QStringLiteral("Stopping iterate");
|
||||
mCbsTimerStop = true;
|
||||
}
|
||||
|
||||
void CoreManager::iterate () {
|
||||
lockVideoRender();
|
||||
if(mCore)
|
||||
mCore->iterate();
|
||||
unlockVideoRender();
|
||||
if( mCbsTimerStop){
|
||||
qInfo() << QStringLiteral("Stop iterate");
|
||||
mCbsTimerStop = false;
|
||||
mCbsTimer->stop();
|
||||
mCbsTimer->deleteLater();// allow the timer to continue its stuff
|
||||
mCbsTimer = nullptr;
|
||||
qInfo() << "Stopping core";
|
||||
mCore->stop();
|
||||
}else{
|
||||
lockVideoRender();
|
||||
if(mCore){
|
||||
auto state = mCore->getGlobalState();
|
||||
if( state != linphone::GlobalState::Shutdown && state != linphone::GlobalState::Off)
|
||||
mCore->iterate();
|
||||
}
|
||||
unlockVideoRender();
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -229,6 +229,7 @@ private:
|
|||
LdapListModel *mLdapListModel = nullptr;
|
||||
|
||||
QTimer *mCbsTimer = nullptr;
|
||||
bool mCbsTimerStop = false;
|
||||
|
||||
QMutex mMutexVideoRender;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue