mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 14:44:01 +00:00
feat(ui/views/App/Main/MainWindow): add a hidden button to refresh registers
This commit is contained in:
parent
dd09e6d3b1
commit
2069e990af
3 changed files with 34 additions and 0 deletions
|
|
@ -26,6 +26,7 @@
|
|||
#include "CoreManager.hpp"
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QTimer>
|
||||
|
||||
|
|
@ -77,10 +78,19 @@ void CoreManager::init (QObject *parent, const QString &config_path) {
|
|||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
VcardModel *CoreManager::createDetachedVcardModel () {
|
||||
return new VcardModel(linphone::Factory::get()->createVcard());
|
||||
}
|
||||
|
||||
void CoreManager::forceRefreshRegisters () {
|
||||
qInfo() << QStringLiteral("Refresh registers.");
|
||||
m_instance->m_core->refreshRegisters();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CoreManager::setDatabasesPaths () {
|
||||
m_core->setFriendsDatabasePath(Paths::getFriendsListFilepath());
|
||||
m_core->setCallLogsDatabasePath(Paths::getCallHistoryFilepath());
|
||||
|
|
|
|||
|
|
@ -100,6 +100,8 @@ public:
|
|||
// Warning: The ownership of `VcardModel` is `QQmlEngine::JavaScriptOwnership` by default.
|
||||
Q_INVOKABLE VcardModel *createDetachedVcardModel ();
|
||||
|
||||
Q_INVOKABLE void forceRefreshRegisters ();
|
||||
|
||||
private:
|
||||
CoreManager (QObject *parent, const QString &config_path);
|
||||
|
||||
|
|
|
|||
|
|
@ -272,4 +272,26 @@ Controls1.ApplicationWindow {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Hiden button to force registration.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Button {
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
color: 'transparent' // Not a style.
|
||||
}
|
||||
|
||||
flat: true
|
||||
|
||||
height: accountStatus.height
|
||||
width: MainWindowStyle.toolBar.leftMargin
|
||||
|
||||
onClicked: CoreManager.forceRefreshRegisters()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue