(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,3 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>PortsWindow</class> <class>PortsWindow</class>
<widget class="QWidget" name="PortsWindow"> <widget class="QWidget" name="PortsWindow">
@ -23,7 +24,7 @@
</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>
@ -37,26 +38,90 @@
</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="blankPage">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<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 name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
<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"> <widget class="QWidget" name="portDetail">
<layout class="QVBoxLayout"> <layout class="QVBoxLayout">
<property name="leftMargin" > <property name="margin">
<number>0</number>
</property>
<property name="topMargin" >
<number>0</number>
</property>
<property name="rightMargin" >
<number>0</number>
</property>
<property name="bottomMargin" >
<number>0</number> <number>0</number>
</property> </property>
<item> <item>
@ -68,16 +133,7 @@
<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>
@ -85,7 +141,7 @@
<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>
@ -93,6 +149,13 @@
</property> </property>
</spacer> </spacer>
</item> </item>
<item>
<widget class="QLabel" name="label_3">
<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> <item>
<widget class="QPushButton" name="pbApply"> <widget class="QPushButton" name="pbApply">
<property name="text"> <property name="text">
@ -147,7 +210,7 @@
<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>
@ -160,7 +223,7 @@
<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>
@ -190,7 +253,7 @@
</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,28 +261,14 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="portGroupDetail" >
<layout class="QHBoxLayout" >
<item>
<widget class="QLabel" name="label_5" >
<property name="text" >
<string>Select a port to configure streams</string>
</property>
<property name="alignment" >
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="blankPage" />
</widget> </widget>
</widget> </widget>
</item> </item>
</layout> </layout>
<action name="actionNew_Port_Group"> <action name="actionNew_Port_Group">
<property name="icon"> <property name="icon">
<iconset resource="ostinato.qrc" >:/icons/portgroup_add.png</iconset> <iconset resource="ostinato.qrc">
<normaloff>:/icons/portgroup_add.png</normaloff>:/icons/portgroup_add.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>New Port Group</string> <string>New Port Group</string>
@ -227,7 +276,8 @@
</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>
@ -235,7 +285,8 @@
</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>
@ -243,7 +294,8 @@
</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>
@ -251,7 +303,8 @@
</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>
@ -259,7 +312,8 @@
</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>
@ -267,7 +321,8 @@
</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>
@ -298,7 +353,8 @@
</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>