diff --git a/mainwindow.cpp b/mainwindow.cpp
index 08a096e..ab8e7c5 100644
--- a/mainwindow.cpp
+++ b/mainwindow.cpp
@@ -129,6 +129,8 @@ MainWindow::MainWindow(QWidget *parent) :
connect(ui->actionSignal_Viewer, &QAction::triggered, this, &MainWindow::showSignalViewer);
connect(ui->actionSave_Continuous_Logfile, &QAction::triggered, this, &MainWindow::handleContinousLogging);
connect(ui->actionTemporal_Graph, &QAction::triggered, this, &MainWindow::showTemporalGraphWindow);
+ connect(ui->btnExpandAll, &QAbstractButton::clicked, this, &MainWindow::expandAllRows);
+ connect(ui->btnCollapseAll, &QAbstractButton::clicked, this, &MainWindow::collapseAllRows);
connect(CANConManager::getInstance(), &CANConManager::framesReceived, model, &CANFrameModel::addFrames);
@@ -382,6 +384,48 @@ void MainWindow::headerClicked(int logicalIndex)
model->sortByColumn(logicalIndex);
}
+void MainWindow::expandAllRows()
+{
+ bool goAhead = false;
+ int numRows = ui->canFramesView->model()->rowCount();
+
+ if (numRows > 20000)
+ {
+ QMessageBox::StandardButton confirmDialog;
+ confirmDialog = QMessageBox::question(this, "Really?", "It's not recommended to use this\non more than 20000 frames.\nIt can take a long time.\n\nYou have been warned!\nStill do it?",
+ QMessageBox::Yes|QMessageBox::No);
+
+ if (confirmDialog == QMessageBox::Yes) goAhead = true;
+ }
+ else goAhead = true;
+
+ if (goAhead)
+ {
+ ui->canFramesView->resizeRowsToContents();
+ }
+}
+
+void MainWindow::collapseAllRows()
+{
+ bool goAhead = false;
+ int numRows = ui->canFramesView->model()->rowCount();
+
+ if (numRows > 50000)
+ {
+ QMessageBox::StandardButton confirmDialog;
+ confirmDialog = QMessageBox::question(this, "Really?", "It's not recommended to use this\non more than 50000 frames.\nIt can take a long time.\n\nYou have been warned!\nStill do it?",
+ QMessageBox::Yes|QMessageBox::No);
+
+ if (confirmDialog == QMessageBox::Yes) goAhead = true;
+ }
+ else goAhead = true;
+
+ if (goAhead)
+ {
+ for (int i = 0; i < numRows; i++) ui->canFramesView->setRowHeight(i, normalRowHeight);
+ }
+}
+
void MainWindow::gridClicked(QModelIndex idx)
{
//qDebug() << "Grid Clicked";
diff --git a/mainwindow.h b/mainwindow.h
index e780f88..d3a45dd 100644
--- a/mainwindow.h
+++ b/mainwindow.h
@@ -63,6 +63,8 @@ private slots:
void showGraphingWindow();
void showFrameDataAnalysis();
void clearFrames();
+ void expandAllRows();
+ void collapseAllRows();
void showPlaybackWindow();
void showFlowViewWindow();
void showFrameSenderWindow();
diff --git a/ui/mainwindow.ui b/ui/mainwindow.ui
index 1bda8d1..46acf44 100644
--- a/ui/mainwindow.ui
+++ b/ui/mainwindow.ui
@@ -191,6 +191,23 @@
+ -
+
+
+ true
+
+
+ Overwrite Mode
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
-
@@ -199,12 +216,23 @@
-
-
-
- true
-
+
- Overwrite Mode
+ Expand All Rows
+
+
+
+ -
+
+
+ Collapse All Rows
+
+
+
+ -
+
+
+ Qt::Horizontal
@@ -265,7 +293,7 @@
0
0
800
- 22
+ 23