summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar spycrab2018-01-14 19:15:45 +0100
committerGravatar spycrab2018-01-14 19:15:45 +0100
commitc493bd9cc927f9119960e6dc084d374a2ec75d26 (patch)
tree94b90ebb26d2b9ae3a8822395e928a3eee5aba98 /src
parentexternals: Remove unused repos. (diff)
downloadyuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.tar.gz
yuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.tar.xz
yuzu-c493bd9cc927f9119960e6dc084d374a2ec75d26.zip
Implement "About" dialog
Diffstat (limited to 'src')
-rw-r--r--src/yuzu/CMakeLists.txt9
-rw-r--r--src/yuzu/about_dialog.cpp15
-rw-r--r--src/yuzu/about_dialog.h23
-rw-r--r--src/yuzu/aboutdialog.ui191
-rw-r--r--src/yuzu/main.cpp9
-rw-r--r--src/yuzu/main.h1
6 files changed, 245 insertions, 3 deletions
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)
4set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) 4set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules)
5 5
6set(SRCS 6set(SRCS
7 about_dialog.cpp
7 configuration/config.cpp 8 configuration/config.cpp
8 configuration/configure_debug.cpp 9 configuration/configure_debug.cpp
9 configuration/configure_dialog.cpp 10 configuration/configure_dialog.cpp
@@ -26,6 +27,7 @@ set(SRCS
26 ) 27 )
27 28
28set(HEADERS 29set(HEADERS
30 about_dialog.h
29 configuration/config.h 31 configuration/config.h
30 configuration/configure_debug.h 32 configuration/configure_debug.h
31 configuration/configure_dialog.h 33 configuration/configure_dialog.h
@@ -47,6 +49,7 @@ set(HEADERS
47 ) 49 )
48 50
49set(UIS 51set(UIS
52 aboutdialog.ui
50 configuration/configure.ui 53 configuration/configure.ui
51 configuration/configure_debug.ui 54 configuration/configure_debug.ui
52 configuration/configure_general.ui 55 configuration/configure_general.ui
@@ -58,7 +61,7 @@ set(UIS
58 main.ui 61 main.ui
59 ) 62 )
60 63
61# file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*) 64file(GLOB_RECURSE ICONS ${CMAKE_SOURCE_DIR}/dist/icons/*)
62file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*) 65file(GLOB_RECURSE THEMES ${CMAKE_SOURCE_DIR}/dist/qt_themes/*)
63 66
64create_directory_groups(${SRCS} ${HEADERS} ${UIS}) 67create_directory_groups(${SRCS} ${HEADERS} ${UIS})
@@ -72,10 +75,10 @@ endif()
72if (APPLE) 75if (APPLE)
73 set(MACOSX_ICON "../../dist/yuzu.icns") 76 set(MACOSX_ICON "../../dist/yuzu.icns")
74 set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) 77 set_source_files_properties(${MACOSX_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
75 add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON}) 78 add_executable(yuzu MACOSX_BUNDLE ${SRCS} ${HEADERS} ${UI_HDRS} ${MACOSX_ICON} ${ICONS})
76 set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) 79 set_target_properties(yuzu PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist)
77else() 80else()
78 add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS}) 81 add_executable(yuzu ${SRCS} ${HEADERS} ${UI_HDRS} ${ICONS})
79endif() 82endif()
80target_link_libraries(yuzu PRIVATE common core input_common video_core) 83target_link_libraries(yuzu PRIVATE common core input_common video_core)
81target_link_libraries(yuzu PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets) 84target_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 @@
1// Copyright 2018 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include "common/scm_rev.h"
6#include "ui_aboutdialog.h"
7#include "yuzu/about_dialog.h"
8
9AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
10 ui->setupUi(this);
11 ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg(
12Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));
13}
14
15AboutDialog::~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 @@
1// Copyright 2018 yuzu Emulator Project
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7#include <memory>
8#include <QDialog>
9
10namespace Ui {
11class AboutDialog;
12}
13
14class AboutDialog : public QDialog {
15 Q_OBJECT
16
17public:
18 explicit AboutDialog(QWidget* parent);
19 ~AboutDialog();
20
21private:
22 std::unique_ptr<Ui::AboutDialog> ui;
23};
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 @@
1<?xml version="1.0" encoding="UTF-8"?>
2<ui version="4.0">
3 <class>AboutDialog</class>
4 <widget class="QDialog" name="AboutDialog">
5 <property name="geometry">
6 <rect>
7 <x>0</x>
8 <y>0</y>
9 <width>616</width>
10 <height>261</height>
11 </rect>
12 </property>
13 <property name="windowTitle">
14 <string>About yuzu</string>
15 </property>
16 <layout class="QVBoxLayout" name="verticalLayout_3">
17 <item>
18 <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1">
19 <item>
20 <layout class="QVBoxLayout" name="verticalLayout_2">
21 <item>
22 <widget class="QLabel" name="labelLogo">
23 <property name="sizePolicy">
24 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
25 <horstretch>0</horstretch>
26 <verstretch>0</verstretch>
27 </sizepolicy>
28 </property>
29 <property name="text">
30 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;img src=&quot;:/icons/yuzu.png&quot;/&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
31 </property>
32 </widget>
33 </item>
34 <item>
35 <spacer name="verticalSpacer">
36 <property name="orientation">
37 <enum>Qt::Vertical</enum>
38 </property>
39 <property name="sizeHint" stdset="0">
40 <size>
41 <width>20</width>
42 <height>40</height>
43 </size>
44 </property>
45 </spacer>
46 </item>
47 </layout>
48 </item>
49 <item>
50 <layout class="QVBoxLayout" name="verticalLayout">
51 <item>
52 <widget class="QLabel" name="labelYuzu">
53 <property name="sizePolicy">
54 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
55 <horstretch>0</horstretch>
56 <verstretch>0</verstretch>
57 </sizepolicy>
58 </property>
59 <property name="text">
60 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:28pt;&quot;&gt;yuzu&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
61 </property>
62 </widget>
63 </item>
64 <item>
65 <widget class="QLabel" name="labelBuildInfo">
66 <property name="sizePolicy">
67 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
68 <horstretch>0</horstretch>
69 <verstretch>0</verstretch>
70 </sizepolicy>
71 </property>
72 <property name="text">
73 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;%1 | %2-%3&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
74 </property>
75 </widget>
76 </item>
77 <item>
78 <widget class="QLabel" name="labelAbout">
79 <property name="sizePolicy">
80 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
81 <horstretch>0</horstretch>
82 <verstretch>0</verstretch>
83 </sizepolicy>
84 </property>
85 <property name="text">
86 <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
87&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
88p, li { white-space: pre-wrap; }
89&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Ubuntu'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt;
90&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt;&quot;&gt;yuzu is an experimental open-source emulator for the Nintendo Switch licensed under GPLv2.0 or any later version.&lt;/span&gt;&lt;/p&gt;
91&lt;p style=&quot;-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;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
92&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'MS Shell Dlg 2'; font-size:12pt;&quot;&gt;This software should not be used to play games you have not legally obtained.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
93 </property>
94 <property name="alignment">
95 <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
96 </property>
97 <property name="wordWrap">
98 <bool>true</bool>
99 </property>
100 </widget>
101 </item>
102 <item>
103 <spacer name="verticalSpacer_2">
104 <property name="orientation">
105 <enum>Qt::Vertical</enum>
106 </property>
107 <property name="sizeHint" stdset="0">
108 <size>
109 <width>20</width>
110 <height>40</height>
111 </size>
112 </property>
113 </spacer>
114 </item>
115 <item>
116 <widget class="QLabel" name="labelLinks">
117 <property name="text">
118 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;a href=&quot;https://yuzu-emu.org/&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Website&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Source Code&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/graphs/contributors&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;Contributors&lt;/span&gt;&lt;/a&gt; | &lt;a href=&quot;https://github.com/yuzu-emu/yuzu/blob/master/license.txt&quot;&gt;&lt;span style=&quot; text-decoration: underline; color:#0000ff;&quot;&gt;License&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
119 </property>
120 <property name="openExternalLinks">
121 <bool>true</bool>
122 </property>
123 </widget>
124 </item>
125 <item>
126 <widget class="QLabel" name="labelLiability">
127 <property name="sizePolicy">
128 <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
129 <horstretch>0</horstretch>
130 <verstretch>0</verstretch>
131 </sizepolicy>
132 </property>
133 <property name="text">
134 <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;&lt;span style=&quot; font-size:7pt;&quot;&gt;&amp;quot;Nintendo Switch&amp;quot; is a trademark of Nintendo. yuzu is not affiliated with Nintendo in any way.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
135 </property>
136 </widget>
137 </item>
138 </layout>
139 </item>
140 </layout>
141 </item>
142 <item>
143 <widget class="QDialogButtonBox" name="buttonBox">
144 <property name="orientation">
145 <enum>Qt::Horizontal</enum>
146 </property>
147 <property name="standardButtons">
148 <set>QDialogButtonBox::Ok</set>
149 </property>
150 </widget>
151 </item>
152 </layout>
153 </widget>
154 <resources>
155 <include location="../../dist/icons/icons.qrc"/>
156 </resources>
157 <connections>
158 <connection>
159 <sender>buttonBox</sender>
160 <signal>accepted()</signal>
161 <receiver>AboutDialog</receiver>
162 <slot>accept()</slot>
163 <hints>
164 <hint type="sourcelabel">
165 <x>248</x>
166 <y>254</y>
167 </hint>
168 <hint type="destinationlabel">
169 <x>157</x>
170 <y>274</y>
171 </hint>
172 </hints>
173 </connection>
174 <connection>
175 <sender>buttonBox</sender>
176 <signal>rejected()</signal>
177 <receiver>AboutDialog</receiver>
178 <slot>reject()</slot>
179 <hints>
180 <hint type="sourcelabel">
181 <x>316</x>
182 <y>260</y>
183 </hint>
184 <hint type="destinationlabel">
185 <x>286</x>
186 <y>274</y>
187 </hint>
188 </hints>
189 </connection>
190 </connections>
191</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 @@
26#include "core/gdbstub/gdbstub.h" 26#include "core/gdbstub/gdbstub.h"
27#include "core/loader/loader.h" 27#include "core/loader/loader.h"
28#include "core/settings.h" 28#include "core/settings.h"
29#include "yuzu/about_dialog.h"
29#include "yuzu/bootmanager.h" 30#include "yuzu/bootmanager.h"
30#include "yuzu/configuration/config.h" 31#include "yuzu/configuration/config.h"
31#include "yuzu/configuration/configure_dialog.h" 32#include "yuzu/configuration/configure_dialog.h"
@@ -264,6 +265,9 @@ void GMainWindow::ConnectMenuEvents() {
264 ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F")); 265 ui.action_Show_Filter_Bar->setShortcut(tr("CTRL+F"));
265 connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar); 266 connect(ui.action_Show_Filter_Bar, &QAction::triggered, this, &GMainWindow::OnToggleFilterBar);
266 connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible); 267 connect(ui.action_Show_Status_Bar, &QAction::triggered, statusBar(), &QStatusBar::setVisible);
268
269 // Help
270 connect(ui.action_About, &QAction::triggered, this, &GMainWindow::OnAbout);
267} 271}
268 272
269void GMainWindow::OnDisplayTitleBars(bool show) { 273void GMainWindow::OnDisplayTitleBars(bool show) {
@@ -581,6 +585,11 @@ void GMainWindow::OnConfigure() {
581 } 585 }
582} 586}
583 587
588void GMainWindow::OnAbout() {
589 AboutDialog aboutDialog(this);
590 aboutDialog.exec();
591}
592
584void GMainWindow::OnToggleFilterBar() { 593void GMainWindow::OnToggleFilterBar() {
585 game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked()); 594 game_list->setFilterVisible(ui.action_Show_Filter_Bar->isChecked());
586 if (ui.action_Show_Filter_Bar->isChecked()) { 595 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:
124 void OnMenuSelectGameListRoot(); 124 void OnMenuSelectGameListRoot();
125 void OnMenuRecentFile(); 125 void OnMenuRecentFile();
126 void OnConfigure(); 126 void OnConfigure();
127 void OnAbout();
127 void OnToggleFilterBar(); 128 void OnToggleFilterBar();
128 void OnDisplayTitleBars(bool); 129 void OnDisplayTitleBars(bool);
129 void ToggleWindowMode(); 130 void ToggleWindowMode();