基本完成网络设置模块,还有一些细节需要完善。

This commit is contained in:
xueyan hu
2021-12-17 18:02:39 +08:00
parent faa69197f3
commit b6475e7ed4
21 changed files with 1979 additions and 421 deletions

550
src/networkcfgdialog.ui Normal file
View File

@@ -0,0 +1,550 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>networkCfgDialog</class>
<widget class="QDialog" name="networkCfgDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>863</width>
<height>678</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="windowTitle">
<string>Network Settings</string>
</property>
<property name="styleSheet">
<string notr="true">QWidget{
background-color:#3c3c3c;
color:#fcfcfc;
margin:0;
font-size:16px;
border:0px;
font-weight:normal;
font-family:Microsoft YaHei
}
QTabWidget::pane {
border-top: 0px;
}
QTabBar::tab {
font-size:16px;
height:30px;
width:100px;
background:#4d4d4d;
border: 0px;
border-top-left-radius: 10%;
border-top-right-radius: 10%;
border-bottom-left-radius:0%;
border-bottom-right-radius:0%;
padding: 2px;
}
QTabBar::tab:selected, QTabBar::tab:hover {
border-bottom:5px solid #4a88c7;
background: #505050;}
QPushButton{
border-radius:5px;
padding-left:10px;
padding-right:10px;
min-height:28px;
max-height:28px;
min-width:60px;
max-width:60px;
background:#4d4d4d;
}
QLineEdit{
color:#bcbcbc;
min-height:26px;
max-height:26px;
border:0px;
background-color: #232629;
border-radius: 2px;
}
QTableView{
background-color: #232629;
border-radius: 5px;
}
QHeaderView::section:horizontal{
border-bottom: 1px solid rgb(0,170,255);
}
QHeaderView::section:vertical{
min-height:20px;
max-height:20px;
}</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Address</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="widget" native="true">
<layout class="QGridLayout" name="gridLayout_2">
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>IP Address</string>
</property>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="5" column="0">
<widget class="QLineEdit" name="addr_ip"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Dynamic Address</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Dev</string>
</property>
</widget>
</item>
<item row="5" column="2">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="ImageSwitch" name="sw_dhcp" native="true">
<property name="minimumSize">
<size>
<width>87</width>
<height>28</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>87</width>
<height>28</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">background-color: #232629;</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="led_inface">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>87</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>87</width>
<height>26</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Subnet Mask</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="addr_mask"/>
</item>
<item row="1" column="0">
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Additional Address</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="topMargin">
<number>30</number>
</property>
<item>
<widget class="SlideableTableView" name="tbl_addr"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_2" native="true">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btn_addr_add">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_addr_edit">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_addr_del">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>321</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Routing</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>10</number>
</property>
<property name="topMargin">
<number>15</number>
</property>
<item>
<widget class="QWidget" name="widget_4" native="true">
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="2">
<widget class="QLineEdit" name="led_gw">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>190</width>
<height>26</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>190</width>
<height>26</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="0" column="3">
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>373</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Default IPv4 Gateway</string>
</property>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Routing Table</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>9</number>
</property>
<property name="topMargin">
<number>30</number>
</property>
<property name="bottomMargin">
<number>9</number>
</property>
<item>
<widget class="SlideableTableView" name="tbl_route">
<property name="gridStyle">
<enum>Qt::DashLine</enum>
</property>
<property name="sortingEnabled">
<bool>false</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QWidget" name="widget_5" native="true">
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QPushButton" name="btn_route_add">
<property name="text">
<string>Add</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_route_edit">
<property name="text">
<string>Edit</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btn_route_del">
<property name="text">
<string>Delete</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>321</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Result</string>
</attribute>
<widget class="QWidget" name="widget_3" native="true">
<property name="geometry">
<rect>
<x>30</x>
<y>20</y>
<width>781</width>
<height>541</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QPlainTextEdit" name="output"/>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="btn_group">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Apply|QDialogButtonBox::Cancel</set>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ImageSwitch</class>
<extends>QWidget</extends>
<header location="global">components/imageswitch.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>SlideableTableView</class>
<extends>QTableView</extends>
<header location="global">components/SlideableTableView.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>btn_group</sender>
<signal>accepted()</signal>
<receiver>networkCfgDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>btn_group</sender>
<signal>rejected()</signal>
<receiver>networkCfgDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>