From 9f1ddc2b38469d5028aec5ba7b68131d711f2622 Mon Sep 17 00:00:00 2001 From: Pavel Pisa Date: Wed, 13 Feb 2019 13:18:17 +0100 Subject: Add simple about dialog and prepare menu entries for serial port and peripherals. Signed-off-by: Pavel Pisa --- qtmips_gui/aboutdialog.cpp | 133 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 qtmips_gui/aboutdialog.cpp (limited to 'qtmips_gui/aboutdialog.cpp') diff --git a/qtmips_gui/aboutdialog.cpp b/qtmips_gui/aboutdialog.cpp new file mode 100644 index 0000000..83ab1b7 --- /dev/null +++ b/qtmips_gui/aboutdialog.cpp @@ -0,0 +1,133 @@ +// SPDX-License-Identifier: GPL-2.0+ +/******************************************************************************* + * QtMips - MIPS 32-bit Architecture Subset Simulator + * + * Implemented to support following courses: + * + * B35APO - Computer Architectures + * https://cw.fel.cvut.cz/wiki/courses/b35apo + * + * B4M35PAP - Advanced Computer Architectures + * https://cw.fel.cvut.cz/wiki/courses/b4m35pap/start + * + * Copyright (c) 2017-2019 Karel Koci + * Copyright (c) 2019 Pavel Pisa + * + * Faculty of Electrical Engineering (http://www.fel.cvut.cz) + * Czech Technical University (http://www.cvut.cz/) + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + ******************************************************************************/ + +#include "aboutdialog.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +AboutDialog::AboutDialog(QWidget *parent) + : QDialog(parent) +{ + QLabel *lbl; + + setWindowTitle(tr("About Qt Mips")); + + all = new QVBoxLayout(this); + + QWidget *hbox = new QWidget(); + QHBoxLayout *hl = new QHBoxLayout(hbox); + hl->setContentsMargins(0,0,0,0); + + all->addWidget(hbox); + + QWidget *vbox = new QWidget(); + QVBoxLayout *vl = new QVBoxLayout(vbox); + //vl->setContentsMargins(0,0,0,0); + hl->addWidget(vbox); + + QString versionText; + versionText = "Version 0.5 \n"; + + vl->addWidget(new QLabel("Qt Mips - MIPS Architecture Simulator")); + lbl = new QLabel(versionText); + lbl->setAlignment(Qt::AlignHCenter); + lbl->setOpenExternalLinks(true); + vl->addWidget(lbl); + vl->addWidget(new QLabel("Copyright (C) 2017-2019 Karel Kočí " + "cynerd@email.cz
" + "Copyright (C) 2019 Pavel Píša " + "pisa@cmp.felk.cvut.cz")); + + QString supportText; + supportText = "Home Page : https://github.com/ppisa/QtMips
" + "Home Page : https://github.com/Cynerd/QtMips
" + "Implemented for
" + "Computer Architectures
" + "and
" + "Advanced Computer Achitectures
" + "courses at
" + "Czech Technical University in Prague
" + "Faculty of Electrical Engineering
"; + + QTextBrowser *supportBrowser = new QTextBrowser; + supportBrowser->setOpenExternalLinks(true); + supportBrowser->setHtml(supportText); + vl->addWidget(supportBrowser); + + QString licenseText; + licenseText = "This program is free software; you can redistribute it and/or\n" + "modify it under the terms of the GNU General Public License\n" + "as published by the Free Software Foundation; either version 2\n" + "of the License, or (at your option) any later version.\n" + "
\n" + "
\n" + "This program is distributed in the hope that it will be useful,\n" + "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" + "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" + "GNU General Public License for more details.\n" + "
\n" + "
\n" + "You should have received a copy of the GNU General Public License\n" + "along with this program; if not, write to the Free Software\n" + "Foundation, Inc., 51 Franklin Street, Fifth Floor,\n" + "Boston, MA 02110-1301, USA.\n"; + + QTextBrowser *licenseBrowser = new QTextBrowser; + licenseBrowser->setOpenExternalLinks(true); + licenseBrowser->setHtml(licenseText); + vl->addWidget(licenseBrowser); + + QWidget *hbBtn = new QWidget(); + QHBoxLayout *hlBtn = new QHBoxLayout(hbBtn); + hlBtn->setContentsMargins(0,0,0,0); + vl->addWidget(hbBtn); + + QPushButton *okButton = new QPushButton(tr("&OK"), parent); + okButton->setFocus(); + connect(okButton, SIGNAL(clicked()), this, SLOT(close())); + hlBtn->addStretch(); + hlBtn->addWidget(okButton); + + prevTab = 0; // first Tab is selected by default +} -- cgit v1.2.3