From 82bcc756f0890888fc470e0f75e50d234a5b4af5 Mon Sep 17 00:00:00 2001 From: "Srivats P." Date: Wed, 4 Aug 2010 21:47:11 +0530 Subject: [PATCH] added prefix inputMask (not working); added some code for sourceList (not complete) --- common/gmp.cpp | 18 ++++++ common/gmp.h | 2 + common/gmp.ui | 166 ++++++++++++++++++++++++++++++------------------- 3 files changed, 122 insertions(+), 64 deletions(-) diff --git a/common/gmp.cpp b/common/gmp.cpp index 134b333..63f1288 100755 --- a/common/gmp.cpp +++ b/common/gmp.cpp @@ -36,6 +36,24 @@ GmpConfigForm::GmpConfigForm(QWidget *parent) msgTypeCombo->addItem(kIgmpV3Report, "IGMPv3 Report"); } +void GmpConfigForm::on_addSource_clicked() +{ + QListWidgetItem *item=new QListWidgetItem("0.0.0.0"); + item->setFlags(item->flags() | Qt::ItemIsEditable); + sourceList->insertItem(sourceList->currentRow(), item); + + if (!overrideSourceCount->isChecked()) + sourceCount->setText(QString().setNum(sourceList->count())); +} + +void GmpConfigForm::on_deleteSource_clicked() +{ + delete sourceList->takeItem(sourceList->currentRow()); + + if (!overrideSourceCount->isChecked()) + sourceCount->setText(QString().setNum(sourceList->count())); +} + void GmpConfigForm::on_msgTypeCombo_currentIndexChanged(int /*index*/) { switch(msgTypeCombo->currentValue()) diff --git a/common/gmp.h b/common/gmp.h index cc9cdf8..2cbbd67 100755 --- a/common/gmp.h +++ b/common/gmp.h @@ -62,6 +62,8 @@ public: GmpConfigForm(QWidget *parent = 0); private slots: void on_msgTypeCombo_currentIndexChanged(int index); + void on_addSource_clicked(); + void on_deleteSource_clicked(); }; class GmpProtocol : public AbstractProtocol diff --git a/common/gmp.ui b/common/gmp.ui index 9be18af..73b4300 100755 --- a/common/gmp.ui +++ b/common/gmp.ui @@ -6,7 +6,7 @@ 0 0 586 - 321 + 281 @@ -171,6 +171,9 @@ 0 + + /900; + @@ -179,7 +182,7 @@ - 1 + 0 @@ -200,13 +203,13 @@ - - + + - + - S Flag + S Flag (Suppress Router Processing) @@ -221,6 +224,9 @@ + + + Qt::Horizontal @@ -233,9 +239,6 @@ - - - @@ -246,73 +249,109 @@ - + - - - - - - - - Source List - - - groupRecordAddress - - - - + - Qt::Horizontal + Qt::Vertical - 40 - 20 + 61 + 41 - - - - Count - - - - - - - false - - - - 0 - 0 - - - - - - - - - - - Qt::Vertical - - - - 61 - 81 - - - + + + + + + + + Source List + + + groupRecordAddress + + + + + + + Qt::Horizontal + + + + 16 + 20 + + + + + + + + A + + + + + + + D + + + + + + + + + true + + + QAbstractItemView::InternalMove + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Count + + + + + + + false + + + + + + @@ -587,7 +626,6 @@ qqi overrideSourceCount sourceCount - sourceList