Merge pull request #3050 from thedax/newUIBugFix

Win32/NewUI: Address debug log bug and placement in menu.
This commit is contained in:
Henrik Rydgård committed 2013-08-04 02:07:16 -07:00
commit 53336e55ad
3 files changed
+23 -3

No files matched your search

+17 -1
View File
@@ -33,6 +33,13 @@
#include "base/timeutil.h"
#include "math/curves.h"
#ifdef _WIN32
namespace MainWindow {
enum { WM_USER_LOG_STATUS_CHANGED = WM_USER + 200 };
extern HWND hwndMain;
}
#endif
namespace UI {
@@ -325,7 +332,6 @@ void GlobalSettingsScreen::CreateViews() {
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
list->Add(new ItemHeader("General"));
list->Add(new CheckBox(&g_Config.bNewUI, gs->T("Enable New UI")));
list->Add(new CheckBox(&g_Config.bEnableLogging, gs->T("Enable Debug Logging")));
list->Add(new CheckBox(&enableReports_, gs->T("Enable Errors Reporting")));
list->Add(new CheckBox(&g_Config.bEnableCheats, gs->T("Enable Cheats")));
list->Add(new CheckBox(&g_Config.bScreenshotsAsPNG, gs->T("Screenshots as PNG")));
@@ -365,6 +371,8 @@ void DeveloperToolsScreen::CreateViews() {
using namespace UI;
root_ = new ScrollView(ORIENT_VERTICAL);
enableLogging_ = g_Config.bEnableLogging;
I18NCategory *g = GetI18NCategory("General");
I18NCategory *d = GetI18NCategory("Developer");
I18NCategory *a = GetI18NCategory("Audio");
@@ -372,11 +380,19 @@ void DeveloperToolsScreen::CreateViews() {
LinearLayout *list = root_->Add(new LinearLayout(ORIENT_VERTICAL, new LinearLayoutParams(1.0f)));
list->Add(new ItemHeader(g->T("General")));
list->Add(new Choice(d->T("Run CPU Tests")))->OnClick.Handle(this, &DeveloperToolsScreen::OnRunCPUTests);
list->Add(new CheckBox(&enableLogging_, d->T("Enable Debug Logging")));
list->Add(new Choice(g->T("Back")))->OnClick.Handle(this, &DeveloperToolsScreen::OnBack);
}
UI::EventReturn DeveloperToolsScreen::OnBack(UI::EventParams &e) {
screenManager()->finishDialog(this, DR_OK);
g_Config.bEnableLogging = enableLogging_;
#ifdef _WIN32
PostMessage(MainWindow::hwndMain, MainWindow::WM_USER_LOG_STATUS_CHANGED, 0, 0);
#endif
g_Config.Save();
return UI::EVENT_DONE;
}
+3
View File
@@ -76,4 +76,7 @@ protected:
private:
UI::EventReturn OnBack(UI::EventParams &e);
UI::EventReturn OnRunCPUTests(UI::EventParams &e);
// Temporary variable.
bool enableLogging_;
};
+3 -2
View File
@@ -1146,9 +1146,10 @@ namespace MainWindow
if(!g_Config.bEnableLogging) {
LogManager::GetInstance()->GetConsoleListener()->Show(false);
EnableMenuItem(menu, ID_DEBUG_LOG, MF_GRAYED);
}
else
} else {
LogManager::GetInstance()->GetConsoleListener()->Show(true);
EnableMenuItem(menu, ID_DEBUG_LOG, MF_ENABLED);
}
break;
case WM_MENUSELECT: