Skip to content

Commit

Permalink
Merge pull request #6682 from spycrab/qt_minor_fixes
Browse files Browse the repository at this point in the history
Qt: Minor fixes
  • Loading branch information
Tilka committed Apr 22, 2018
2 parents 4a0b6c7 + 7b35c85 commit c131b7c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Core/DolphinQt2/MainWindow.cpp
Expand Up @@ -595,7 +595,7 @@ bool MainWindow::RequestStop()

void MainWindow::ForceStop()
{
BootManager::Stop();
Core::Stop();
EnableScreenSaver(true);
}

Expand Down
15 changes: 15 additions & 0 deletions Source/Core/DolphinQt2/Settings/GeneralPane.cpp
Expand Up @@ -18,6 +18,7 @@

#include "Core/Analytics.h"
#include "Core/ConfigManager.h"
#include "Core/Core.h"
#include "Core/PowerPC/PowerPC.h"
#include "DolphinQt2/Settings.h"
#include "UICommon/AutoUpdate.h"
Expand All @@ -38,6 +39,9 @@ GeneralPane::GeneralPane(QWidget* parent) : QWidget(parent)
LoadConfig();

ConnectLayout();

connect(&Settings::Instance(), &Settings::EmulationStateChanged, this,
&GeneralPane::OnEmulationStateChanged);
}

void GeneralPane::CreateLayout()
Expand All @@ -59,6 +63,17 @@ void GeneralPane::CreateLayout()
setLayout(m_main_layout);
}

void GeneralPane::OnEmulationStateChanged(Core::State state)
{
const bool running = state != Core::State::Uninitialized;

m_checkbox_dualcore->setEnabled(!running);
m_checkbox_cheats->setEnabled(!running);
m_radio_interpreter->setEnabled(!running);
m_radio_cached_interpreter->setEnabled(!running);
m_radio_jit->setEnabled(!running);
}

void GeneralPane::ConnectLayout()
{
connect(m_checkbox_dualcore, &QCheckBox::toggled, this, &GeneralPane::OnSaveConfig);
Expand Down
6 changes: 6 additions & 0 deletions Source/Core/DolphinQt2/Settings/GeneralPane.h
Expand Up @@ -14,6 +14,11 @@ class QRadioButton;
class QSlider;
class QVBoxLayout;

namespace Core
{
enum class State;
}

class GeneralPane final : public QWidget
{
Q_OBJECT
Expand All @@ -29,6 +34,7 @@ class GeneralPane final : public QWidget

void LoadConfig();
void OnSaveConfig();
void OnEmulationStateChanged(Core::State state);

// Widgets
QVBoxLayout* m_main_layout;
Expand Down

0 comments on commit c131b7c

Please sign in to comment.