aboutsummaryrefslogtreecommitdiff
path: root/mapman/src/diffview.cpp
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2023-09-09 20:09:50 -0400
committerGravatar Chris Xiong <chirs241097@gmail.com> 2023-09-09 20:09:50 -0400
commit93cf929f29dea490ed60e5300cacdd99886c988e (patch)
tree0f8669c56e22a287047ee20846b92f1580d7364f /mapman/src/diffview.cpp
parent40432e083b11271cf3148b9c38156cf759436699 (diff)
downloadmeteor-trashy-addon-93cf929f29dea490ed60e5300cacdd99886c988e.tar.xz
Add the standalone portion of mapman.
Diffstat (limited to 'mapman/src/diffview.cpp')
-rw-r--r--mapman/src/diffview.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/mapman/src/diffview.cpp b/mapman/src/diffview.cpp
new file mode 100644
index 0000000..3c437c4
--- /dev/null
+++ b/mapman/src/diffview.cpp
@@ -0,0 +1,37 @@
+#include "diffview.hpp"
+
+#include <QTextEdit>
+#include <QLabel>
+#include <QHBoxLayout>
+#include <QVBoxLayout>
+#include <qboxlayout.h>
+
+diff_view::diff_view(QWidget *par) : QWidget(par)
+{
+ this->setWindowTitle("Map tally comparison results");
+ tea_b = new QTextEdit();
+ teb_a = new QTextEdit();
+ tea_b->setReadOnly(true);
+ teb_a->setReadOnly(true);
+ auto hl = new QHBoxLayout();
+ auto lvl = new QVBoxLayout();
+ lvl->addWidget(new QLabel("Maps present in library but not in tally"));
+ lvl->addWidget(tea_b);
+ auto rvl = new QVBoxLayout();
+ rvl->addWidget(new QLabel("Maps present in tally but not in library"));
+ rvl->addWidget(teb_a);
+ hl->addLayout(lvl);
+ hl->addLayout(rvl);
+ this->setLayout(hl);
+}
+
+void diff_view::set_results(const std::vector<int> &a_b, const std::vector<int> &b_a)
+{
+ tea_b->clear();
+ teb_a->clear();
+ QString sa_b, sb_a;
+ for (auto &i : a_b) sa_b.append(QString("%1\n").arg(i));
+ for (auto &i : b_a) sb_a.append(QString("%1\n").arg(i));
+ tea_b->setText(sa_b);
+ teb_a->setText(sb_a);
+}