Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix text for execution button #28

Merged
merged 3 commits into from
Apr 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/changelog.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
- Fixed a bug that the execution button still says "processing" after getting errors.

ver 0.6.3
- Supported Unix-like systems (FreeBSD, Haiku, etc).
- Added URL validation for safety.
Expand Down
2 changes: 1 addition & 1 deletion license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 matyalatte
Copyright (c) 2022-2024 matyalatte

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ if tuw_OS == 'windows'
tuw_link_args = [
'/LARGEADDRESSAWARE',
'/INCREMENTAL:NO',
'/MANIFEST:NO',
'/ENTRY:wmainCRTStartup'
]
if meson.version().version_compare('<1.4.0')
tuw_link_args += ['/MANIFEST:NO']
endif

if (get_option('optimization') == 's')
tuw_cpp_args += ['/Os']
Expand Down
18 changes: 8 additions & 10 deletions src/main_frame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,6 @@ std::string MainFrame::GetCommand() {
}

void MainFrame::RunCommand() {
char* text = uiButtonText(m_run_button);
uiButtonSetText(m_run_button, "Processing...");
#ifdef __APPLE__
uiMainStep(1);
#elif defined(__TUW_UNIX__)
uiUnixWaitEvents();
#endif

std::string cmd = GetCommand();
PrintFmt("[RunCommand] Command: %s\n", cmd.c_str());

Expand All @@ -402,7 +394,15 @@ void MainFrame::RunCommand() {
"Command: " + cmd;
ShowSuccessDialog(msg, "Safe Mode");
} else {
char* text = uiButtonText(m_run_button);
uiButtonSetText(m_run_button, "Processing...");
#ifdef __APPLE__
uiMainStep(1);
#elif defined(__TUW_UNIX__)
uiUnixWaitEvents();
#endif
ExecuteResult result = Execute(cmd);
uiButtonSetText(m_run_button, text);

rapidjson::Value& sub_definition = m_definition["gui"][m_definition_id];
bool check_exit_code = json_utils::GetBool(sub_definition, "check_exit_code", false);
Expand Down Expand Up @@ -432,8 +432,6 @@ void MainFrame::RunCommand() {
ShowSuccessDialog("Success!");
}
}

uiButtonSetText(m_run_button, text);
}

// read gui_definition.json
Expand Down
Loading