|
26 | 26 | */
|
27 | 27 |
|
28 | 28 | #include "mainwindow.h"
|
| 29 | +#include "diffdialog.h" |
29 | 30 | #include "recordpage.h"
|
30 | 31 | #include "resultspage.h"
|
31 | 32 | #include "settings.h"
|
| 33 | +#include "settingsdialog.h" |
32 | 34 | #include "startpage.h"
|
33 | 35 | #include "ui_mainwindow.h"
|
34 |
| -#include "settingsdialog.h" |
35 | 36 | #include "ui_settingsdialog.h"
|
36 | 37 |
|
37 | 38 | #include <QApplication>
|
@@ -115,6 +116,7 @@ MainWindow::MainWindow(QWidget* parent)
|
115 | 116 | , m_recordPage(new RecordPage(this))
|
116 | 117 | , m_resultsPage(new ResultsPage(m_parser, this))
|
117 | 118 | , m_settingsDialog(new SettingsDialog(this))
|
| 119 | + , m_diffDialog(new DiffDialog(this)) |
118 | 120 | {
|
119 | 121 | ui->setupUi(this);
|
120 | 122 |
|
@@ -148,21 +150,13 @@ MainWindow::MainWindow(QWidget* parent)
|
148 | 150 | connect(m_startPage, &StartPage::recordButtonClicked, this, &MainWindow::onRecordButtonClicked);
|
149 | 151 | connect(m_startPage, &StartPage::stopParseButtonClicked, this,
|
150 | 152 | static_cast<void (MainWindow::*)()>(&MainWindow::clear));
|
151 |
| - connect(m_startPage, &StartPage::diffButtonClicked, this, [this] { |
152 |
| - const auto fileNameA = QFileDialog::getOpenFileName(this, tr("Open File A"), QDir::currentPath(), |
153 |
| - tr("Data Files (perf*.data perf.data.*);;All Files (*)")); |
154 |
| - if (fileNameA.isEmpty()) { |
155 |
| - return; |
156 |
| - } |
157 | 153 |
|
158 |
| - const auto fileNameB = QFileDialog::getOpenFileName(this, tr("Open File B"), QDir::currentPath(), |
159 |
| - tr("Data Files (perf*.data perf.data.*);;All Files (*)")); |
160 |
| - if (fileNameB.isEmpty()) { |
161 |
| - return; |
162 |
| - } |
163 |
| - |
164 |
| - openFile(fileNameA, false, fileNameB); |
| 154 | + connect(m_startPage, &StartPage::diffButtonClicked, this, [this] { m_diffDialog->open(); }); |
| 155 | + connect(m_diffDialog, &QDialog::accepted, this, [this] { |
| 156 | + m_diffDialog->close(); |
| 157 | + openFile(m_diffDialog->fileA(), false, m_diffDialog->fileB()); |
165 | 158 | });
|
| 159 | + |
166 | 160 | connect(m_parser, &PerfParser::progress, m_startPage, &StartPage::onParseFileProgress);
|
167 | 161 | connect(this, &MainWindow::openFileError, m_startPage, &StartPage::onOpenFileError);
|
168 | 162 | connect(m_recordPage, &RecordPage::homeButtonClicked, this, &MainWindow::onHomeButtonClicked);
|
|
0 commit comments