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);
|
||||
|
||||
StreamConfigDialog scd(streams, curPort, this);
|
||||
scd.setWindowTitle(tr("Add Stream(s)"));
|
||||
scd.setWindowTitle(tr("Add Stream"));
|
||||
if (scd.exec() == QDialog::Accepted)
|
||||
streamModel->insert(row, streams);
|
||||
}
|
||||
|
@ -67,6 +67,8 @@ StreamConfigDialog::StreamConfigDialog(
|
||||
setupUi(this);
|
||||
setupUiExtra();
|
||||
|
||||
_windowTitle = windowTitle();
|
||||
|
||||
for (int i = ProtoMin; i < ProtoMax; i++)
|
||||
{
|
||||
bgProto[i]->setProperty("ProtocolLevel", i);
|
||||
@ -333,6 +335,12 @@ StreamConfigDialog::~StreamConfigDialog()
|
||||
delete _streamList.takeFirst();
|
||||
}
|
||||
|
||||
void StreamConfigDialog::setWindowTitle(const QString &title)
|
||||
{
|
||||
_windowTitle = title;
|
||||
QDialog::setWindowTitle(title);
|
||||
}
|
||||
|
||||
void StreamConfigDialog::loadProtocolWidgets()
|
||||
{
|
||||
ProtocolListIterator *iter;
|
||||
@ -950,8 +958,14 @@ void StreamConfigDialog::LoadCurrentStream()
|
||||
qDebug("loading mpStream %p", mpStream);
|
||||
variableFieldsWidget->setStream(mpStream);
|
||||
|
||||
QDialog::setWindowTitle(QString("%1 [%2]").arg(_windowTitle)
|
||||
.arg(mpStream->name().isEmpty() ?
|
||||
tr("<unnamed>") : mpStream->name()));
|
||||
|
||||
// Meta Data
|
||||
{
|
||||
name->setText(mpStream->name());
|
||||
enabled->setChecked(mpStream->isEnabled());
|
||||
cmbPktLenMode->setCurrentIndex(mpStream->lenMode());
|
||||
lePktLen->setText(str.setNum(mpStream->frameLen()));
|
||||
lePktLenMin->setText(str.setNum(mpStream->frameLenMin()));
|
||||
@ -1037,6 +1051,8 @@ void StreamConfigDialog::StoreCurrentStream()
|
||||
qDebug("storing pStream %p", pStream);
|
||||
|
||||
// Meta Data
|
||||
pStream->setName(name->text());
|
||||
pStream->setEnabled(enabled->isChecked());
|
||||
pStream->setLenMode((Stream::FrameLengthMode) cmbPktLenMode->currentIndex());
|
||||
pStream->setFrameLen(lePktLen->text().toULong(&isOk));
|
||||
pStream->setFrameLenMin(lePktLenMin->text().toULong(&isOk));
|
||||
|
@ -47,6 +47,8 @@ public:
|
||||
QWidget *parent = 0);
|
||||
~StreamConfigDialog();
|
||||
|
||||
void setWindowTitle(const QString &title);
|
||||
|
||||
private:
|
||||
|
||||
enum ButtonId
|
||||
@ -76,6 +78,7 @@ private:
|
||||
QList<Stream*> _userStreamList;
|
||||
QList<Stream*> _streamList;
|
||||
const Port& mPort;
|
||||
QString _windowTitle;
|
||||
uint mCurrentStreamIndex;
|
||||
|
||||
Stream *mpStream;
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user