(UX) Add textual hints for to the ports window

Improves first run experience
This commit is contained in:
Srivats P 2017-09-07 20:45:43 +05:30
parent cb52f9ade1
commit 40c5e00ec2
2 changed files with 197 additions and 141 deletions

View File

@ -349,8 +349,8 @@ void PortsWindow::when_portView_currentChanged(const QModelIndex& currentIndex,
if (!current.isValid()) if (!current.isValid())
{ {
qDebug("setting stacked widget to blank page"); qDebug("setting stacked widget to welcome page");
swDetail->setCurrentIndex(2); // blank page swDetail->setCurrentIndex(0); // welcome page
} }
else else
{ {
@ -360,7 +360,7 @@ void PortsWindow::when_portView_currentChanged(const QModelIndex& currentIndex,
} }
else if (plm->isPort(current)) else if (plm->isPort(current))
{ {
swDetail->setCurrentIndex(0); // port detail page swDetail->setCurrentIndex(2); // port detail page
updatePortRates(); updatePortRates();
connect(&(plm->port(current)), SIGNAL(portRateChanged(int, int)), connect(&(plm->port(current)), SIGNAL(portRateChanged(int, int)),
SLOT(updatePortRates())); SLOT(updatePortRates()));

View File

@ -1,7 +1,8 @@
<ui version="4.0" > <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PortsWindow</class> <class>PortsWindow</class>
<widget class="QWidget" name="PortsWindow" > <widget class="QWidget" name="PortsWindow">
<property name="geometry" > <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
@ -9,83 +10,138 @@
<height>352</height> <height>352</height>
</rect> </rect>
</property> </property>
<property name="windowTitle" > <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QGridLayout" > <layout class="QGridLayout">
<item row="0" column="0" > <item row="0" column="0">
<widget class="QSplitter" name="splitter" > <widget class="QSplitter" name="splitter">
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="childrenCollapsible" > <property name="childrenCollapsible">
<bool>false</bool> <bool>false</bool>
</property> </property>
<widget class="QTreeView" name="tvPortList" > <widget class="QTreeView" name="tvPortList">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch> <horstretch>1</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="contextMenuPolicy" > <property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="selectionMode" > <property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum> <enum>QAbstractItemView::SingleSelection</enum>
</property> </property>
</widget> </widget>
<widget class="QStackedWidget" name="swDetail" > <widget class="QStackedWidget" name="swDetail">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" > <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>2</horstretch> <horstretch>2</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="currentIndex" > <property name="currentIndex">
<number>0</number> <number>2</number>
</property> </property>
<widget class="QWidget" name="portDetail" > <widget class="QWidget" name="blankPage">
<layout class="QVBoxLayout" > <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin" > <item>
<number>0</number> <widget class="QLabel" name="label">
<property name="text">
<string>&lt;p&gt;&lt;b&gt;How to use Ostinato&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;The port list on the left contains all the ports on which you can transmit packets.&lt;/p&gt;
&lt;p&gt;Ports belong to a port group. Make sure the Port Group has a &lt;img src=&quot;:/icons/bullet_green.png&quot;/&gt; next to it, then double click the port group to show or hide the ports in the port group.&lt;/p&gt;
&lt;p&gt;To generate packets, you need to create and configure packet streams. A stream is a sequence of one or more same or similar packets.&lt;/p&gt;
&lt;p&gt;To create a stream, select the port on which you want to send packets.&lt;/p&gt;
&lt;hr/&gt;
&lt;p&gt;Don't see the port that you want (or any ports at all) inside the port group? &lt;a href=&quot;http://ostinato.org/docs/faq&quot;&gt;Get Help!&lt;/a&gt;&lt;/p&gt;</string>
</property> </property>
<property name="topMargin" > <property name="alignment">
<number>0</number> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property> </property>
<property name="rightMargin" > <property name="wordWrap">
<number>0</number> <bool>true</bool>
</property> </property>
<property name="bottomMargin" > <property name="openExternalLinks">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<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>
</layout>
</widget>
<widget class="QWidget" name="portGroupDetail">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>&lt;p&gt;You have selected a port group in the port list on the left.&lt;/p&gt;
&lt;p&gt;You can transmit packets on any of the ports within the port group.&lt;/p&gt;
&lt;p&gt;Make sure the port group has a &lt;img src=&quot;:/icons/bullet_green.png&quot;/&gt; next to it and then double click the port group to show or hide the ports in the port group.&lt;/p&gt;
&lt;p&gt;To generate packets, you need to create and configure packet streams. A stream is a sequence of one or more same or similar packets.&lt;/p&gt;
&lt;p&gt;To create a stream, select the port on which you want to send packets. &lt;/p&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>177</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<widget class="QWidget" name="portDetail">
<layout class="QVBoxLayout">
<property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
<widget class="QFrame" name="frame" > <widget class="QFrame" name="frame">
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::Panel</enum> <enum>QFrame::Panel</enum>
</property> </property>
<property name="frameShadow" > <property name="frameShadow">
<enum>QFrame::Raised</enum> <enum>QFrame::Raised</enum>
</property> </property>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<property name="leftMargin" > <property name="margin">
<number>3</number>
</property>
<property name="topMargin" >
<number>3</number>
</property>
<property name="rightMargin" >
<number>3</number>
</property>
<property name="bottomMargin" >
<number>3</number> <number>3</number>
</property> </property>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -94,8 +150,15 @@
</spacer> </spacer>
</item> </item>
<item> <item>
<widget class="QPushButton" name="pbApply" > <widget class="QLabel" name="label_3">
<property name="text" > <property name="text">
<string>Right click in the blank area below to configure streams. Click Apply on the right to activate the changes</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pbApply">
<property name="text">
<string>Apply</string> <string>Apply</string>
</property> </property>
</widget> </widget>
@ -104,50 +167,50 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QTabWidget" name="portConfig" > <widget class="QTabWidget" name="portConfig">
<property name="currentIndex" > <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="streamsTab" > <widget class="QWidget" name="streamsTab">
<attribute name="title" > <attribute name="title">
<string>Streams</string> <string>Streams</string>
</attribute> </attribute>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<layout class="QHBoxLayout" > <layout class="QHBoxLayout">
<item> <item>
<widget class="QRadioButton" name="radioButton" > <widget class="QRadioButton" name="radioButton">
<property name="text" > <property name="text">
<string>Avg pps</string> <string>Avg pps</string>
</property> </property>
<property name="checked" > <property name="checked">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="averagePacketsPerSec" /> <widget class="QLineEdit" name="averagePacketsPerSec"/>
</item> </item>
<item> <item>
<widget class="QRadioButton" name="radioButton_2" > <widget class="QRadioButton" name="radioButton_2">
<property name="text" > <property name="text">
<string>Avg bps</string> <string>Avg bps</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QLineEdit" name="averageBitsPerSec" > <widget class="QLineEdit" name="averageBitsPerSec">
<property name="enabled" > <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item>
<spacer> <spacer>
<property name="orientation" > <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
</property> </property>
<property name="sizeHint" > <property name="sizeHint" stdset="0">
<size> <size>
<width>40</width> <width>40</width>
<height>20</height> <height>20</height>
@ -158,39 +221,39 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QTableView" name="tvStreamList" > <widget class="QTableView" name="tvStreamList">
<property name="sizePolicy" > <property name="sizePolicy">
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" > <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>1</verstretch> <verstretch>1</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="contextMenuPolicy" > <property name="contextMenuPolicy">
<enum>Qt::ActionsContextMenu</enum> <enum>Qt::ActionsContextMenu</enum>
</property> </property>
<property name="frameShape" > <property name="frameShape">
<enum>QFrame::StyledPanel</enum> <enum>QFrame::StyledPanel</enum>
</property> </property>
<property name="lineWidth" > <property name="lineWidth">
<number>1</number> <number>1</number>
</property> </property>
<property name="selectionMode" > <property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum> <enum>QAbstractItemView::ExtendedSelection</enum>
</property> </property>
<property name="selectionBehavior" > <property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum> <enum>QAbstractItemView::SelectRows</enum>
</property> </property>
</widget> </widget>
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="devicesTab" > <widget class="QWidget" name="devicesTab">
<attribute name="title" > <attribute name="title">
<string>Devices</string> <string>Devices</string>
</attribute> </attribute>
<layout class="QVBoxLayout" > <layout class="QVBoxLayout">
<item> <item>
<widget class="DevicesWidget" native="1" name="devicesWidget" /> <widget class="DevicesWidget" name="devicesWidget" native="true"/>
</item> </item>
</layout> </layout>
</widget> </widget>
@ -198,109 +261,102 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="portGroupDetail" > </widget>
<layout class="QHBoxLayout" > </widget>
<item> </item>
<widget class="QLabel" name="label_5" > </layout>
<property name="text" > <action name="actionNew_Port_Group">
<string>Select a port to configure streams</string> <property name="icon">
<iconset resource="ostinato.qrc">
<normaloff>:/icons/portgroup_add.png</normaloff>:/icons/portgroup_add.png</iconset>
</property> </property>
<property name="alignment" > <property name="text">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="blankPage" />
</widget>
</widget>
</item>
</layout>
<action name="actionNew_Port_Group" >
<property name="icon" >
<iconset resource="ostinato.qrc" >:/icons/portgroup_add.png</iconset>
</property>
<property name="text" >
<string>New Port Group</string> <string>New Port Group</string>
</property> </property>
</action> </action>
<action name="actionDelete_Port_Group" > <action name="actionDelete_Port_Group">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/portgroup_delete.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/portgroup_delete.png</normaloff>:/icons/portgroup_delete.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Delete Port Group</string> <string>Delete Port Group</string>
</property> </property>
</action> </action>
<action name="actionConnect_Port_Group" > <action name="actionConnect_Port_Group">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/portgroup_connect.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/portgroup_connect.png</normaloff>:/icons/portgroup_connect.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Connect Port Group</string> <string>Connect Port Group</string>
</property> </property>
</action> </action>
<action name="actionDisconnect_Port_Group" > <action name="actionDisconnect_Port_Group">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/portgroup_disconnect.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/portgroup_disconnect.png</normaloff>:/icons/portgroup_disconnect.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Disconnect Port Group</string> <string>Disconnect Port Group</string>
</property> </property>
</action> </action>
<action name="actionNew_Stream" > <action name="actionNew_Stream">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/stream_add.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/stream_add.png</normaloff>:/icons/stream_add.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>New Stream</string> <string>New Stream</string>
</property> </property>
</action> </action>
<action name="actionDelete_Stream" > <action name="actionDelete_Stream">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/stream_delete.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/stream_delete.png</normaloff>:/icons/stream_delete.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Delete Stream</string> <string>Delete Stream</string>
</property> </property>
</action> </action>
<action name="actionEdit_Stream" > <action name="actionEdit_Stream">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/stream_edit.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/stream_edit.png</normaloff>:/icons/stream_edit.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Edit Stream</string> <string>Edit Stream</string>
</property> </property>
</action> </action>
<action name="actionExclusive_Control" > <action name="actionExclusive_Control">
<property name="checkable" > <property name="checkable">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text" > <property name="text">
<string>Exclusive Port Control (EXPERIMENTAL)</string> <string>Exclusive Port Control (EXPERIMENTAL)</string>
</property> </property>
</action> </action>
<action name="actionOpen_Streams" > <action name="actionOpen_Streams">
<property name="text" > <property name="text">
<string>Open Streams ...</string> <string>Open Streams ...</string>
</property> </property>
</action> </action>
<action name="actionSave_Streams" > <action name="actionSave_Streams">
<property name="text" > <property name="text">
<string>Save Streams ...</string> <string>Save Streams ...</string>
</property> </property>
</action> </action>
<action name="actionPort_Configuration" > <action name="actionPort_Configuration">
<property name="text" > <property name="text">
<string>Port Configuration ...</string> <string>Port Configuration ...</string>
</property> </property>
</action> </action>
<action name="actionDuplicate_Stream" > <action name="actionDuplicate_Stream">
<property name="icon" > <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/stream_duplicate.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/stream_duplicate.png</normaloff>:/icons/stream_duplicate.png</iconset>
</property> </property>
<property name="text" > <property name="text">
<string>Duplicate Stream</string> <string>Duplicate Stream</string>
</property> </property>
</action> </action>
@ -314,7 +370,7 @@
</customwidget> </customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="ostinato.qrc" /> <include location="ostinato.qrc"/>
</resources> </resources>
<connections> <connections>
<connection> <connection>
@ -323,11 +379,11 @@
<receiver>averagePacketsPerSec</receiver> <receiver>averagePacketsPerSec</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>326</x> <x>326</x>
<y>80</y> <y>80</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>454</x> <x>454</x>
<y>79</y> <y>79</y>
</hint> </hint>
@ -339,11 +395,11 @@
<receiver>averageBitsPerSec</receiver> <receiver>averageBitsPerSec</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
<hints> <hints>
<hint type="sourcelabel" > <hint type="sourcelabel">
<x>523</x> <x>523</x>
<y>80</y> <y>80</y>
</hint> </hint>
<hint type="destinationlabel" > <hint type="destinationlabel">
<x>651</x> <x>651</x>
<y>88</y> <y>88</y>
</hint> </hint>