mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
48 lines
1.2 KiB
C++
48 lines
1.2 KiB
C++
// SPDX-FileCopyrightText: 2021 Ernie Pasveer <epasveer@att.net>
|
|
//
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "SeerAboutDialog.h"
|
|
#include "SeerUtl.h"
|
|
#include <QtGui/QColor>
|
|
#include <QtGui/QPalette>
|
|
#include <QtCore/QFile>
|
|
#include <QtCore/QString>
|
|
#include <QtCore/QDebug>
|
|
|
|
SeerAboutDialog::SeerAboutDialog (QWidget* parent) : QDialog(parent) {
|
|
|
|
// Set up the UI.
|
|
setupUi(this);
|
|
|
|
// Get the About text from the resource.
|
|
QFile file(":/seer/resources/ABOUT.md");
|
|
|
|
bool f = file.open(QFile::ReadOnly | QFile::Text);
|
|
if (f == false) {
|
|
return;
|
|
}
|
|
|
|
QTextStream stream(&file);
|
|
|
|
QString text = stream.readAll();
|
|
|
|
// Substitute the text holder with the version number.
|
|
text.replace("VERSIONNUMBER", Seer::version());
|
|
|
|
// Put the About text in as markdown. Move back to the begining.
|
|
textBrowser->setMarkdown(text);
|
|
textBrowser->moveCursor (QTextCursor::Start);
|
|
|
|
// Set the TextBrowser's background to the same as the window's.
|
|
QColor windowColor = palette().color(QWidget::backgroundRole());
|
|
|
|
QPalette p = textBrowser->palette();
|
|
p.setColor(QPalette::Base, windowColor);
|
|
textBrowser->setPalette(p);
|
|
}
|
|
|
|
SeerAboutDialog::~SeerAboutDialog () {
|
|
}
|
|
|