Browse Source

added change remote view

pull/2/head
Skycoder42 7 years ago
parent
commit
42d7903c4c
  1. 220
      src/imports/mvvmdatasyncquick/ChangeRemoteView.qml
  2. 6
      src/imports/mvvmdatasyncquick/DataSyncView.qml
  3. 4
      src/imports/mvvmdatasyncquick/icons/ic_check_white_24px.svg
  4. 3
      src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro
  5. 1
      src/imports/mvvmdatasyncquick/qmldir
  6. 1
      src/imports/mvvmdatasyncquick/qtmvvmdatasyncquick_plugin.qrc
  7. 3
      src/mvvmdatasyncquick/ChangeRemoteView.qml
  8. 1
      src/mvvmdatasyncquick/qtmvvmdatasyncquick_module.qrc

220
src/imports/mvvmdatasyncquick/ChangeRemoteView.qml

@ -0,0 +1,220 @@
import QtQuick 2.10
import QtQuick.Controls 2.3
import QtQuick.Controls.Material 2.3
import QtQuick.Controls.Universal 2.3
import QtQuick.Layouts 1.3
import de.skycoder42.QtDataSync 4.0
import de.skycoder42.QtMvvm.Core 1.0
import de.skycoder42.QtMvvm.Quick 1.0
import de.skycoder42.QtMvvm.DataSync.Core 1.0
import de.skycoder42.QtMvvm.Quick.Private 1.0
Page {
id: _changeRemoteView
property PChangeRemoteViewModel viewModel: null
header: ContrastToolBar {
id: _toolBar
RowLayout {
id: _toolLayout
anchors.fill: parent
spacing: 0
ActionButton {
id: _cancelButton
icon.name: "gtk-cancel"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_close"
text: qsTr("Cancel")
onClicked: QuickPresenter.popView()
}
Label {
id: _titleLabel
font.pointSize: 14
font.bold: true
elide: Label.ElideRight
horizontalAlignment: Qt.AlignLeft
verticalAlignment: Qt.AlignVCenter
Layout.fillWidth: true
Layout.leftMargin: 16
text: qsTr("Change Remote")
}
ToolButton {
id: _syncButton
implicitHeight: 48
text: qsTr("Change")
enabled: viewModel.valid
icon.width: 24
icon.height: 24
icon.name: "gtk-apply"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_check"
display: AbstractButton.TextBesideIcon
rightPadding: 16
onClicked: {
if(viewModel.completeSetup())
QuickPresenter.popView()
}
}
}
}
Pane {
anchors.fill: parent
ColumnLayout {
id: _layout
anchors.fill: parent
Label {
text: qsTr("Remote url:")
Layout.fillWidth: true
color: _urlEdit.focus ? _urlEdit.selectionColor : palette.text
opacity: _urlEdit.focus ? 1 : 0.5
}
TextField {
id: _urlEdit
Layout.fillWidth: true
validator: UrlValidator {
allowedSchemes: ["ws", "wss"]
}
MvvmBinding {
viewModel: _changeRemoteView.viewModel
viewModelProperty: "url"
view: _urlEdit
viewProperty: "text"
type: MvvmBinding.OneWayToViewModel
}
}
Label {
text: qsTr("Access key:")
Layout.fillWidth: true
color: _accessKeyEdit.focus ? _accessKeyEdit.selectionColor : palette.text
opacity: _accessKeyEdit.focus ? 1 : 0.5
}
TextField {
id: _accessKeyEdit
Layout.fillWidth: true
echoMode: TextInput.Password
MvvmBinding {
viewModel: _changeRemoteView.viewModel
viewModelProperty: "accessKey"
view: _accessKeyEdit
viewProperty: "text"
type: MvvmBinding.OneWayToViewModel
}
}
Label {
text: qsTr("Keep-Alive timout:")
Layout.fillWidth: true
color: _keepAliveEdit.focus ? _accessKeyEdit.selectionColor : palette.text
opacity: _keepAliveEdit.focus ? 1 : 0.5
}
SpinBox {
id: _keepAliveEdit
Layout.fillWidth: true
editable: true
from: 1
to: 1440
MvvmBinding {
viewModel: _changeRemoteView.viewModel
viewModelProperty: "accessKey"
view: _keepAliveEdit
viewProperty: "value"
}
}
CheckBox {
id: _keepDataBox
text: qsTr("Keep data")
MvvmBinding {
viewModel: _changeRemoteView.viewModel
viewModelProperty: "keepData"
view: _keepDataBox
viewProperty: "checked"
}
}
Label {
text: qsTr("Extra Headers:")
Layout.fillWidth: true
color: _headerList.focus ? _accessKeyEdit.selectionColor : palette.text
opacity: _headerList.focus ? 1 : 0.5
}
ListView {
id: _headerList
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: viewModel.headerModel
ScrollBar.vertical: ScrollBar {}
delegate: ItemDelegate {
width: parent.width
text: qsTr("%1: %2").arg(key).arg(value)
Button {
id: _rmButton
flat: true
icon.width: 24
icon.height: 24
icon.name: "user-trash"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever"
anchors.right: parent.right
implicitHeight: parent.height
implicitWidth: implicitHeight
onClicked: viewModel.removeHeaderConfig(index)
}
}
footer: RowLayout {
width: parent.width
TextField {
id: _keyEdit
placeholderText: qsTr("Key")
Layout.fillWidth: true
}
TextField {
id: _valueEdit
placeholderText: qsTr("Value")
Layout.fillWidth: true
}
Button {
id: _addButton
flat: true
enabled: _keyEdit.text !== ""
icon.width: 24
icon.height: 24
icon.name: "list-add"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_add"
onClicked: {
viewModel.addHeaderConfig(_keyEdit.text, _valueEdit.text);
_keyEdit.clear();
_valueEdit.clear();
}
}
}
}
}
}
}

6
src/imports/mvvmdatasyncquick/DataSyncView.qml

@ -236,7 +236,11 @@ Page {
}
ActionButton {
anchors.fill: parent
anchors.centerIn: parent
implicitHeight: parent.height
implicitWidth: parent.width
icon.name: "user-trash"
icon.source: "image://svg/de/skycoder42/qtmvvm/quick/icons/ic_delete_forever"
text: qsTr("Remove Device")

4
src/imports/mvvmdatasyncquick/icons/ic_check_white_24px.svg

@ -0,0 +1,4 @@
<svg fill="#FFFFFF" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/>
</svg>

After

Width:  |  Height:  |  Size: 213 B

3
src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro

@ -18,7 +18,8 @@ QML_FILES += \
SubButton.qml \
DataSyncView.qml \
IdentityEditView.qml \
ExportSetupView.qml
ExportSetupView.qml \
ChangeRemoteView.qml
RESOURCES += \
qtmvvmdatasyncquick_plugin.qrc

1
src/imports/mvvmdatasyncquick/qmldir

@ -9,5 +9,6 @@ internal SubButton SubButton.qml
IdentityEditView 1.0 IdentityEditView.qml
ExportSetupView 1.0 ExportSetupView.qml
ChangeRemoteView 1.0 ChangeRemoteView.qml
DataSyncView 1.0 DataSyncView.qml

1
src/imports/mvvmdatasyncquick/qtmvvmdatasyncquick_plugin.qrc

@ -8,5 +8,6 @@
<file alias="ic_export.svg">icons/ic_call_made_white_24px.svg</file>
<file alias="ic_import.svg">icons/ic_call_received_white_24px.svg</file>
<file alias="ic_exchange.svg">icons/ic_import_export_white_24px.svg</file>
<file alias="ic_check.svg">icons/ic_check_white_24px.svg</file>
</qresource>
</RCC>

3
src/mvvmdatasyncquick/ChangeRemoteView.qml

@ -0,0 +1,3 @@
import de.skycoder42.QtMvvm.DataSync.Quick 1.0 as QtMvvm
QtMvvm.ChangeRemoteView {}

1
src/mvvmdatasyncquick/qtmvvmdatasyncquick_module.qrc

@ -3,5 +3,6 @@
<file>DataSyncView.qml</file>
<file>IdentityEditView.qml</file>
<file>ExportSetupView.qml</file>
<file>ChangeRemoteView.qml</file>
</qresource>
</RCC>

Loading…
Cancel
Save