diff options
author | bunnei <bunneidev@gmail.com> | 2018-01-14 19:21:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-14 19:21:12 +0100 |
commit | 7435dc53c8a3d9502232567cddcf3964e2dbab1e (patch) | |
tree | 18bd77221697576ffba6cf50bf3c4f5b9ce02706 | |
parent | Merge pull request #1 from roblabla/patch-1 (diff) | |
parent | Implement "About" dialog (diff) | |
download | yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar.gz yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar.bz2 yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar.lz yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar.xz yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.tar.zst yuzu-7435dc53c8a3d9502232567cddcf3964e2dbab1e.zip |
-rw-r--r-- | dist/icons/icons.qrc | 5 | ||||
-rw-r--r-- | dist/icons/yuzu.png | bin | 0 -> 7719 bytes | |||
-rw-r--r-- | src/yuzu/CMakeLists.txt | 9 | ||||
-rw-r--r-- | src/yuzu/about_dialog.cpp | 15 | ||||
-rw-r--r-- | src/yuzu/about_dialog.h | 23 | ||||
-rw-r--r-- | src/yuzu/aboutdialog.ui | 191 | ||||
-rw-r--r-- | src/yuzu/main.cpp | 9 | ||||
-rw-r--r-- | src/yuzu/main.h | 1 |
8 files changed, 250 insertions, 3 deletions
diff --git a/dist/icons/icons.qrc b/dist/icons/icons.qrc new file mode 100644 index 000000000..575cd0861 --- /dev/null +++ b/dist/icons/icons.qrc @@ -0,0 +1,5 @@ +<RCC> + <qresource prefix="icons"> + <file>yuzu.png</file> + </qresource> +</RCC>
\ No newline at end of file diff --git a/dist/icons/yuzu.png b/dist/icons/yuzu.png Binary files differnew file mode 100644 index 000000000..81a745344 --- /dev/null +++ b/dist/icons/yuzu.png diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index 5b446dc36..c52d5627a 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -4,6 +4,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) set(SRCS + about_dialog.cpp configuration/config.cpp configuration/configure_debug.cpp configuration/configure_dialog.cpp @@ -26,6 +27,7 @@ set(SRCS ) set(HEADERS + about_dialog.h configuration/config.h configuration/configure_debug.h configuration/configure_dialog.h @@ -47,6 +49,7 @@ set(HEADERS ) set(UIS + aboutdialog.ui configuration/configure.ui configuration/configure_debug.ui configuration/configure_general.ui @@ -58,7 +61,7 @@ set(UIS main.ui ) -# file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) +file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) create_directory_groups(${SRCS} ${HEADERS} ${UIS}) @@ -72,10 +75,10 @@ endif() if (APPLE) set(MACOSX_ICON "../../dist/yuzu.icns") set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON}) + add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON} ${ICONS}) set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) else() - add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS}) + add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS} ${ICONS}) endif() target_link_libraries(yuzu PRIVATE common core input_common video_core) target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp new file mode 100644 index 000000000..0f1b6cdc6 --- /dev/null +++ b/src/yuzu/about_dialog.cpp @@ -0,0 +1,15 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include "common/scm_rev.h" +#include "ui_aboutdialog.h" +#include "yuzu/about_dialog.h" + +AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { + ui->setupUi(this); + ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( +Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); +} + +AboutDialog::~AboutDialog() {} diff --git a/src/yuzu/about_dialog.h b/src/yuzu/about_dialog.h new file mode 100644 index 000000000..2eb6e28f5 --- /dev/null +++ b/src/yuzu/about_dialog.h @@ -0,0 +1,23 @@ +// Copyright 2018 yuzu Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <memory> +#include <QDialog> + +namespace Ui { +class AboutDialog; +} + +class AboutDialog : public QDialog { + Q_OBJECT + +public: + explicit AboutDialog(QWidget* parent); + ~AboutDialog(); + +private: + std::unique_ptr<Ui::AboutDialog> ui; +}; diff --git a/src/yuzu/aboutdialog.ui b/src/yuzu/aboutdialog.ui new file mode 100644 index 000000000..cdcaa15b0 --- /dev/null +++ b/src/yuzu/aboutdialog.ui @@ -0,0 +1,191 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>AboutDialog</class> + <widget class="QDialog" name="AboutDialog"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>616</width> + <height>261</height> + </rect> + </property> + <property name="windowTitle"> + <string>About yuzu</string> + </property> + <layout class="QVBoxLayout" name="verticalLayout_3"> + <item> + <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1"> + <item> + <layout class="QVBoxLayout" name="verticalLayout_2"> + <item> + <widget class="QLabel" name="labelLogo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><html><head/><body><p><img src=":/icons/yuzu.png"/></p></body></html></string> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + </layout> + </item> + <item> + <layout class="QVBoxLayout" name="verticalLayout"> + <item> + <widget class="QLabel" name="labelYuzu"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><html><head/><body><p><span style=" font-size:28pt;">yuzu</span></p></body></html></string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelBuildInfo"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><html><head/><body><p>%1 | %2-%3</p></body></html></string> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelAbout"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt;">yuzu is an experimental open-source emulator for the Nintendo Switch licensed under GPLv2.0 or any later version.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:12pt;">This software should not be used to play games you have not legally obtained.</span></p></body></html></string> + </property> + <property name="alignment"> + <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> + </property> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <spacer name="verticalSpacer_2"> + <property name="orientation"> + <enum>Qt::Vertical</enum> + </property> + <property name="sizeHint" stdset="0"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </item> + <item> + <widget class="QLabel" name="labelLinks"> + <property name="text"> + <string><html><head/><body><p><a href="https://yuzu-emu.org/"><span style=" text-decoration: underline; color:#0000ff;">Website</span></a> | <a href="https://github.com/yuzu-emu"><span style=" text-decoration: underline; color:#0000ff;">Source Code</span></a> | <a href="https://github.com/yuzu-emu/yuzu/graphs/contributors"><span style=" text-decoration: underline; color:#0000ff;">Contributors</span></a> | <a href="https://github.com/yuzu-emu/yuzu/blob/master/license.txt"><span style=" text-decoration: underline; color:#0000ff;">License</span></a></p></body></html></string> + </property> + <property name="openExternalLinks"> + <bool>true</bool> + </property> + </widget> + </item> + <item> + <widget class="QLabel" name="labelLiability"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string><html><head/><body><p><span style=" font-size:7pt;">&quot;Nintendo Switch&quot; is a trademark of Nintendo. yuzu is not affiliated with Nintendo in any way.</span></p></body></html></string> + </property> + </widget> + </item> + </layout> + </item> + </layout> + </item> + <item> + <widget class="QDialogButtonBox" name="buttonBox"> + <property name="orientation"> + <enum>Qt::Horizontal</enum> + </property> + <property name="standardButtons"> + <set>QDialogButtonBox::Ok</set> + </property> + </widget> + </item> + </layout> + </widget> + <resources> + <include location="../../dist/icons/icons.qrc"/> + </resources> + <connections> + <connection> + <sender>buttonBox</sender> + <signal>accepted()</signal> + <receiver>AboutDialog</receiver> + <slot>accept()</slot> + <hints> + <hint type="sourcelabel"> + <x>248</x> + <y>254</y> + </hint> + <hint type="destinationlabel"> + <x>157</x> + <y>274</y> + </hint> + </hints> + </connection> + <connection> + <sender>buttonBox</sender> + <signal>rejected()</signal> + <receiver>AboutDialog</receiver> + <slot>reject()</slot> + <hints> + <hint type="sourcelabel"> + <x>316</x> + <y>260</y> + </hint> + <hint type="destinationlabel"> + <x>286</x> + <y>274</y> + </hint> + </hints> + </connection> + </connections> +</ui> diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 99a62c432..5e0d1d0d5 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -26,6 +26,7 @@ #include "core/gdbstub/gdbstub.h" #include "core/loader/loader.h" #include "core/settings.h" +#include "yuzu/about_dialog.h" #include "yuzu/bootmanager.h" #include "yuzu/configuration/config.h" #include "yuzu/configuration/configure_dialog.h" @@ -264,6 +265,9 @@ void GMainWindow::ConnectMenuEvents() { ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F")); connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); + + // Help + connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout); } void GMainWindow::OnDisplayTitleBars(bool show) { @@ -581,6 +585,11 @@ void GMainWindow::OnConfigure() { } } +void GMainWindow::OnAbout() { + AboutDialog aboutDialog(this); + aboutDialog.exec(); +} + void GMainWindow::OnToggleFilterBar() { game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); if (ui.action_Show_Filter_Bar->isChecked()) { diff --git a/src/yuzu/main.h b/src/yuzu/main.h index e37ef2b85..d3f3b3e59 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h @@ -124,6 +124,7 @@ private slots: void OnMenuSelectGameListRoot(); void OnMenuRecentFile(); void OnConfigure(); + void OnAbout(); void OnToggleFilterBar(); void OnDisplayTitleBars(bool); void ToggleWindowMode(); |