123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- 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
- }
- Label {
- x:500
- y:240
- text: ipNetmask.ipAddress
- }
- IpAddressInput {
- id: ipAddress
- posX: 20
- posY: 220
- ipwidth: 200
- ipcolor: "black"
- ipAddress: setEth0.address
- ipFontSize: 20
- Component.onCompleted: {
- setEth0.doGetInterface();
- }
- onIpAddressChanged: {
- setEth0.address = ipAddress.ipAddress;
- }
- }
- IpAddressInput {
- id: ipNetmask
- posX: 20
- posY: 240
- ipwidth: 200
- ipcolor: "black"
- ipAddress: setEth0.netmask
- ipFontSize: 20
- Component.onCompleted: {
- setEth0.doGetInterface();
- }
- onIpAddressChanged: {
- setEth0.netmask = ipNetmask.ipAddress;
- }
- }
- }
|