UX: Enhance StreamConfigDialog
* Add stream name/enabled fields to dialog * Change Dialog title to include current stream name
This commit is contained in:
parent
7d4f285d8d
commit
6bd687e2bc
@ -797,7 +797,7 @@ void PortsWindow::on_actionNew_Stream_triggered()
|
|||||||
streams.append(new Stream);
|
streams.append(new Stream);
|
||||||
|
|
||||||
StreamConfigDialog scd(streams, curPort, this);
|
StreamConfigDialog scd(streams, curPort, this);
|
||||||
scd.setWindowTitle(tr("Add Stream(s)"));
|
scd.setWindowTitle(tr("Add Stream"));
|
||||||
if (scd.exec() == QDialog::Accepted)
|
if (scd.exec() == QDialog::Accepted)
|
||||||
streamModel->insert(row, streams);
|
streamModel->insert(row, streams);
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,8 @@ StreamConfigDialog::StreamConfigDialog(
|
|||||||
setupUi(this);
|
setupUi(this);
|
||||||
setupUiExtra();
|
setupUiExtra();
|
||||||
|
|
||||||
|
_windowTitle = windowTitle();
|
||||||
|
|
||||||
for (int i = ProtoMin; i < ProtoMax; i++)
|
for (int i = ProtoMin; i < ProtoMax; i++)
|
||||||
{
|
{
|
||||||
bgProto[i]->setProperty("ProtocolLevel", i);
|
bgProto[i]->setProperty("ProtocolLevel", i);
|
||||||
@ -333,6 +335,12 @@ StreamConfigDialog::~StreamConfigDialog()
|
|||||||
delete _streamList.takeFirst();
|
delete _streamList.takeFirst();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StreamConfigDialog::setWindowTitle(const QString &title)
|
||||||
|
{
|
||||||
|
_windowTitle = title;
|
||||||
|
QDialog::setWindowTitle(title);
|
||||||
|
}
|
||||||
|
|
||||||
void StreamConfigDialog::loadProtocolWidgets()
|
void StreamConfigDialog::loadProtocolWidgets()
|
||||||
{
|
{
|
||||||
ProtocolListIterator *iter;
|
ProtocolListIterator *iter;
|
||||||
@ -950,8 +958,14 @@ void StreamConfigDialog::LoadCurrentStream()
|
|||||||
qDebug("loading mpStream %p", mpStream);
|
qDebug("loading mpStream %p", mpStream);
|
||||||
variableFieldsWidget->setStream(mpStream);
|
variableFieldsWidget->setStream(mpStream);
|
||||||
|
|
||||||
|
QDialog::setWindowTitle(QString("%1 [%2]").arg(_windowTitle)
|
||||||
|
.arg(mpStream->name().isEmpty() ?
|
||||||
|
tr("<unnamed>") : mpStream->name()));
|
||||||
|
|
||||||
// Meta Data
|
// Meta Data
|
||||||
{
|
{
|
||||||
|
name->setText(mpStream->name());
|
||||||
|
enabled->setChecked(mpStream->isEnabled());
|
||||||
cmbPktLenMode->setCurrentIndex(mpStream->lenMode());
|
cmbPktLenMode->setCurrentIndex(mpStream->lenMode());
|
||||||
lePktLen->setText(str.setNum(mpStream->frameLen()));
|
lePktLen->setText(str.setNum(mpStream->frameLen()));
|
||||||
lePktLenMin->setText(str.setNum(mpStream->frameLenMin()));
|
lePktLenMin->setText(str.setNum(mpStream->frameLenMin()));
|
||||||
@ -1037,6 +1051,8 @@ void StreamConfigDialog::StoreCurrentStream()
|
|||||||
qDebug("storing pStream %p", pStream);
|
qDebug("storing pStream %p", pStream);
|
||||||
|
|
||||||
// Meta Data
|
// Meta Data
|
||||||
|
pStream->setName(name->text());
|
||||||
|
pStream->setEnabled(enabled->isChecked());
|
||||||
pStream->setLenMode((Stream::FrameLengthMode) cmbPktLenMode->currentIndex());
|
pStream->setLenMode((Stream::FrameLengthMode) cmbPktLenMode->currentIndex());
|
||||||
pStream->setFrameLen(lePktLen->text().toULong(&isOk));
|
pStream->setFrameLen(lePktLen->text().toULong(&isOk));
|
||||||
pStream->setFrameLenMin(lePktLenMin->text().toULong(&isOk));
|
pStream->setFrameLenMin(lePktLenMin->text().toULong(&isOk));
|
||||||
|
@ -47,6 +47,8 @@ public:
|
|||||||
QWidget *parent = 0);
|
QWidget *parent = 0);
|
||||||
~StreamConfigDialog();
|
~StreamConfigDialog();
|
||||||
|
|
||||||
|
void setWindowTitle(const QString &title);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
enum ButtonId
|
enum ButtonId
|
||||||
@ -76,6 +78,7 @@ private:
|
|||||||
QList<Stream*> _userStreamList;
|
QList<Stream*> _userStreamList;
|
||||||
QList<Stream*> _streamList;
|
QList<Stream*> _streamList;
|
||||||
const Port& mPort;
|
const Port& mPort;
|
||||||
|
QString _windowTitle;
|
||||||
uint mCurrentStreamIndex;
|
uint mCurrentStreamIndex;
|
||||||
|
|
||||||
Stream *mpStream;
|
Stream *mpStream;
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>StreamConfigDialog</class>
|
<class>StreamConfigDialog</class>
|
||||||
<widget class="QDialog" name="StreamConfigDialog">
|
<widget class="QDialog" name="StreamConfigDialog">
|
||||||
@ -13,7 +14,7 @@
|
|||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy vsizetype="Preferred" hsizetype="Preferred" >
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@ -22,14 +23,15 @@
|
|||||||
<string>Edit Stream</string>
|
<string>Edit Stream</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowIcon">
|
<property name="windowIcon">
|
||||||
<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="styleSheet">
|
<property name="styleSheet">
|
||||||
<string>QLineEdit:enabled[inputMask = "HH; "],
|
<string>QLineEdit:enabled[inputMask = "HH; "],
|
||||||
QLineEdit:enabled[inputMask = "HH HH; "],
|
QLineEdit:enabled[inputMask = "HH HH; "],
|
||||||
QLineEdit:enabled[inputMask = "HH HH HH; "],
|
QLineEdit:enabled[inputMask = "HH HH HH; "],
|
||||||
QLineEdit:enabled[inputMask = "HH HH HH HH; "], 
|
QLineEdit:enabled[inputMask = "HH HH HH HH; "],
|
||||||
QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff } 
|
QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff }
|
||||||
</string>
|
</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="modal">
|
<property name="modal">
|
||||||
@ -49,20 +51,36 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<string>Protocol Selection</string>
|
<string>Protocol Selection</string>
|
||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QGridLayout">
|
<layout class="QGridLayout">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Basics</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<spacer>
|
<widget class="QLabel" name="label_3">
|
||||||
<property name="orientation" >
|
<property name="text">
|
||||||
<enum>Qt::Horizontal</enum>
|
<string>Name</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="buddy">
|
||||||
<size>
|
<cstring>name</cstring>
|
||||||
<width>241</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="name"/>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QCheckBox" name="enabled">
|
||||||
|
<property name="text">
|
||||||
|
<string>Enabled</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
<widget class="QGroupBox" name="gbFrameLength">
|
<widget class="QGroupBox" name="gbFrameLength">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Frame Length (including FCS)</string>
|
<string>Frame Length (including FCS)</string>
|
||||||
@ -136,7 +154,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0" colspan="2" >
|
<item row="1" column="0" colspan="3">
|
||||||
<widget class="QToolBox" name="tbSelectProtocols">
|
<widget class="QToolBox" name="tbSelectProtocols">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
@ -193,7 +211,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="1" >
|
<item row="0" column="1" rowspan="2">
|
||||||
<widget class="QGroupBox" name="gbFrameType">
|
<widget class="QGroupBox" name="gbFrameType">
|
||||||
<property name="enabled">
|
<property name="enabled">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
@ -637,7 +655,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
@ -651,10 +669,11 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>></string>
|
<string>></string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="ostinato.qrc" >:/icons/arrow_right.png</iconset>
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/arrow_right.png</normaloff>:/icons/arrow_right.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -663,7 +682,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>20</width>
|
<width>20</width>
|
||||||
<height>40</height>
|
<height>40</height>
|
||||||
@ -693,7 +712,8 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<string>^</string>
|
<string>^</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="ostinato.qrc" >:/icons/arrow_up.png</iconset>
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/arrow_up.png</normaloff>:/icons/arrow_up.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -706,7 +726,8 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<string>v</string>
|
<string>v</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="ostinato.qrc" >:/icons/arrow_down.png</iconset>
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/arrow_down.png</normaloff>:/icons/arrow_down.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -719,7 +740,8 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<string>-</string>
|
<string>-</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="icon">
|
<property name="icon">
|
||||||
<iconset resource="ostinato.qrc" >:/icons/delete.png</iconset>
|
<iconset resource="ostinato.qrc">
|
||||||
|
<normaloff>:/icons/delete.png</normaloff>:/icons/delete.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -728,7 +750,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<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>
|
||||||
@ -773,7 +795,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QHBoxLayout">
|
<layout class="QHBoxLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="VariableFieldsWidget" native="1" name="variableFieldsWidget" />
|
<widget class="VariableFieldsWidget" name="variableFieldsWidget" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
@ -808,7 +830,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="1" >
|
<item row="0" column="1" rowspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_13">
|
<widget class="QGroupBox" name="groupBox_13">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Numbers</string>
|
<string>Numbers</string>
|
||||||
@ -880,7 +902,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="2" >
|
<item row="0" column="2" rowspan="2">
|
||||||
<widget class="QGroupBox" name="groupBox_14">
|
<widget class="QGroupBox" name="groupBox_14">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Rate</string>
|
<string>Rate</string>
|
||||||
@ -949,7 +971,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="3" >
|
<item row="0" column="3" rowspan="2">
|
||||||
<widget class="QGroupBox" name="nextWhat">
|
<widget class="QGroupBox" name="nextWhat">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>After this stream</string>
|
<string>After this stream</string>
|
||||||
@ -992,12 +1014,12 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item rowspan="2" row="0" column="4" >
|
<item row="0" column="4" rowspan="2">
|
||||||
<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>20</width>
|
<width>20</width>
|
||||||
<height>41</height>
|
<height>41</height>
|
||||||
@ -1124,7 +1146,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeHint" >
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>153</width>
|
<width>153</width>
|
||||||
<height>21</height>
|
<height>21</height>
|
||||||
@ -1155,7 +1177,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="DumpView" native="1" name="vwPacketDump" />
|
<widget class="DumpView" name="vwPacketDump" native="true"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
@ -1183,7 +1205,7 @@ QLineEdit:enabled[inputMask = "HH HH HH HH HH HH; "] { background-color: #ccccff
|
|||||||
<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>191</width>
|
<width>191</width>
|
||||||
<height>20</height>
|
<height>20</height>
|
||||||
|
Loading…
Reference in New Issue
Block a user