-
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed the layout of the About dialog.
- Loading branch information
Showing
6 changed files
with
291 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<ui version="4.0"> | ||
<class>dlgAbout</class> | ||
<widget class="QDialog" name="dlgAbout"> | ||
<property name="geometry"> | ||
<rect> | ||
<x>0</x> | ||
<y>0</y> | ||
<width>400</width> | ||
<height>151</height> | ||
</rect> | ||
</property> | ||
<property name="windowTitle"> | ||
<string notr="true">About</string> | ||
</property> | ||
<layout class="QVBoxLayout" name="verticalLayout_dlgAbout"> | ||
<property name="spacing"> | ||
<number>24</number> | ||
</property> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout_Icon_Text"> | ||
<property name="spacing"> | ||
<number>24</number> | ||
</property> | ||
<item> | ||
<widget class="QLabel" name="icon_About"> | ||
<property name="text"> | ||
<string notr="true">Icon</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<layout class="QVBoxLayout" name="verticalLayout_Text"> | ||
<property name="spacing"> | ||
<number>12</number> | ||
</property> | ||
<item> | ||
<widget class="QLabel" name="label_Text"> | ||
<property name="text"> | ||
<string notr="true">Text</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
<item> | ||
<widget class="QLabel" name="label_Informative"> | ||
<property name="text"> | ||
<string notr="true">Informative</string> | ||
</property> | ||
<property name="alignment"> | ||
<set>Qt::AlignCenter</set> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</item> | ||
</layout> | ||
</item> | ||
<item> | ||
<widget class="QPushButton" name="pushButton_Ok"> | ||
<property name="text"> | ||
<string notr="true">Ok</string> | ||
</property> | ||
<property name="icon"> | ||
<iconset resource="resources.qrc"> | ||
<normaloff>:/icon/icons/confirm.svgz</normaloff>:/icon/icons/confirm.svgz</iconset> | ||
</property> | ||
</widget> | ||
</item> | ||
</layout> | ||
</widget> | ||
<resources> | ||
<include location="resources.qrc"/> | ||
</resources> | ||
<connections/> | ||
</ui> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright (C) 2010-2023 Fabio Cavallo (aka FHorse) | ||
* | ||
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#include <QtCore/QDateTime> | ||
#include <QtCore/QEvent> | ||
#include <QtGui/QIcon> | ||
#include <QtGui/QPainter> | ||
#include "dlgAbout.hpp" | ||
#include "version.h" | ||
#include "info.h" | ||
|
||
dlgAbout::dlgAbout(QWidget *parent) : QDialog(parent) { | ||
QDateTime compiled = QDateTime::fromString(COMPILED, "MMddyyyyhhmmss"); | ||
QString text; | ||
|
||
setupUi(this); | ||
|
||
setAttribute(Qt::WA_DeleteOnClose); | ||
|
||
if (font().pointSize() > 9) { | ||
QFont font; | ||
|
||
font.setPointSize(9); | ||
setFont(font); | ||
} | ||
|
||
setWindowTitle(QString(NAME)); | ||
setWindowModality(Qt::WindowModal); | ||
|
||
setWindowIcon(QIcon(":/icon/icons/application.png")); | ||
icon_About->setPixmap(QPixmap(":/pics/pics/punes_banner.png")); | ||
|
||
text.append("<center><h2>" + QString(NAME) + " "); | ||
if (info.portable) { | ||
text.append(tr("portable version") + " "); | ||
} | ||
text.append(QString(VERSION) + "</h2></center>"); | ||
|
||
#if defined (WITH_GIT_INFO) | ||
text.append("<center><h4>[<font color='#800000'>Commit " + QString(GIT_COUNT_COMMITS) + "</font> " + "<a href=\"https://github.com/punesemu/puNES/commit/" + QString(GIT_LAST_COMMIT_HASH) + "\">" + QString(GIT_LAST_COMMIT) + "</a>]</h4></center>"); | ||
#endif | ||
text.append("<center>" + tr("Nintendo Entertainment System Emulator") + "</center>"); | ||
text.append("<center>" + tr("Compiled") + " " + QLocale().toString(compiled, QLocale::ShortFormat) + " (" + QString(ENVIRONMENT)); | ||
text.append(", " + QString(VERTYPE) + ")</center>"); | ||
label_Text->setText(text); | ||
|
||
text = "<center>" + QString(COPYRUTF8) + "</center>\n"; | ||
text.append("<center><a href=\"" + QString(GITLAB) + "\">" + "GitLab Page</a></center>"); | ||
text.append("<center><a href=\"" + QString(GITHUB) + "\">" + "GitHub Page</a></center>"); | ||
text.append("<center><a href=\"" + QString(WEBSITE) + "\">" + "NesDev Forum</a></center>"); | ||
label_Informative->setText(text); | ||
|
||
connect(pushButton_Ok, SIGNAL(clicked(bool)), this, SLOT(s_ok_clicked(bool))); | ||
} | ||
dlgAbout::~dlgAbout() = default; | ||
|
||
void dlgAbout::changeEvent(QEvent *event) { | ||
if (event->type() == QEvent::LanguageChange) { | ||
retranslateUi(this); | ||
} else { | ||
QDialog::changeEvent(event); | ||
} | ||
} | ||
|
||
void dlgAbout::s_ok_clicked(UNUSED(bool checked)) { | ||
close(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (C) 2010-2023 Fabio Cavallo (aka FHorse) | ||
* | ||
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
*/ | ||
|
||
#ifndef DLGABOUT_HPP_ | ||
#define DLGABOUT_HPP_ | ||
|
||
#include <QtWidgets/QDialog> | ||
#include "ui_dlgAbout.h" | ||
#include "common.h" | ||
|
||
class dlgAbout : public QDialog, public Ui::dlgAbout { | ||
Q_OBJECT | ||
|
||
public: | ||
explicit dlgAbout(QWidget *parent = nullptr); | ||
~dlgAbout() override; | ||
|
||
protected: | ||
void changeEvent(QEvent *event) override; | ||
|
||
private slots: | ||
void s_ok_clicked(bool checked); | ||
}; | ||
|
||
#endif /* DLGABOUT_HPP_ */ |
Oops, something went wrong.