Added a refresh button to KCM, just in case.
We already have a refresh button on Android.
This commit is contained in:
parent
dfbe7c7bfc
commit
e809fa441c
3 changed files with 16 additions and 4 deletions
|
@ -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;
|
||||
|
|
10
kcm/kcm.ui
10
kcm/kcm.ui
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue