Browse Source

added network exchange view

pull/2/head
Skycoder42 7 years ago
parent
commit
1e0880bd3d
  1. 6
      src/imports/mvvmdatasyncquick/DataSyncView.qml
  2. 134
      src/imports/mvvmdatasyncquick/NetworkExchangeView.qml
  3. 1
      src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro
  4. 1
      src/imports/mvvmdatasyncquick/qmldir
  5. 3
      src/mvvmdatasyncquick/NetworkExchangeView.qml
  6. 1
      src/mvvmdatasyncquick/qtmvvmdatasyncquick_module.qrc

6
src/imports/mvvmdatasyncquick/DataSyncView.qml

@ -158,19 +158,15 @@ Page {
Label {
id: _nameLabel
Layout.column: 0
Layout.row: 0
Layout.fillWidth: true
text: name
}
Label {
id: _fpLabel
Layout.column: 0
Layout.row: 1
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 7
Layout.leftMargin: 8
text: fingerPrint
elide: Text.ElideMiddle
opacity: 0.75

134
src/imports/mvvmdatasyncquick/NetworkExchangeView.qml

@ -0,0 +1,134 @@
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
Page {
id: _networkExchangeView
property NetworkExchangeViewModel viewModel: null
header: ContrastToolBar {
ToolBarLabel {
id: _titleLabel
anchors.fill: parent
text: qsTr("Network Exchange")
}
}
Pane {
anchors.fill: parent
ColumnLayout {
id: _layout
anchors.fill: parent
Label {
text: qsTr("Port:")
Layout.fillWidth: true
color: _portEdit.focus ? _nameEdit.selectionColor : palette.text
opacity: _portEdit.focus ? 1 : 0.5
}
SpinBox {
id: _portEdit
Layout.fillWidth: true
editable: true
from: 0
to: 65535
MvvmBinding {
viewModel: _networkExchangeView.viewModel
viewModelProperty: "port"
view: _portEdit
viewProperty: "value"
}
}
Label {
text: qsTr("Name:")
Layout.fillWidth: true
color: _nameEdit.focus ? _nameEdit.selectionColor : palette.text
opacity: _nameEdit.focus ? 1 : 0.5
}
TextField {
id: _nameEdit
Layout.fillWidth: true
MvvmBinding {
viewModel: _networkExchangeView.viewModel
viewModelProperty: "deviceName"
view: _nameEdit
viewProperty: "text"
}
}
Rectangle {
Layout.fillWidth: true
Layout.minimumHeight: 1
Layout.maximumHeight: 1
color: {
if(QuickPresenter.currentStyle === "Material")
return Material.foreground;
else if(QuickPresenter.currentStyle === "Universal")
return Universal.foreground;
else
return "black";
}
}
Switch {
id: _exchangeSwitch
text: qsTr("Exchange active:")
MvvmBinding {
viewModel: _networkExchangeView.viewModel
viewModelProperty: "active"
view: _exchangeSwitch
viewProperty: "checked"
}
}
ListView {
id: _exchangeList
Layout.fillWidth: true
Layout.fillHeight: true
clip: true
model: viewModel.deviceModel
ScrollBar.vertical: ScrollBar {}
delegate: ItemDelegate {
width: parent.width
contentItem: ColumnLayout {
id: _delegateLayout
spacing: 8
Label {
id: _nameLabel
Layout.fillWidth: true
text: name
}
Label {
id: _addressLabel
font.pointSize: _nameLabel.font.pointSize * 0.8
Layout.fillWidth: true
Layout.leftMargin: 8
text: address
opacity: 0.75
}
}
onClicked: viewModel.exportTo(index)
}
}
}
}
}

1
src/imports/mvvmdatasyncquick/mvvmdatasyncquick.pro

@ -17,6 +17,7 @@ SOURCES += \
QML_FILES += \
SubButton.qml \
DataSyncView.qml \
NetworkExchangeView.qml \
IdentityEditView.qml \
ExportSetupView.qml \
ChangeRemoteView.qml

1
src/imports/mvvmdatasyncquick/qmldir

@ -12,3 +12,4 @@ ExportSetupView 1.0 ExportSetupView.qml
ChangeRemoteView 1.0 ChangeRemoteView.qml
DataSyncView 1.0 DataSyncView.qml
NetworkExchangeView 1.0 NetworkExchangeView.qml

3
src/mvvmdatasyncquick/NetworkExchangeView.qml

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

1
src/mvvmdatasyncquick/qtmvvmdatasyncquick_module.qrc

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

Loading…
Cancel
Save