Add final for internal widget classes

Improve comments
Hide the render_window when stopping emulation
This commit is contained in:
LittleWhite 2015-09-02 00:28:47 +02:00
parent 679c1e38b6
commit 2b42ba5510
3 changed files with 113 additions and 83 deletions

View File

@ -78,7 +78,7 @@ void EmuThread::run() {
// This class overrides paintEvent and resizeEvent to prevent the GUI thread from stealing GL context. // This class overrides paintEvent and resizeEvent to prevent the GUI thread from stealing GL context.
// The corresponding functionality is handled in EmuThread instead // The corresponding functionality is handled in EmuThread instead
class GGLWidgetInternal : public QGLWidget class GGLWidgetInternal final : public QGLWidget
{ {
public: public:
GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent) GGLWidgetInternal(QGLFormat fmt, GRenderWindow* parent)
@ -97,7 +97,7 @@ private:
GRenderWindow* parent; GRenderWindow* parent;
}; };
class GSplashWidgetInternal : public QWidget class GSplashWidgetInternal final : public QWidget
{ {
public: public:
GSplashWidgetInternal(QWidget* parent) GSplashWidgetInternal(QWidget* parent)
@ -296,7 +296,7 @@ void GRenderWindow::OnMinimalClientAreaChangeRequest(const std::pair<unsigned,un
void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) { void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
this->emu_thread = emu_thread; this->emu_thread = emu_thread;
// Swaps to put in front the render widget // Put render widget in front
active_widget=render_widget; active_widget=render_widget;
layout->removeWidget(splash_widget); layout->removeWidget(splash_widget);
layout->addWidget(render_widget); layout->addWidget(render_widget);
@ -307,7 +307,7 @@ void GRenderWindow::OnEmulationStarting(EmuThread* emu_thread) {
void GRenderWindow::OnEmulationStopping() { void GRenderWindow::OnEmulationStopping() {
emu_thread = nullptr; emu_thread = nullptr;
// Swaps back the splash widget // Put splash widget in front
active_widget=splash_widget; active_widget=splash_widget;
layout->removeWidget(render_widget); layout->removeWidget(render_widget);
layout->addWidget(splash_widget); layout->addWidget(splash_widget);

View File

@ -1,80 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- <svg
Copyright 2014 Citra Emulator Project xmlns:dc="http://purl.org/dc/elements/1.1/"
Licensed under GPLv2 or any later version xmlns:cc="http://creativecommons.org/ns#"
Refer to the license.txt file included. xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
--> xmlns:svg="http://www.w3.org/2000/svg"
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 341.071 338.846"> xmlns="http://www.w3.org/2000/svg"
<radialGradient id="a" cx="170.5356" cy="167.271" r="170.5332" gradientTransform="matrix(1 0 0 0.9935 0 3.2396)" gradientUnits="userSpaceOnUse"> xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
<stop offset="0.5193" stop-color="#FFFFFF" stop-opacity="0.1"/> xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
<stop offset="0.9415" stop-color="#000000" stop-opacity="0.5"/> id="svg2"
<stop offset="1" stop-color="#1A1818" stop-opacity="0"/> viewBox="0 0 341.071 338.846"
</radialGradient> version="1.1"
<ellipse fill="url(#a)" cx="170.535" cy="169.423" rx="170.535" ry="169.423"/> inkscape:version="0.91 r13725"
<circle fill="#D16F17" cx="170.536" cy="167.885" r="161.557"/> sodipodi:docname="citra.svg">
<linearGradient id="b" gradientUnits="userSpaceOnUse" x1="234.4458" y1="33.5771" x2="97.5655" y2="321.2358"> <sodipodi:namedview
<stop offset="0" stop-color="#FFF8BD"/> pagecolor="#ffffff"
<stop offset="1" stop-color="#F6DCAE"/> bordercolor="#666666"
</linearGradient> borderopacity="1"
<circle fill="url(#b)" cx="170.536" cy="167.885" r="155.295"/> objecttolerance="10"
<g> gridtolerance="10"
<linearGradient id="c" gradientUnits="userSpaceOnUse" x1="332.436" y1="91.7446" x2="111.1593" y2="342.0988"> guidetolerance="10"
<stop offset="0" stop-color="#F7A076"/> inkscape:pageopacity="0"
<stop offset="0.4455" stop-color="#F3816C"/> inkscape:pageshadow="2"
<stop offset="1" stop-color="#F06878"/> inkscape:window-width="1366"
</linearGradient> inkscape:window-height="742"
<path fill="url(#c)" stroke="#F06564" stroke-miterlimit="10" d="M309.704,123.138 id="namedview18"
c-5.9-7.802-128.517,44.681-128.517,44.681S303.803,221.01,309.704,212.5C322.434,194.142,323.182,140.957,309.704,123.138z"/> showgrid="false"
<linearGradient id="d" gradientUnits="userSpaceOnUse" x1="285.5845" y1="50.3345" x2="64.3074" y2="300.6891"> inkscape:zoom="1.3929631"
<stop offset="0" stop-color="#9DC63B"/> inkscape:cx="109.66315"
<stop offset="1" stop-color="#9BC183"/> inkscape:cy="116.8673"
</linearGradient> inkscape:window-x="0"
<path fill="url(#d)" stroke="#72AA42" stroke-miterlimit="10" d="M300.518,100.96c-3.98-21.983-41.059-60.12-63.189-63.188 inkscape:window-y="1"
c-9.688-1.345-59.28,122.469-59.28,122.469S302.364,111.149,300.518,100.96z"/> inkscape:window-maximized="1"
<linearGradient id="e" gradientUnits="userSpaceOnUse" x1="229.4995" y1="0.7637" x2="8.2231" y2="251.1176"> inkscape:current-layer="svg2" />
<stop offset="0" stop-color="#D5DE26"/> <metadata
<stop offset="1" stop-color="#C5D94B"/> id="metadata101">
</linearGradient> <rdf:RDF>
<path fill="url(#e)" stroke="#BECD30" stroke-miterlimit="10" d="M215.151,28.584c-18.357-12.73-71.543-13.478-89.362,0.001 <cc:Work
c-7.801,5.899,44.682,128.516,44.682,128.516S223.663,34.484,215.151,28.584z"/> rdf:about="">
<linearGradient id="f" gradientUnits="userSpaceOnUse" x1="219.3823" y1="-8.1782" x2="-1.8941" y2="242.1756"> <dc:format>image/svg+xml</dc:format>
<stop offset="0" stop-color="#F2D200"/> <dc:type
<stop offset="1" stop-color="#FDEF52"/> rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</linearGradient> <dc:title />
<path fill="url(#f)" stroke="#E1BE29" stroke-miterlimit="10" d="M162.893,160.239c0,0-49.092-124.315-59.281-122.469 </cc:Work>
c-21.982,3.979-60.12,41.058-63.188,63.189C39.078,110.646,162.893,160.239,162.893,160.239z"/> </rdf:RDF>
<linearGradient id="g" gradientUnits="userSpaceOnUse" x1="226.0718" y1="-2.2656" x2="4.7951" y2="248.0886"> </metadata>
<stop offset="0" stop-color="#FFCD10"/> <defs
<stop offset="1" stop-color="#F29634"/> id="defs99" />
</linearGradient> <ellipse
<path fill="url(#g)" stroke="#F79421" stroke-miterlimit="10" d="M31.236,123.136c-12.73,18.357-13.479,71.543,0,89.362 style="fill:none"
c5.898,7.801,128.516-44.682,128.516-44.682S37.135,114.625,31.236,123.136z"/> id="ellipse11"
<linearGradient id="h" gradientUnits="userSpaceOnUse" x1="272.9214" y1="39.144" x2="51.6446" y2="289.4984"> ry="169.423"
<stop offset="0" stop-color="#F79F1C"/> rx="170.535"
<stop offset="0.4455" stop-color="#F08021"/> cy="169.423"
<stop offset="1" stop-color="#ED693C"/> cx="170.535" />
</linearGradient> <circle
<path fill="url(#h)" stroke="#F16622" stroke-miterlimit="10" d="M40.422,234.676c3.979,21.982,41.057,60.12,63.188,63.188 style="fill:#dedede;fill-opacity:1"
c9.687,1.346,59.279-122.468,59.279-122.468S38.574,224.487,40.422,234.676z"/> id="circle13"
<linearGradient id="i" gradientUnits="userSpaceOnUse" x1="329.0083" y1="88.7129" x2="107.7311" y2="339.0677"> r="161.557"
<stop offset="0" stop-color="#E47C26"/> cy="167.885"
<stop offset="0.4455" stop-color="#DF5B27"/> cx="170.536" />
<stop offset="1" stop-color="#DD3A3A"/> <circle
</linearGradient> style="fill:#efebe7;fill-opacity:1"
<path fill="url(#i)" stroke="#E03827" stroke-miterlimit="10" d="M125.787,307.051c18.357,12.73,71.543,13.48,89.362,0 id="circle20"
c7.801-5.898-44.681-128.515-44.681-128.515S117.275,301.153,125.787,307.051z"/> r="155.295"
<linearGradient id="j" gradientUnits="userSpaceOnUse" x1="339.1245" y1="97.6562" x2="117.8478" y2="348.0104"> cy="167.885"
<stop offset="0" stop-color="#F3783C"/> cx="170.536" />
<stop offset="0.4455" stop-color="#EF5339"/> <g
<stop offset="1" stop-color="#ED294A"/> id="g22">
</linearGradient> <path
<path fill="url(#j)" stroke="#ED2836" stroke-miterlimit="10" d="M178.047,175.398c0,0,49.09,124.315,59.28,122.467 style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
c21.982-3.979,60.121-41.057,63.189-63.188C301.86,224.991,178.047,175.398,178.047,175.398z"/> id="path31"
d="M309.704,123.138 c-5.9-7.802-128.517,44.681-128.517,44.681S303.803,221.01,309.704,212.5C322.434,194.142,323.182,140.957,309.704,123.138z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path38"
d="M300.518,100.96c-3.98-21.983-41.059-60.12-63.189-63.188 c-9.688-1.345-59.28,122.469-59.28,122.469S302.364,111.149,300.518,100.96z" />
<path
style="fill-opacity:1;stroke:#dedede;stroke-opacity:1;fill:#dedede"
id="path45"
d="M215.151,28.584c-18.357-12.73-71.543-13.478-89.362,0.001 c-7.801,5.899,44.682,128.516,44.682,128.516S223.663,34.484,215.151,28.584z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path52"
d="M162.893,160.239c0,0-49.092-124.315-59.281-122.469 c-21.982,3.979-60.12,41.058-63.188,63.189C39.078,110.646,162.893,160.239,162.893,160.239z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path59"
d="M31.236,123.136c-12.73,18.357-13.479,71.543,0,89.362 c5.898,7.801,128.516-44.682,128.516-44.682S37.135,114.625,31.236,123.136z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path68"
d="M40.422,234.676c3.979,21.982,41.057,60.12,63.188,63.188 c9.687,1.346,59.279-122.468,59.279-122.468S38.574,224.487,40.422,234.676z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path77"
d="M125.787,307.051c18.357,12.73,71.543,13.48,89.362,0 c7.801-5.898-44.681-128.515-44.681-128.515S117.275,301.153,125.787,307.051z" />
<path
style="fill:#dedede;fill-opacity:1;stroke:#dedede;stroke-opacity:1"
id="path86"
d="M178.047,175.398c0,0,49.09,124.315,59.28,122.467 c21.982-3.979,60.121-41.057,63.189-63.188C301.86,224.991,178.047,175.398,178.047,175.398z" />
</g> </g>
<linearGradient id="k" gradientUnits="userSpaceOnUse" x1="170.5352" y1="6.3281" x2="170.5351" y2="329.4424"> <circle
<stop offset="0" stop-color="#FFFFFF" stop-opacity="0.2"/> style="fill:none;fill-opacity:1"
<stop offset="0.4504" stop-color="#908E8E" stop-opacity="0.05"/> id="circle95"
<stop offset="1" stop-color="#030003" stop-opacity="0.2"/> r="161.557"
</linearGradient> cy="167.885"
<circle fill="url(#k)" cx="170.536" cy="167.885" r="161.557"/> cx="170.536" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -290,6 +290,7 @@ void GMainWindow::ShutdownGame() {
ui.action_Start->setText(tr("Start")); ui.action_Start->setText(tr("Start"));
ui.action_Pause->setEnabled(false); ui.action_Pause->setEnabled(false);
ui.action_Stop->setEnabled(false); ui.action_Stop->setEnabled(false);
render_window->hide();
} }
void GMainWindow::StoreRecentFile(const QString& filename) void GMainWindow::StoreRecentFile(const QString& filename)