Permalink
Browse files

Debugger: Add checkbox to enable remote debugger.

It's not a setting though, so maybe a button would be better.  Or, it
could be the startup setting...
  • Loading branch information...
unknownbrackets committed Apr 21, 2018
1 parent f81fa27 commit a2d82cb6547ad30b778ae940e10d0d5a8d5c812f
Showing with 29 additions and 1 deletion.
  1. +24 −0 UI/GameSettingsScreen.cpp
  2. +5 −1 UI/GameSettingsScreen.h
View
@@ -52,6 +52,7 @@
#include "Core/Host.h"
#include "Core/System.h"
#include "Core/Reporting.h"
#include "Core/WebServer.h"
#include "GPU/Common/PostShader.h"
#include "android/jni/TestRunner.h"
#include "GPU/GPUInterface.h"
@@ -1270,6 +1271,12 @@ void DeveloperToolsScreen::CreateViews() {
createTextureIni->SetEnabled(false);
}
#endif
allowDebugger_ = !WebServerStopped(WebServerFlags::DEBUGGER);
canAllowDebugger_ = !WebServerStopping(WebServerFlags::DEBUGGER);
CheckBox *allowDebugger = new CheckBox(&allowDebugger_, dev->T("Allow remote debugger"));
list->Add(allowDebugger)->OnClick.Handle(this, &DeveloperToolsScreen::OnRemoteDebugger);
allowDebugger->SetEnabledPtr(&canAllowDebugger_);
}
void DeveloperToolsScreen::onFinish(DialogResult result) {
@@ -1371,6 +1378,23 @@ UI::EventReturn DeveloperToolsScreen::OnJitAffectingSetting(UI::EventParams &e)
return UI::EVENT_DONE;
}
UI::EventReturn DeveloperToolsScreen::OnRemoteDebugger(UI::EventParams &e) {
if (allowDebugger_) {
StartWebServer(WebServerFlags::DEBUGGER);
} else {
StopWebServer(WebServerFlags::DEBUGGER);
}
// Persist the setting. Maybe should separate?
g_Config.bRemoteDebuggerOnStartup = allowDebugger_;
return UI::EVENT_CONTINUE;
}
void DeveloperToolsScreen::update() {
UIDialogScreenWithBackground::update();
allowDebugger_ = !WebServerStopped(WebServerFlags::DEBUGGER);
canAllowDebugger_ = !WebServerStopping(WebServerFlags::DEBUGGER);
}
void ProAdhocServerScreen::CreateViews() {
using namespace UI;
I18NCategory *sy = GetI18NCategory("System");
View
@@ -140,20 +140,24 @@ class SettingInfoMessage : public UI::LinearLayout {
class DeveloperToolsScreen : public UIDialogScreenWithBackground {
public:
DeveloperToolsScreen() {}
void update() override;
void onFinish(DialogResult result) override;
protected:
void CreateViews() override;
private:
UI::EventReturn OnBack(UI::EventParams &e);
UI::EventReturn OnRunCPUTests(UI::EventParams &e);
UI::EventReturn OnLoggingChanged(UI::EventParams &e);
UI::EventReturn OnLoadLanguageIni(UI::EventParams &e);
UI::EventReturn OnSaveLanguageIni(UI::EventParams &e);
UI::EventReturn OnOpenTexturesIniFile(UI::EventParams &e);
UI::EventReturn OnLogConfig(UI::EventParams &e);
UI::EventReturn OnJitAffectingSetting(UI::EventParams &e);
UI::EventReturn OnRemoteDebugger(UI::EventParams &e);
bool allowDebugger_ = false;
bool canAllowDebugger_ = true;
};
class ProAdhocServerScreen : public UIDialogScreenWithBackground {

0 comments on commit a2d82cb

Please sign in to comment.