From 7a1d3ef7cc8884f7b4a6e6867b0627a0feb226ce Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Mon, 20 Mar 2017 02:25:38 +0100 Subject: Added custom about box --- src/forms/aboutdialog.cpp | 67 +++++++++++++++++++++++++++++ src/forms/aboutdialog.h | 42 +++++++++++++++++++ src/forms/aboutdialog.ui | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 src/forms/aboutdialog.cpp create mode 100644 src/forms/aboutdialog.h create mode 100644 src/forms/aboutdialog.ui (limited to 'src/forms') diff --git a/src/forms/aboutdialog.cpp b/src/forms/aboutdialog.cpp new file mode 100644 index 0000000..1edaac4 --- /dev/null +++ b/src/forms/aboutdialog.cpp @@ -0,0 +1,67 @@ +/** LICENSE ******************************************************************** + ** + ** smolbote: yet another qute browser + ** Copyright (C) 2017 Xian Nox + ** + ** 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 3 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, see . + ** + ******************************************************************************/ + +#include "aboutdialog.h" +#include "ui_aboutdialog.h" +#include "browser.h" + +AboutDialog::AboutDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutDialog) +{ + setAttribute(Qt::WA_DeleteOnClose, true); + ui->setupUi(this); + + ui->icon->setPixmap(qApp->windowIcon().pixmap(72, 72)); + + QLabel *aboutLabel = new QLabel(this); + aboutLabel->setWordWrap(true); + aboutLabel->setText(tr("

smolbote %1

" + "

yet another Qute browser

" + "

Copyright (C) 2017 Xian Nox

" + "

This program comes with ABSOLUTELY NO WARRANTY. " + "This is free software, and you are welcome to redistribute it under the conditions set by the GNU GPLv3.

") + .arg(qApp->applicationVersion())); + ui->toolBox->addItem(aboutLabel, tr("About")); + + QLabel *detailsLabel = new QLabel(this); + detailsLabel->setWordWrap(true); + detailsLabel->setText(tr("

" + "Long version: %1
" + "Configuration: %2" + "

") + .arg(qApp->applicationLongVersion()) + .arg(sSettings->filePath())); + ui->toolBox->addItem(detailsLabel, tr("Details")); + + QLabel *libsLabel = new QLabel(this); + libsLabel->setWordWrap(true); + libsLabel->setText(tr("") + .arg(qVersion())); + ui->toolBox->addItem(libsLabel, tr("Libraries")); +} + +AboutDialog::~AboutDialog() +{ + delete ui; +} diff --git a/src/forms/aboutdialog.h b/src/forms/aboutdialog.h new file mode 100644 index 0000000..aaa299a --- /dev/null +++ b/src/forms/aboutdialog.h @@ -0,0 +1,42 @@ +/** LICENSE ******************************************************************** + ** + ** smolbote: yet another qute browser + ** Copyright (C) 2017 Xian Nox + ** + ** 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 3 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, see . + ** + ******************************************************************************/ + +#ifndef ABOUTDIALOG_H +#define ABOUTDIALOG_H + +#include + +namespace Ui { +class AboutDialog; +} + +class AboutDialog : public QDialog +{ + Q_OBJECT + +public: + explicit AboutDialog(QWidget *parent = 0); + ~AboutDialog(); + +private: + Ui::AboutDialog *ui; +}; + +#endif // ABOUTDIALOG_H diff --git a/src/forms/aboutdialog.ui b/src/forms/aboutdialog.ui new file mode 100644 index 0000000..60fd875 --- /dev/null +++ b/src/forms/aboutdialog.ui @@ -0,0 +1,105 @@ + + + AboutDialog + + + + 0 + 0 + 550 + 320 + + + + About + + + + + + + + + 72 + 72 + + + + TextLabel + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + -1 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Close + + + + + + + + + + + buttonBox + accepted() + AboutDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + -- cgit v1.2.1