Skip to content

Commit

Permalink
Rename enum. (part 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysticial committed Oct 2, 2023
1 parent a834af1 commit d75dbd6
Show file tree
Hide file tree
Showing 210 changed files with 683 additions and 683 deletions.
4 changes: 2 additions & 2 deletions Common/Cpp/Options/ConfigOption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@ ConfigOption::ConfigOption(const ConfigOption& x)
{}

ConfigOption::ConfigOption()
: m_data(CONSTRUCT_TOKEN, LockWhileRunning::LOCKED, ConfigOptionState::ENABLED)
: m_data(CONSTRUCT_TOKEN, LockWhileRunning::LOCK_WHILE_RUNNING, ConfigOptionState::ENABLED)
{}
ConfigOption::ConfigOption(LockWhileRunning lock_mode)
: m_data(CONSTRUCT_TOKEN, lock_mode, ConfigOptionState::ENABLED)
{}
ConfigOption::ConfigOption(ConfigOptionState visibility)
: m_data(CONSTRUCT_TOKEN, LockWhileRunning::LOCKED, visibility)
: m_data(CONSTRUCT_TOKEN, LockWhileRunning::LOCK_WHILE_RUNNING, visibility)
{}

void ConfigOption::add_listener(Listener& listener){
Expand Down
2 changes: 1 addition & 1 deletion Common/Cpp/Options/ConfigOption.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ConfigWidget;

enum class LockWhileRunning{
UNLOCKED,
LOCKED,
LOCK_WHILE_RUNNING,
READ_ONLY,
};
enum class ConfigOptionState{
Expand Down
10 changes: 5 additions & 5 deletions Common/PokemonSwSh/PokemonSwSh_FossilTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ class FossilGame : public EditableTableRow{

public:
FossilGame()
: game_slot(GameSlot_Database(), LockWhileRunning::LOCKED, 1)
, user_slot(UserSlot_Database(), LockWhileRunning::LOCKED, 1)
, fossil(Fossil_Database(), LockWhileRunning::LOCKED, Fossil::Dracovish)
, revives(LockWhileRunning::LOCKED, 960, 0, 965)
: game_slot(GameSlot_Database(), LockWhileRunning::LOCK_WHILE_RUNNING, 1)
, user_slot(UserSlot_Database(), LockWhileRunning::LOCK_WHILE_RUNNING, 1)
, fossil(Fossil_Database(), LockWhileRunning::LOCK_WHILE_RUNNING, Fossil::Dracovish)
, revives(LockWhileRunning::LOCK_WHILE_RUNNING, 960, 0, 965)
{
PA_ADD_OPTION(game_slot);
PA_ADD_OPTION(user_slot);
Expand Down Expand Up @@ -79,7 +79,7 @@ class FossilTable : public EditableTableOption_t<FossilGame>{
FossilTable()
: EditableTableOption_t<FossilGame>(
"<b>Game List:</b>",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
make_defaults()
)
{}
Expand Down
22 changes: 11 additions & 11 deletions Common/PokemonSwSh/PokemonSwSh_MultiHostTable.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ class MultiHostSlot : public EditableTableRow{
public:
MultiHostSlot(bool raid_code_option)
: m_raid_code_option(raid_code_option)
, game_slot(GameSlot_Database(), LockWhileRunning::LOCKED, 1)
, user_slot(UserSlot_Database(), LockWhileRunning::LOCKED, 1)
, skips(LockWhileRunning::LOCKED, 3, 0, 7)
, backup_save(LockWhileRunning::LOCKED, false)
, always_catchable(LockWhileRunning::LOCKED, true)
, use_raid_code(LockWhileRunning::LOCKED, true)
, accept_FRs(LockWhileRunning::LOCKED, true)
, move_slot(LockWhileRunning::LOCKED, 0, 0, 4)
, dynamax(LockWhileRunning::LOCKED, true)
, post_raid_delay(LockWhileRunning::LOCKED, TICKS_PER_SECOND, "0 * TICKS_PER_SECOND")
, game_slot(GameSlot_Database(), LockWhileRunning::LOCK_WHILE_RUNNING, 1)
, user_slot(UserSlot_Database(), LockWhileRunning::LOCK_WHILE_RUNNING, 1)
, skips(LockWhileRunning::LOCK_WHILE_RUNNING, 3, 0, 7)
, backup_save(LockWhileRunning::LOCK_WHILE_RUNNING, false)
, always_catchable(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, use_raid_code(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, accept_FRs(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, move_slot(LockWhileRunning::LOCK_WHILE_RUNNING, 0, 0, 4)
, dynamax(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, post_raid_delay(LockWhileRunning::LOCK_WHILE_RUNNING, TICKS_PER_SECOND, "0 * TICKS_PER_SECOND")
{
PA_ADD_OPTION(game_slot);
PA_ADD_OPTION(user_slot);
Expand Down Expand Up @@ -86,7 +86,7 @@ class MultiHostSlot : public EditableTableRow{
class MultiHostTable : public EditableTableOption{
public:
MultiHostTable(bool raid_code_option)
: EditableTableOption("<b>Game List:</b>", LockWhileRunning::LOCKED)
: EditableTableOption("<b>Game List:</b>", LockWhileRunning::LOCK_WHILE_RUNNING)
, m_raid_code_option(raid_code_option)
{}
std::vector<std::unique_ptr<MultiHostSlot>> copy_snapshot() const{
Expand Down
2 changes: 1 addition & 1 deletion Common/Qt/Options/ConfigWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ConfigWidget::update_visibility(){
// cout << "ConfigWidget::update_visibility(): " << (int)m_value.visibility() << endl;
switch (m_value.visibility()){
case ConfigOptionState::ENABLED:
m_widget->setEnabled(m_value.lock_mode() != LockWhileRunning::LOCKED || !m_program_is_running);
m_widget->setEnabled(m_value.lock_mode() != LockWhileRunning::LOCK_WHILE_RUNNING || !m_program_is_running);
m_widget->setVisible(true);
break;
case ConfigOptionState::DISABLED:
Expand Down
16 changes: 8 additions & 8 deletions SerialPrograms/Source/CommonFramework/GlobalSettingsPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ ResolutionOption::ResolutionOption(
std::string label, std::string description,
int default_width, int default_height
)
: GroupOption(std::move(label), LockWhileRunning::LOCKED)
: GroupOption(std::move(label), LockWhileRunning::LOCK_WHILE_RUNNING)
, DESCRIPTION(std::move(description))
, WIDTH("<b>Width:</b>", LockWhileRunning::LOCKED, scale_dpi_width(default_width))
, HEIGHT("<b>Height:</b>", LockWhileRunning::LOCKED, scale_dpi_height(default_height))
, WIDTH("<b>Width:</b>", LockWhileRunning::LOCK_WHILE_RUNNING, scale_dpi_width(default_width))
, HEIGHT("<b>Height:</b>", LockWhileRunning::LOCK_WHILE_RUNNING, scale_dpi_height(default_height))
{
PA_ADD_STATIC(DESCRIPTION);
PA_ADD_OPTION(WIDTH);
Expand Down Expand Up @@ -98,17 +98,17 @@ GlobalSettings::~GlobalSettings(){
ENABLE_LIFETIME_SANITIZER.remove_listener(*this);
}
GlobalSettings::GlobalSettings()
: BatchOption(LockWhileRunning::LOCKED)
: BatchOption(LockWhileRunning::LOCK_WHILE_RUNNING)
, SEND_ERROR_REPORTS(
"<b>Send Error Reports:</b><br>"
"Send error reports to the " + PROGRAM_NAME + " server to help them resolve issues and improve the program.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
IS_BETA_VERSION
)
, STATS_FILE(
false,
"<b>Stats File:</b><br>Use the stats file here. Multiple instances of the program can use the same file.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"UserSettings/PA-Stats.txt",
"UserSettings/PA-Stats.txt"
)
Expand Down Expand Up @@ -146,7 +146,7 @@ GlobalSettings::GlobalSettings()
, SAVE_DEBUG_IMAGES(
"<b>Save Debug Images:</b><br>"
"If the program fails to read something when it should succeed, save the image for debugging purposes.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
true
)
// , NAUGHTY_MODE_OPTION("<b>Naughty Mode:</b>", false)
Expand Down Expand Up @@ -219,7 +219,7 @@ GlobalSettings::GlobalSettings()
, DEVELOPER_TOKEN(
true,
"<b>Developer Token:</b><br>Restart application to take full effect after changing this.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", ""
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ThreadPriorityOption : public EnumDropdownOption<ThreadPriority>{
: EnumDropdownOption<ThreadPriority>(
std::move(label),
PRIORITY_DATABASE(),
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
default_priority
)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ ProcessorLevelOption::ProcessorLevelOption()
"<b>Processor Specific Optimization:</b><br>"
"Note that this only applies to this binary. External dependencies may ignore this and use higher instructions anyway.",
CAPABILITIES_DATABASE(),
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
get_default_ProcessorLevel_index()
)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ ThemeSelectorOption::ThemeSelectorOption()
{0, "default", "Default"},
{1, "dark", "Dark Mode"},
},
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
0
)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace PokemonAutomation{
class StringSelectTableRow : public EditableTableRow{
public:
StringSelectTableRow(const StringSelectDatabase& database, const std::string& default_slug)
: cell(database, LockWhileRunning::LOCKED, default_slug)
: cell(database, LockWhileRunning::LOCK_WHILE_RUNNING, default_slug)
{
PA_ADD_OPTION(cell);
}
Expand All @@ -39,7 +39,7 @@ class StringSelectTableOption : public EditableTableOption{
std::string label,
std::string header, const StringSelectDatabase& database, std::string default_slug
)
: EditableTableOption(std::move(label), LockWhileRunning::LOCKED)
: EditableTableOption(std::move(label), LockWhileRunning::LOCK_WHILE_RUNNING)
, m_header(std::move(header))
, m_database(database)
, m_default_slug(std::move(default_slug))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TrainOCRModeOption : public EnumDropdownOption<TrainOCRMode>{
{TrainOCRMode::START_FRESH, "start-fresh", "Start Fresh: Use only baseline strings. (1st candidate of each entry in above path)"},
{TrainOCRMode::INCREMENTAL, "incremental", "Incremental: Build off of the existing training data in the above path."},
},
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
TrainOCRMode::GENERATE_BASELINE
)
{}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace PokemonAutomation{

SettingsPanelInstance::SettingsPanelInstance(const PanelDescriptor& descriptor)
: PanelInstance(descriptor)
, m_options(LockWhileRunning::LOCKED)
, m_options(LockWhileRunning::LOCK_WHILE_RUNNING)
{}

void SettingsPanelInstance::from_json(const JsonValue& json){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ VideoBackendOption::VideoBackendOption()
: IntegerEnumDropdownOption(
"<b>Video Pipeline Backend:</b>",
CameraBackends::instance().m_database,
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
#if QT_VERSION_MAJOR == 5
0
#elif QT_VERSION_MAJOR == 6
Expand Down
2 changes: 1 addition & 1 deletion SerialPrograms/Source/ComputerPrograms/ComputerProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ std::unique_ptr<PanelInstance> ComputerProgramDescriptor::make_panel() const{


ComputerProgramInstance::ComputerProgramInstance()
: m_options(LockWhileRunning::LOCKED)
: m_options(LockWhileRunning::LOCK_WHILE_RUNNING)
, NOTIFICATION_PROGRAM_FINISH(
"Program Finished",
true, true,
Expand Down
22 changes: 11 additions & 11 deletions SerialPrograms/Source/Integrations/DiscordIntegrationSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ DiscordIntegrationSettingsOption::~DiscordIntegrationSettingsOption(){
this->remove_listener(*this);
}
DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
: GroupOption("Discord Integration Settings", LockWhileRunning::LOCKED, true, false)
: GroupOption("Discord Integration Settings", LockWhileRunning::LOCK_WHILE_RUNNING, true, false)
// , m_integration_enabled(integration_enabled)
, run_on_start(
"<b>Run Discord Integration on Launch:</b><br>Automatically connect to Discord as soon as the program is launched.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
false
)
, library0(
Expand All @@ -41,7 +41,7 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
{Library::SleepyDiscord, "sleepy", "Sleepy Discord (normal commands, deprecated)"},
{Library::DPP, "dpp", "D++ (slash commands and normal commands)"},
},
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
Library::DPP
)
, command_type(
Expand All @@ -50,48 +50,48 @@ DiscordIntegrationSettingsOption::DiscordIntegrationSettingsOption()
{CommandType::SlashCommands, "slash", "Slash commands"},
{CommandType::MessageCommands, "message", "Message (prefix) commands"},
},
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
CommandType::SlashCommands
)
, token(
true,
"<b>Discord Token:</b><br>Enter your Discord bot's token. Keep it safe and don't share it with anyone.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", "0123456789abcdefghijklmnopqrstuvwxyzABCDEGFHIJKLMNOPQRSTUVWXYZ"
)
, command_prefix(
false,
"<b>Discord Command Prefix:</b><br>Enter a command prefix for your bot.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"^", "^"
)
, use_suffix(
"<b>Use Suffix (Sleepy):</b><br>Use a suffix instead of a prefix for commands.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
false
)
, game_status(
false,
"<b>Discord Game Status:</b><br>Enter a status message your bot would display.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", "Controlling your Switch. :)"
)
, hello_message(
false,
"<b>Discord Hello Message:</b><br>Enter a message you'd like the bot to respond with to the \"$hi\" command.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", "Automation at your service!"
)
, sudo(
false,
"<b>Discord Sudo (Sleepy):</b><br>Enter user ID(s) to grant sudo access to.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", "123456789012345678"
)
, owner(
false,
"<b>Discord Owner (Sleepy):</b><br>Enter the bot owner's ID (your own ID).",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"", "123456789012345678"
)
{
Expand Down
10 changes: 5 additions & 5 deletions SerialPrograms/Source/Integrations/DiscordSettingsOption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,25 @@ namespace Integration{


DiscordMessageSettingsOption::DiscordMessageSettingsOption()
: BatchOption(LockWhileRunning::LOCKED)
: BatchOption(LockWhileRunning::LOCK_WHILE_RUNNING)
, instance_name(
false,
"<b>Instance Name:</b><br>If you are running multiple instances of this program, give it a name to distinguish them in notifications.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"",
"(e.g. Living Room Switch)"
)
, user_id(
false,
"<b>Discord User ID:</b><br>Set this to your discord user ID to receive pings. Your ID is a number.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"",
"123456789012345678"
)
, message(
false,
"<b>Discord Message:</b><br>Message to put on every discord notification.",
LockWhileRunning::LOCKED,
LockWhileRunning::LOCK_WHILE_RUNNING,
"",
"(e.g. Kim's Shiny Hunt)"
)
Expand Down Expand Up @@ -66,7 +66,7 @@ ConfigWidget* DiscordMessageSettingsOption::make_QtWidget(QWidget& parent){


DiscordSettingsOption::DiscordSettingsOption()
: BatchOption(LockWhileRunning::LOCKED)
: BatchOption(LockWhileRunning::LOCK_WHILE_RUNNING)
{
PA_ADD_OPTION(message);
PA_ADD_OPTION(webhooks);
Expand Down
18 changes: 9 additions & 9 deletions SerialPrograms/Source/Integrations/DiscordWebhookSettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ namespace Integration{


DiscordWebhookUrl::DiscordWebhookUrl()
: enabled(LockWhileRunning::LOCKED, true)
, label(false, LockWhileRunning::LOCKED, "", "My test server")
, ping(LockWhileRunning::LOCKED, true)
, tags_text(false, LockWhileRunning::LOCKED, "Notifs, Showcase, LiveHost", "")
, delay(LockWhileRunning::LOCKED, 0, 0, 10)
, url(true, LockWhileRunning::LOCKED, "", "https://discord.com/api/webhooks/123456789012345678/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
: enabled(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, label(false, LockWhileRunning::LOCK_WHILE_RUNNING, "", "My test server")
, ping(LockWhileRunning::LOCK_WHILE_RUNNING, true)
, tags_text(false, LockWhileRunning::LOCK_WHILE_RUNNING, "Notifs, Showcase, LiveHost", "")
, delay(LockWhileRunning::LOCK_WHILE_RUNNING, 0, 0, 10)
, url(true, LockWhileRunning::LOCK_WHILE_RUNNING, "", "https://discord.com/api/webhooks/123456789012345678/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
{
// Keep the old JSON tags for backwards compatibility.
add_option(enabled, "Enabled");
Expand Down Expand Up @@ -74,7 +74,7 @@ void DiscordWebhookUrl::load_json(const JsonValue& json){
DiscordWebhookSettingsTable::DiscordWebhookSettingsTable()
: EditableTableOption_t<DiscordWebhookUrl>(
"<b>Discord Webhook URLs:</b> Notifications are sent to all enabled URLs that share a tag with the event.",
LockWhileRunning::LOCKED
LockWhileRunning::LOCK_WHILE_RUNNING
)
{}
std::vector<std::string> DiscordWebhookSettingsTable::make_header() const{
Expand All @@ -92,10 +92,10 @@ std::vector<std::string> DiscordWebhookSettingsTable::make_header() const{


DiscordWebhookSettingsOption::DiscordWebhookSettingsOption()
: GroupOption("Discord Webhook Settings", LockWhileRunning::LOCKED, true, false)
: GroupOption("Discord Webhook Settings", LockWhileRunning::LOCK_WHILE_RUNNING, true, false)
, sends_per_second(
"<b>Rate Limit:</b><br>Maximum number of sends per second.",
LockWhileRunning::LOCKED, 2
LockWhileRunning::LOCK_WHILE_RUNNING, 2
)
{
PA_ADD_OPTION(urls);
Expand Down
Loading

0 comments on commit d75dbd6

Please sign in to comment.