diff --git a/client/portstatswindow.cpp b/client/portstatswindow.cpp index df9cf3a..5c03bd4 100644 --- a/client/portstatswindow.cpp +++ b/client/portstatswindow.cpp @@ -234,14 +234,18 @@ void PortStatsWindow::on_tbGetStreamStats_clicked() model->portListFromIndex(selectedColumns(), portList); if (portList.size()) { - QDockWidget *dock = new QDockWidget(tr("Stream Statistics"), - mainWindow); + QDockWidget *dock = new QDockWidget(mainWindow); streamStatsModel = new StreamStatsModel(dock); dock->setWidget(new StreamStatsWindow(streamStatsModel, dock)); + dock->setWindowTitle(dock->widget()->windowTitle()); dock->setObjectName("streamStatsDock"); - dock->setFloating(true); dock->setAttribute(Qt::WA_DeleteOnClose); + QDockWidget *statsDock = mainWindow->findChild( + "statsDock"); mainWindow->addDockWidget(Qt::BottomDockWidgetArea, dock); + mainWindow->tabifyDockWidget(statsDock, dock); + dock->show(); + dock->raise(); } // Get stream stats for selected ports, portgroup by portgroup diff --git a/client/streamstatswindow.cpp b/client/streamstatswindow.cpp index 21c2b78..e7e4312 100644 --- a/client/streamstatswindow.cpp +++ b/client/streamstatswindow.cpp @@ -22,14 +22,29 @@ along with this program. If not, see #include #include +static int id; +static int count; + StreamStatsWindow::StreamStatsWindow(QAbstractItemModel *model, QWidget *parent) : QWidget(parent) { setupUi(this); + if (id) + setWindowTitle(windowTitle() + QString("(%1)").arg(id)); + id++; + count++; + streamStats->setModel(model); streamStats->verticalHeader()->setHighlightSections(false); streamStats->verticalHeader()->setDefaultSectionSize( streamStats->verticalHeader()->minimumSectionSize()); } + +StreamStatsWindow::~StreamStatsWindow() +{ + count--; + if (count == 0) + id = 0; +} diff --git a/client/streamstatswindow.h b/client/streamstatswindow.h index c5c894e..f282e0f 100644 --- a/client/streamstatswindow.h +++ b/client/streamstatswindow.h @@ -29,6 +29,7 @@ class StreamStatsWindow: public QWidget, private Ui::StreamStatsWindow Q_OBJECT public: StreamStatsWindow(QAbstractItemModel *model, QWidget *parent = 0); + ~StreamStatsWindow(); }; #endif diff --git a/client/streamstatswindow.ui b/client/streamstatswindow.ui index 7a15ffa..88ac847 100644 --- a/client/streamstatswindow.ui +++ b/client/streamstatswindow.ui @@ -10,7 +10,7 @@ - Form + Stream Statistics