3 import
QtQuick.Controls.Material 2.3
4 import
QtQuick.Controls.Universal 2.3
34 property DataSyncViewModel viewModel: null
46 Layout.fillWidth:
true 47 text: qsTr(
"Synchronization")
52 icon.name:
"view-refresh" 53 icon.source:
"qrc:/de/skycoder42/qtmvvm/quick/icons/ic_sync.svg" 54 text: qsTr(
"Synchronize")
55 onClicked: viewModel.syncOrConnect()
60 icon.name:
"fingerprint-gui" 61 icon.source:
"qrc:/de/skycoder42/qtmvvm/quick/icons/ic_fingerprint.svg" 62 text: qsTr(
"Edit Identity")
63 onClicked: viewModel.showDeviceInfo()
70 text: qsTr(
"Update exchange key")
71 onClicked: viewModel.accountManager.updateExchangeKey()
77 text: qsTr(
"Reload devices list")
78 onClicked: viewModel.accountManager.listDevices()
84 text: qsTr(
"Change remote server")
85 onClicked: viewModel.changeRemote()
89 text: qsTr(
"Reset Identity")
90 onClicked: viewModel.performReset()
105 text: qsTr(
"Synchronization enabled")
106 Layout.fillWidth: true
109 viewModel: _dataSyncView.
viewModel.syncManager
110 viewModelProperty:
"syncEnabled" 112 viewProperty:
"checked" 118 Layout.fillWidth:
true 119 text: viewModel.statusString
122 horizontalAlignment: Text.AlignHCenter
123 verticalAlignment: Text.AlignVCenter
128 Layout.fillWidth:
true 131 value: viewModel.syncManager.syncProgress
132 visible: !_errorLabel.visible
137 Layout.fillWidth:
true 138 wrapMode: Text.WordWrap
139 text: viewModel.syncManager.lastError
146 Layout.fillWidth:
true 147 Layout.minimumHeight: 1
148 Layout.maximumHeight: 1
151 return Material.foreground;
153 return Universal.foreground;
160 Layout.fillWidth:
true 161 text: qsTr(
"Other Devices:")
166 Layout.fillWidth:
true 167 Layout.fillHeight:
true 169 model: viewModel.sortedModel
171 ScrollBar.vertical: ScrollBar {}
173 delegate: SwipeDelegate {
177 contentItem: ColumnLayout {
183 Layout.fillWidth:
true 189 font.pointSize: _nameLabel.font.pointSize * 0.8
190 Layout.fillWidth:
true 193 elide: Text.ElideMiddle
198 ListView.onRemove: SequentialAnimation {
200 target: _swipeDelegate
201 property:
"ListView.delayRemove" 205 target: _swipeDelegate
208 easing.type: Easing.InOutQuad
211 target: _swipeDelegate
212 property:
"ListView.delayRemove" 217 swipe.right: Rectangle {
218 height: parent.height
220 anchors.right: parent.right
223 return Material.color(Material.Red);
225 return Universal.color(Universal.Red);
231 anchors.centerIn: parent
232 implicitHeight: parent.height
233 implicitWidth: parent.width
235 icon.name:
"user-trash" 236 icon.source:
"qrc:/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever.svg" 237 text: qsTr(
"Remove Device")
239 Material.foreground: "white"
240 Universal.foreground: "white"
243 _swipeDelegate.swipe.close();
244 viewModel.removeDevice(index)
256 anchors.right: parent.right
257 anchors.bottom: parent.bottom
260 text: qsTr(
"Add new devices")
261 icon.name: checked ? "tab-close" : "list-add"
262 icon.source: checked ?
263 "qrc:/
de/skycoder42/qtmvvm/quick/icons/ic_close.svg" :
264 "qrc:/
de/skycoder42/qtmvvm/quick/icons/ic_add.svg"
270 reference: _addButton
271 expanded: _addButton.checked
273 text: qsTr(
"Network Exchange")
274 icon.name: "network-connect"
275 icon.source: "qrc:/
de/skycoder42/qtmvvm/quick/icons/ic_exchange.svg"
278 viewModel.startNetworkExchange();
279 _addButton.checked =
false;
286 reference: _exchangeButton
287 expanded: _addButton.checked
289 text: qsTr(
"Export to file")
290 icon.name: "document-export"
291 icon.source: "qrc:/
de/skycoder42/qtmvvm/quick/icons/ic_export.svg"
294 viewModel.startExport();
295 _addButton.checked =
false;
302 reference: _exportButton
303 expanded: _addButton.checked
305 text: qsTr(
"Import from file")
306 icon.name: "document-import"
307 icon.source: "qrc:/
de/skycoder42/qtmvvm/quick/icons/ic_import.svg"
310 viewModel.startImport();
311 _addButton.checked =
false;
A QML class to create a local mvvm multiway binding.
The QML import for the QtMvvmDataSyncCore QML module.
The QML import for the QtMvvmCore QML module.
QString currentStyle
The name of the currently active Quick Controls 2 Style.
The QML import for the QtMvvmQuick QML module.
QObject viewModel
The object in the role of a viewmodel.
A QML singleton to access common presenter methods globally.