UI: finishes callback processing in main_window, key input callbacks and draw bottom bar

This commit is contained in:
2026-04-20 15:23:12 +03:00
parent 173bd3000d
commit ee2bccc5c8
15 changed files with 115 additions and 62 deletions
+13 -6
View File
@@ -39,9 +39,9 @@ int32_t process_user_input(w_app_t *app, w_cb_args_t *d_args);
#define EXIT_APP(message, app, exit_code) \
{ \
w_alert(message); \
w_alert(message); \
close_session(app->params->sd); \
w_app_destroy(app, exit_code); \
w_app_destroy(app, exit_code); \
}
void query_loop(w_app_t *app) {
@@ -112,8 +112,14 @@ void query_loop(w_app_t *app) {
}
if (FD_ISSET(STDIN_FILENO, &readfds)) {
if (ERR == process_user_input(app, &d_args)) {
EXIT_APP("*** error while processing user input ***", app, 4)
if (app->main_ui.cb_b_press != NULL) {
if (ERR == app->main_ui.cb_b_press(app, &d_args)) {
EXIT_APP("*** error while processing user input ***", app, 4)
}
} else {
if (ERR == process_user_input(app, &d_args)) {
EXIT_APP("*** error while processing user input ***", app, 4)
}
}
}
}
@@ -131,8 +137,9 @@ void wait_register(query_args_t *q_args) {
int upload_confirm_cb(w_app_t *app, char *query, int q_len) {
if (!strncmp("finished\n", query, sizeof("finished\n") - 1)) {
w_ui_file_list_t *fui = (w_ui_file_list_t *)app->query_args->main_ui->ui;
w_notification("File upload", dc_normal, "File %s is uploaded to the server!",
app->query_args->file->name);
w_notification("File upload", dc_normal,
"File %s is uploaded to the server!",
app->query_args->file->name);
clear_file_in_query(app->query_args);
app->query_args->state = S_FILE_LIST;
app->modal.needs_destroy = true;