text edit: continuing integration [needs fixes]

This commit is contained in:
2026-07-24 19:05:58 +03:00
parent 21bcf119e3
commit da9990e969
5 changed files with 14 additions and 4 deletions
+1
View File
@@ -52,6 +52,7 @@ enum state {
S_ERR,
S_NEXT_ACTION,
S_WAIT_REGISTER_CONFIRMATION,
S_WAIT_USER_DESCRIPTION,
/* Legacy */
WAIT_SERVER_INIT,
WAIT_SERVER,
+3 -4
View File
@@ -140,13 +140,12 @@ void wait_register(query_args_t *q_args) {
int upload_confirm_cb(app_t *app, char *query, int q_len) {
if (!strncmp("finished\n", query, sizeof("finished\n") - 1)) {
/* TODO: DESCRIPTION HERE */
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;
main_window_set(app, mw_f_desc);
/* clear_file_in_query(app->query_args); */
app->query_args->state = S_WAIT_USER_DESCRIPTION;
return 0;
}
return 1; /* TODO: Error case */
+1
View File
@@ -333,6 +333,7 @@ void w_dialogue_destroy(w_dialogue_t *d, void *_app) {
d->win = NULL;
d->is_initiated = false;
d->needs_destroy = false;
d->needs_update = false;
app->active_callback = (w_cb_t)app->main_ui.cb_b_press;
app->query_args->active_dialogue = NULL;
u_d_arr_ptr_free(&(d->id_map));
+3
View File
@@ -10,6 +10,9 @@ void main_window_set(app_t *app, enum main_window_type type) {
if (app->main_ui.ui != NULL) {
main_window_destroy(app);
}
if (app->modal.is_initiated) {
w_dialogue_destroy(&(app->modal), app);
}
app->main_ui.type = type;
switch (type) {
case mw_fl_server:
+6
View File
@@ -13,6 +13,9 @@
#include <unistd.h>
#include <utils.h>
#include <wchar.h>
#include "../server.h"
#include "../file_processor.h"
#include "../windows/main_window.h"
#include "d_array.h"
#include "text_edit.h"
@@ -188,6 +191,9 @@ static int32_t process_user_input(app_t *app, w_cb_args_t *d_args) {
app->query_args->file->description[text_pos] = '\03'; /* ETX symbol */
strncpy(app->query_args->file->description + text_pos, ":END:\n",
sizeof(":END:\n"));
server_send_string(app->query_args, app->query_args->file->description);
clear_file_in_query(app->query_args);
main_window_set(app, mw_fl_server);
/* Save */
break;
case KEY_F(8):