ui: alert; anonymous login; registration (not finished)

This commit is contained in:
2026-02-18 18:39:47 +02:00
parent f9fc9e0167
commit e2750799c5
15 changed files with 188 additions and 7 deletions
+12
View File
@@ -1,7 +1,9 @@
#include <ncurses.h>
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <widget.h>
typedef struct {
@@ -22,11 +24,21 @@ void login_modal_option_cb(callback_args_t *args) {
if (response > -1) {
switch (response) {
case 0:
d->needs_destroy = true;
app->params->uname = malloc(sizeof "anonymous");
strcpy(app->params->uname, "anonymous");
write(app->params->sd, app->params->uname, sizeof "anonymous"-1);
app->query_args->state = S_WAIT_SERVER;
print_bars(app);
break;
case 1:
d->needs_destroy = true;
app->query_args->state = S_ASK_LOGIN_USER;
break;
case 2:
d->needs_destroy = true;
app->query_args->state = S_ASK_REGISTER;
break;
}
}
}