Skip to content
Permalink
Browse files

Android: Add Log Configuration to UI

  • Loading branch information...
Ebola16 committed Aug 21, 2019
1 parent 828dc0f commit 06bdd61c2b9faa96baeb1b3516c190280b4d2770
@@ -18,6 +18,9 @@
public static final String SECTION_INI_CORE = "Core";
public static final String SECTION_INI_INTERFACE = "Interface";

public static final String SECTION_LOGGER_LOGS = "Logs";
public static final String SECTION_LOGGER_OPTIONS = "Options";

public static final String SECTION_GFX_SETTINGS = "Settings";
public static final String SECTION_GFX_ENHANCEMENTS = "Enhancements";
public static final String SECTION_GFX_HACKS = "Hacks";
@@ -46,6 +49,8 @@
configFileSectionsMap.put(SettingsFile.FILE_NAME_GFX,
Arrays.asList(SECTION_GFX_SETTINGS, SECTION_GFX_ENHANCEMENTS, SECTION_GFX_HACKS,
SECTION_STEREOSCOPY));
configFileSectionsMap.put(SettingsFile.FILE_NAME_LOGGER,
Arrays.asList(SECTION_LOGGER_LOGS, SECTION_LOGGER_OPTIONS));
configFileSectionsMap.put(SettingsFile.FILE_NAME_WIIMOTE,
Arrays.asList(SECTION_WIIMOTE + 1, SECTION_WIIMOTE + 2, SECTION_WIIMOTE + 3,
SECTION_WIIMOTE + 4));
@@ -7,6 +7,7 @@
CONFIG_INTERFACE("config_interface"),
CONFIG_GAME_CUBE("config_gamecube"),
CONFIG_WII("config_wii"),
CONFIG_LOG_CONFIGURATION("config_log_configuration"),
WIIMOTE("wiimote"),
WIIMOTE_EXTENSION("wiimote_extension"),
GCPAD_TYPE("gc_pad_type"),
@@ -44,6 +44,7 @@
titles.put(MenuTag.GCPAD_TYPE, R.string.grid_menu_gcpad_settings);
titles.put(MenuTag.GRAPHICS, R.string.grid_menu_graphics_settings);
titles.put(MenuTag.HACKS, R.string.hacks_submenu);
titles.put(MenuTag.CONFIG_LOG_CONFIGURATION, R.string.log_configuration_submenu);
titles.put(MenuTag.DEBUG, R.string.debug_submenu);
titles.put(MenuTag.ENHANCEMENTS, R.string.enhancements_submenu);
titles.put(MenuTag.STEREOSCOPY, R.string.stereoscopy_submenu);
@@ -143,6 +143,10 @@ private void loadSettingsList()
addWiiSettings(sl);
break;

case CONFIG_LOG_CONFIGURATION:
addLogConfigurationSettings(sl);
break;

case GRAPHICS:
addGraphicsSettings(sl);
break;
@@ -205,9 +209,10 @@ private void addConfigSettings(ArrayList<SettingsItem> sl)
{
sl.add(new SubmenuSetting(null, null, R.string.general_submenu, 0, MenuTag.CONFIG_GENERAL));
sl.add(new SubmenuSetting(null, null, R.string.interface_submenu, 0, MenuTag.CONFIG_INTERFACE));

sl.add(new SubmenuSetting(null, null, R.string.gamecube_submenu, 0, MenuTag.CONFIG_GAME_CUBE));
sl.add(new SubmenuSetting(null, null, R.string.wii_submenu, 0, MenuTag.CONFIG_WII));
sl.add(new SubmenuSetting(null, null, R.string.log_configuration_submenu, 0,
MenuTag.CONFIG_LOG_CONFIGURATION));
sl.add(new SubmenuSetting(null, null, R.string.debug_submenu, 0, MenuTag.DEBUG));
sl.add(new HeaderSetting(null, null, R.string.gametdb_thanks, 0));
}
@@ -348,6 +353,223 @@ private void addWiiSettings(ArrayList<SettingsItem> sl)
R.string.wiimote_speaker, R.string.wiimote_speaker_description, true, wiimoteSpeaker));
}

private void addLogConfigurationSettings(ArrayList<SettingsItem> sl)
{
Setting enableLogging = null;
Setting logVerbosity = null;
Setting logTypeActionReplay = null;
Setting logTypeAudio = null;
Setting logTypeAI = null;
Setting logTypeBoot = null;
Setting logTypeCP = null;
Setting logTypeCommon = null;
Setting logTypeConsole = null;
Setting logTypeCore = null;
Setting logTypeDIO = null;
Setting logTypeDSPHLE = null;
Setting logTypeDSPLLE = null;
Setting logTypeDSPMails = null;
Setting logTypeDSP = null;
Setting logTypeDVD = null;
Setting logTypeJIT = null;
Setting logTypeEXI = null;
Setting logTypeFilemon = null;
Setting logTypeGDBStub = null;
Setting logTypeGP = null;
Setting logTypeHLE = null;
Setting logTypeHostGPU = null;
Setting logTypeIOS = null;
Setting logTypeIOSDI = null;
Setting logTypeIOSES = null;
Setting logTypeIOSFS = null;
Setting logTypeIOSNET = null;
Setting logTypeIOSSD = null;
Setting logTypeIOSSSL = null;
Setting logTypeIOSSTM = null;
Setting logTypeIOSUSB = null;
Setting logTypeIOSWC24 = null;
Setting logTypeIOSWFS = null;
Setting logTypeIOSWiimote = null;
Setting logTypeMasterLog = null;
Setting logTypeMemcard = null;
Setting logTypeMI = null;
Setting logTypeNetplay = null;
Setting logTypeOSReport = null;
Setting logTypePad = null;
Setting logTypePE = null;
Setting logTypePI = null;
Setting logTypePowerPC = null;
Setting logTypeSI = null;
Setting logTypeSP1 = null;
Setting logTypeSymbols = null;
Setting logTypeVideo = null;
Setting logTypeVI = null;
Setting logTypeWiiIPC = null;
Setting logTypeWiimote = null;

SettingSection logsSection = mSettings.getSection(Settings.SECTION_LOGGER_LOGS);
SettingSection optionsSection = mSettings.getSection(Settings.SECTION_LOGGER_OPTIONS);
enableLogging = optionsSection.getSetting(SettingsFile.KEY_ENABLE_LOGGING);
logVerbosity = optionsSection.getSetting(SettingsFile.KEY_LOG_VERBOSITY);
logTypeActionReplay = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_ACTION_REPLAY);
logTypeAudio = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_AUDIO);
logTypeAI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_AI);
logTypeBoot = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_BOOT);
logTypeCP = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_CP);
logTypeCommon = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_COMMON);
logTypeConsole = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_CONSOLE);
logTypeCore = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_CORE);
logTypeDIO = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DIO);
logTypeDSPHLE = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DSPHLE);
logTypeDSPLLE = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DSPLLE);
logTypeDSPMails = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DSPMAILS);
logTypeDSP = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DSP);
logTypeDVD = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_DVD);
logTypeJIT = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_JIT);
logTypeEXI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_EXI);
logTypeFilemon = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_FILEMON);
logTypeGDBStub = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_GDBSTUB);
logTypeGP = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_GP);
logTypeHLE = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_HLE);
logTypeHostGPU = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_HOST_GPU);
logTypeIOS = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS);
logTypeIOSDI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_DI);
logTypeIOSES = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_ES);
logTypeIOSFS = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_FS);
logTypeIOSNET = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_NET);
logTypeIOSSD = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_SD);
logTypeIOSSSL = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_SSL);
logTypeIOSSTM = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_STM);
logTypeIOSUSB = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_USB);
logTypeIOSWC24 = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_WC24);
logTypeIOSWFS = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_WFS);
logTypeIOSWiimote = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_IOS_WIIMOTE);
logTypeMasterLog = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_MASTER_LOG);
logTypeMemcard = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_MEMCARD);
logTypeMI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_MI);
logTypeNetplay = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_NETPLAY);
logTypeOSReport = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_OSREPORT);
logTypePad = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_PAD);
logTypePE = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_PE);
logTypePI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_PI);
logTypePowerPC = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_POWERPC);
logTypeSI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_SI);
logTypeSP1 = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_SP1);
logTypeSymbols = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_SYMBOLS);
logTypeVideo = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_VIDEO);
logTypeVI = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_VI);
logTypeWiiIPC = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_WIIIPC);
logTypeWiimote = logsSection.getSetting(SettingsFile.KEY_LOG_TYPE_WIIMOTE);

sl.add(new CheckBoxSetting(SettingsFile.KEY_ENABLE_LOGGING, Settings.SECTION_LOGGER_OPTIONS,
R.string.enable_logging, R.string.enable_logging_description, false, enableLogging));
sl.add(new SingleChoiceSetting(SettingsFile.KEY_LOG_VERBOSITY, Settings.SECTION_LOGGER_OPTIONS,
R.string.log_verbosity, 0, R.array.logVerbosityEntries,
R.array.logVerbosityValues, 0, logVerbosity));

sl.add(new HeaderSetting(null, null, R.string.log_types, 0));
sl.add(
new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_ACTION_REPLAY,
Settings.SECTION_LOGGER_LOGS,
R.string.log_type_action_replay, 0, false, logTypeActionReplay));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_AUDIO, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_audio, 0, false, logTypeAudio));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_AI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_AI, 0, false, logTypeAI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_BOOT, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_boot, 0, false, logTypeBoot));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_CP, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_cp, 0, false, logTypeCP));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_COMMON, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_common, 0, false, logTypeCommon));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_CONSOLE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_console, 0, false, logTypeConsole));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_CORE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_core, 0, false, logTypeCore));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DIO, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dio, 0, false, logTypeDIO));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DSPHLE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dsphle, 0, false, logTypeDSPHLE));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DSPLLE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dsplle, 0, false, logTypeDSPLLE));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DSPMAILS, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dspmails, 0, false, logTypeDSPMails));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DSP, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dsp, 0, false, logTypeDSP));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_DVD, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_dvd, 0, false, logTypeDVD));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_JIT, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_jit, 0, false, logTypeJIT));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_EXI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_exi, 0, false, logTypeEXI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_FILEMON, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_filemon, 0, false, logTypeFilemon));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_GDBSTUB, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_gdb_stub, 0, false, logTypeGDBStub));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_GP, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_gp, 0, false, logTypeGP));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_HLE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_hle, 0, false, logTypeHLE));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_HOST_GPU, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_host_gpu, 0, false, logTypeHostGPU));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios, 0, false, logTypeIOS));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_DI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_di, 0, false, logTypeIOSDI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_ES, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_es, 0, false, logTypeIOSES));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_FS, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_fs, 0, false, logTypeIOSFS));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_NET, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_net, 0, false, logTypeIOSNET));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_SD, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_sd, 0, false, logTypeIOSSD));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_SSL, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_ssl, 0, false, logTypeIOSSSL));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_STM, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_stm, 0, false, logTypeIOSSTM));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_USB, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_usb, 0, false, logTypeIOSUSB));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_WC24, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_wc24, 0, false, logTypeIOSWC24));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_WFS, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_wfs, 0, false, logTypeIOSWFS));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_IOS_WIIMOTE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_ios_wiimote, 0, false, logTypeIOSWiimote));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_MASTER_LOG, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_master_log, 0, false, logTypeMasterLog));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_MEMCARD, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_memcard, 0, false, logTypeMemcard));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_MI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_mi, 0, false, logTypeMI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_NETPLAY, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_netplay, 0, false, logTypeNetplay));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_OSREPORT, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_osreport, 0, false, logTypeOSReport));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_PAD, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_pad, 0, false, logTypePad));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_PE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_pe, 0, false, logTypePE));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_PI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_pi, 0, false, logTypePI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_POWERPC, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_powerpc, 0, false, logTypePowerPC));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_SI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_si, 0, false, logTypeSI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_SP1, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_sp1, 0, false, logTypeSP1));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_SYMBOLS, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_symbols, 0, false, logTypeSymbols));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_VIDEO, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_video, 0, false, logTypeVideo));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_VI, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_vi, 0, false, logTypeVI));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_WIIIPC, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_wii_ipc, 0, false, logTypeWiiIPC));
sl.add(new CheckBoxSetting(SettingsFile.KEY_LOG_TYPE_WIIMOTE, Settings.SECTION_LOGGER_LOGS,
R.string.log_type_wiimote, 0, false, logTypeWiimote));
}

private void addGcPadSettings(ArrayList<SettingsItem> sl)
{
for (int i = 0; i < 4; i++)
@@ -42,6 +42,10 @@ public void bind(SettingsItem item)
{
mTextSettingDescription.setText(item.getDescriptionId());
}
else
{
mTextSettingDescription.setText("");
}

mCheckbox.setChecked(mItem.isChecked());
}

0 comments on commit 06bdd61

Please sign in to comment.
You can’t perform that action at this time.