Skip to content

Commit 2c4c7bb

Browse files
committed
Update DspxInspectorDialog
1 parent 7365301 commit 2c4c7bb

File tree

5 files changed

+24
-918
lines changed

5 files changed

+24
-918
lines changed

src/plugins/coreplugin/project/DspxInspectorDialog.cpp

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@
1313
#include <QStandardItemModel>
1414
#include <QTabWidget>
1515

16+
#include <CoreApi/runtimeinterface.h>
17+
1618
#include <opendspx/model.h>
1719
#include <opendspxserializer/serializer.h>
1820

1921
#include <SVSCraftCore/Semver.h>
22+
#include <SVSCraftQuick/MessageBox.h>
2023

2124
#include <coreplugin/CoreInterface.h>
2225
#include <coreplugin/DspxCheckerRegistry.h>
@@ -47,24 +50,22 @@ namespace Core {
4750
auto browseLayout = new QHBoxLayout;
4851
layout->addLayout(browseLayout);
4952
auto pathEdit = new QLineEdit;
53+
pathEdit->setAccessibleName(tr("File path"));
5054
browseLayout->addWidget(pathEdit);
51-
auto browseButton = new QPushButton(tr("Browse"));
55+
auto browseButton = new QPushButton(tr("&Browse"));
56+
browseButton->setDefault(true);
5257
browseLayout->addWidget(browseButton);
53-
auto runCheckButton = new QPushButton(tr("Run Check"));
58+
auto runCheckButton = new QPushButton(tr("&Run Check"));
5459
runCheckButton->setEnabled(false);
5560
layout->addWidget(runCheckButton);
5661
auto tabWidget = new QTabWidget;
5762
layout->addWidget(tabWidget);
58-
auto fileStructureTreeView = new QTreeView;
59-
fileStructureTreeView->setHeaderHidden(true);
60-
tabWidget->addTab(fileStructureTreeView, tr("File Structure"));
6163
auto problemTreeView = new QTreeView;
6264
problemTreeView->setHeaderHidden(true);
63-
tabWidget->addTab(problemTreeView, tr("Problems"));
65+
tabWidget->addTab(problemTreeView, tr("&Problems"));
6466

6567
d->tabWidget = tabWidget;
6668
d->problemTreeView = problemTreeView;
67-
d->fileStructureTreeView = fileStructureTreeView;
6869
resize(640, 480);
6970
setWindowTitle(tr("DSPX Inspector"));
7071

@@ -141,14 +142,8 @@ namespace Core {
141142
d->problemTreeView->model()->deleteLater();
142143
d->problemTreeView->setModel(nullptr);
143144
}
144-
if (d->fileStructureTreeView->model()) {
145-
d->fileStructureTreeView->model()->deleteLater();
146-
d->fileStructureTreeView->setModel(nullptr);
147-
}
148145
auto problemModel = new QStandardItemModel(this);
149146
d->problemTreeView->setModel(problemModel);
150-
auto fileStructureModel = new QStandardItemModel(this);
151-
d->fileStructureTreeView->setModel(fileStructureModel);
152147
do {
153148
QFile f(d->path);
154149
if (!f.open(QIODevice::ReadOnly)) {
@@ -415,13 +410,12 @@ namespace Core {
415410
warning.description
416411
);
417412
}
418-
419413
} while (false);
420414

415+
d->problemTreeView->expandAll();
421416
d->problemTreeView->resizeColumnToContents(0);
422-
d->fileStructureTreeView->resizeColumnToContents(0);
423-
if (problemModel->rowCount() != 0) {
424-
d->tabWidget->setCurrentIndex(1);
417+
if (problemModel->rowCount() == 0) {
418+
SVS::MessageBox::success(RuntimeInterface::qmlEngine(), windowHandle(), tr("No problems found"), tr("The project file is valid and no problems were found."));
425419
}
426420
}
427421

src/plugins/coreplugin/project/DspxInspectorDialog_p.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ namespace Core {
1717
QString path;
1818
QTabWidget *tabWidget;
1919
QTreeView *problemTreeView;
20-
QTreeView *fileStructureTreeView;
2120

2221
};
2322

0 commit comments

Comments
 (0)