Device Emulation (contd.): UI changes so that the 'Apply' button is seen to be common for both streams and devices; provisional UI for device information

This commit is contained in:
Srivats P 2016-03-04 18:41:36 +05:30
parent f38567d33f
commit 73485fb3bc
3 changed files with 139 additions and 86 deletions

View File

@ -45,6 +45,7 @@ PortsWindow::PortsWindow(PortGroupList *pgl, QWidget *parent)
plm = pgl; plm = pgl;
setupUi(this); setupUi(this);
refresh->setVisible(deviceInfo->isChecked());
tvPortList->header()->hide(); tvPortList->header()->hide();
@ -890,6 +891,14 @@ _exit:
// //
// DeviceGroup slots // DeviceGroup slots
// //
void PortsWindow::on_deviceInfo_toggled(bool checked)
{
refresh->setVisible(checked);
// TODO: toggle between deviceGroup config and deviceInfo
}
void PortsWindow::on_actionNewDeviceGroup_triggered() void PortsWindow::on_actionNewDeviceGroup_triggered()
{ {
// In case nothing is selected, insert 1 row at the top // In case nothing is selected, insert 1 row at the top

View File

@ -82,6 +82,7 @@ private slots:
void streamModelDataChanged(); void streamModelDataChanged();
void on_deviceInfo_toggled(bool checked);
void on_actionNewDeviceGroup_triggered(); void on_actionNewDeviceGroup_triggered();
void on_actionDeleteDeviceGroup_triggered(); void on_actionDeleteDeviceGroup_triggered();
void on_actionEditDeviceGroup_triggered(); void on_actionEditDeviceGroup_triggered();

View File

@ -34,7 +34,7 @@
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="portDetail" > <widget class="QWidget" name="portDetail" >
<layout class="QGridLayout" > <layout class="QVBoxLayout" >
<property name="leftMargin" > <property name="leftMargin" >
<number>0</number> <number>0</number>
</property> </property>
@ -47,7 +47,51 @@
<property name="bottomMargin" > <property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item row="1" column="0" > <item>
<widget class="QFrame" name="frame" >
<property name="frameShape" >
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow" >
<enum>QFrame::Raised</enum>
</property>
<layout class="QHBoxLayout" >
<property name="leftMargin" >
<number>3</number>
</property>
<property name="topMargin" >
<number>3</number>
</property>
<property name="rightMargin" >
<number>3</number>
</property>
<property name="bottomMargin" >
<number>3</number>
</property>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pbApply" >
<property name="text" >
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QTabWidget" name="portConfig" > <widget class="QTabWidget" name="portConfig" >
<property name="currentIndex" > <property name="currentIndex" >
<number>0</number> <number>0</number>
@ -60,86 +104,44 @@
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout" >
<item> <item>
<widget class="QFrame" name="frAggregate" > <widget class="QRadioButton" name="radioButton" >
<property name="sizePolicy" > <property name="text" >
<sizepolicy vsizetype="Fixed" hsizetype="Preferred" > <string>Avg pps</string>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property> </property>
<property name="frameShape" > <property name="checked" >
<enum>QFrame::StyledPanel</enum> <bool>true</bool>
</property> </property>
<property name="frameShadow" >
<enum>QFrame::Sunken</enum>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QRadioButton" name="radioButton" >
<property name="text" >
<string>Avg pps</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="1" >
<widget class="QLineEdit" name="averagePacketsPerSec" />
</item>
<item row="1" column="0" >
<widget class="QRadioButton" name="radioButton_2" >
<property name="text" >
<string>Avg bps</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<widget class="QLineEdit" name="averageBitsPerSec" >
<property name="enabled" >
<bool>false</bool>
</property>
</widget>
</item>
<item row="0" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QVBoxLayout" > <widget class="QLineEdit" name="averagePacketsPerSec" />
<item> </item>
<widget class="QPushButton" name="pbApply" > <item>
<property name="text" > <widget class="QRadioButton" name="radioButton_2" >
<string>Apply</string> <property name="text" >
</property> <string>Avg bps</string>
</widget> </property>
</item> </widget>
<item> </item>
<spacer> <item>
<property name="orientation" > <widget class="QLineEdit" name="averageBitsPerSec" >
<enum>Qt::Vertical</enum> <property name="enabled" >
</property> <bool>false</bool>
<property name="sizeHint" > </property>
<size> </widget>
<width>20</width> </item>
<height>0</height> <item>
</size> <spacer>
</property> <property name="orientation" >
</spacer> <enum>Qt::Horizontal</enum>
</item> </property>
</layout> <property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item> </item>
</layout> </layout>
</item> </item>
@ -174,7 +176,48 @@
<attribute name="title" > <attribute name="title" >
<string>Devices</string> <string>Devices</string>
</attribute> </attribute>
<layout class="QHBoxLayout" > <layout class="QVBoxLayout" >
<item>
<layout class="QHBoxLayout" >
<item>
<widget class="QRadioButton" name="deviceConfig" >
<property name="text" >
<string>Configuration</string>
</property>
<property name="checked" >
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="deviceInfo" >
<property name="text" >
<string>Information</string>
</property>
</widget>
</item>
<item>
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>131</width>
<height>23</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="refresh" >
<property name="text" >
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</item>
<item> <item>
<widget class="QTableView" name="deviceGroupList" > <widget class="QTableView" name="deviceGroupList" >
<property name="sizePolicy" > <property name="sizePolicy" >
@ -339,12 +382,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel" >
<x>313</x> <x>326</x>
<y>28</y> <y>80</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel" >
<x>380</x> <x>454</x>
<y>28</y> <y>79</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>
@ -355,12 +398,12 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel" >
<x>333</x> <x>523</x>
<y>55</y> <y>80</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel" >
<x>395</x> <x>651</x>
<y>56</y> <y>88</y>
</hint> </hint>
</hints> </hints>
</connection> </connection>