Commit e809fa44 authored by Albert Vaca Cintora's avatar Albert Vaca Cintora

Added a refresh button to KCM, just in case.

We already have a refresh button on Android.
parent dfbe7c7b
......@@ -75,7 +75,8 @@ KdeConnectKcm::KdeConnectKcm(QWidget *parent, const QVariantList&)
this, SLOT(unpair()));
connect(kcmUi->ping_button, SIGNAL(pressed()),
this, SLOT(sendPing()));
connect(kcmUi->refresh_button,SIGNAL(pressed()),
this, SLOT(refresh()));
}
KdeConnectKcm::~KdeConnectKcm()
......@@ -83,6 +84,12 @@ KdeConnectKcm::~KdeConnectKcm()
}
void KdeConnectKcm::refresh()
{
QDBusMessage msg = QDBusMessage::createMethodCall("org.kde.kdeconnect", "/modules/kdeconnect", "org.kde.kdeconnect.daemon", "forceOnNetworkChange");
QDBusConnection::sessionBus().call(msg);
}
void KdeConnectKcm::resetSelection()
{
kcmUi->deviceList->selectionModel()->setCurrentIndex(sortProxyModel->mapFromSource(currentIndex), QItemSelectionModel::ClearAndSelect);
......
......@@ -61,6 +61,7 @@ private Q_SLOTS:
void pairingSuccesful();
void pairingFailed(const QString& error);
void unpaired();
void refresh();
private:
Ui::KdeConnectKcmUi* kcmUi;
......
......@@ -32,12 +32,16 @@
</size>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QListView" name="deviceList"/>
</item>
<item>
<widget class="QPushButton" name="refresh_button">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
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