Commit 2fab9954 authored by Viktor Porvaznik's avatar Viktor Porvaznik Committed by Viktor Porvaznik

More work on Dbus #2

parent fd56088e
......@@ -23,6 +23,7 @@ import QtQuick.Controls 1.4
import QtQuick.Controls 2 as Controls2
import QtQuick.Layouts 1.3
import org.kde.kdeconnect 1.0
import QtQml 2.12
ApplicationWindow {
id: mainWindow
......@@ -176,7 +177,7 @@ ApplicationWindow {
statusBar: StatusBar {
ComboBox {
id: devicesCombo
enabled: count > 0
enabled: true
anchors.fill: parent
model: DevicesSortProxyModel {
id: devicesModel
......@@ -188,7 +189,13 @@ ApplicationWindow {
devicesCombo.currentIndex = 0
}
}
property QtObject currentDevice: devicesCombo.currentIndex >= 0 ? devicesModel.data(devicesModel.index(devicesCombo.currentIndex, 0), DevicesModel.DeviceRole) : null
textRole: "display"
onCurrentIndexChanged: {
console.log("activated .... ")
syncTableModel.loadModel(currentDevice.id())
}
}
}
}
......@@ -23,9 +23,9 @@
const QStringList FileSync::SyncTableModel::s_syncTableColumns = QStringList({"localPath", "remotePath", "direction", "postSyncScript"});
void FileSync::SyncTableModel::loadModel()
void FileSync::SyncTableModel::loadModel(const QString &deviceId)
{
qDebug() << "Loading model" << endl;
qDebug() << "Loading model for " << deviceId << endl;
FileSyncAppInterface *fileSyncAppInterface = new FileSyncAppInterface(this);
QDBusPendingReply<QVariantList> reply = fileSyncAppInterface->getConfiguration("testDevice");
......
......@@ -40,7 +40,6 @@ namespace FileSync {
public:
SyncTableModel() {
loadModel();
qDebug() << m_data << endl;
}
......@@ -131,7 +130,6 @@ namespace FileSync {
public Q_SLOTS:
bool insertADefaultRow()
{
loadModel();
bool retValue = insertRows(rowCount(), 1);
saveModel(m_data);
return retValue;
......@@ -178,7 +176,7 @@ namespace FileSync {
void saveModel(const QJsonArray& model);
void loadModel();
void loadModel(const QString &deviceId);
};
}
......
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