1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- import QtQuick 2.5
- import QtQuick.Controls 1.4
- import QtQuick.Layouts 1.0
- ApplicationWindow {
- visible: true
- width: 640
- height: 480
- title: qsTr("Hello World")
- SetNetworkInterface {
- id: setEth0
- mode: "static"
- ifacename: "eth0"
- address: "192.168.0.126"
- netmask: "255.255.255.0"
- nameserver: "192.168.0.101"
- gateway: "192.168.0.10"
- // infile: "/home/ru/BUILD/QT562_di-soric/GfA/board/GfA/Display001/rootfs/etc/network/interfaces"
- // outfile: "/root/out.txt"
- infile: "/home/ru/IFACE/interfaces"
- outfile: "/home/ru/IFACE/interfaces"
- onAddressChanged: {
- ipAddress.ipAddress = address;
- }
- }
- Button {
- x:10
- y:10
- height: 40
- width:120
- text: "Eth0 static"
- onClicked: {
- setEth0.mode = "static";
- setEth0.doSetInterface();
- }
- }
- Button {
- x:10
- y:80
- height: 40
- width:120
- text: "Eth0 dhcp"
- onClicked: {
- setEth0.mode = "dhcp";
- setEth0.doSetInterface();
- }
- }
- Button {
- x:10
- y:150
- height: 40
- width:120
- text: "restart Netw."
- onClicked: {
- //setEth0.doRestartNetwork();
- setEth0.doGetInterface();
- }
- }
- Label {
- x:500
- y:220
- text: ipAddress.ipAddress
- }
- IpAddressInput {
- id: ipAddress
- x: 20
- y: 220
- ipwidth: 150
- ipcolor: "red"
- ipAddress: setEth0.address
- Component.onCompleted: {
- setEth0.doGetInterface();
- }
- onIpAddressChanged: {
- setEth0.address = ipAddress.ipAddress;
- }
- }
- }
|