ui: refactoring. changes active id mechanism
This commit is contained in:
+1
-1
@@ -33,7 +33,7 @@ void notification(const char *title, const char *message,
|
||||
|
||||
d->w.callback = alert_cb;
|
||||
d->g_content = NULL;
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions,&(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions,&(d->id_map), horizontal, g_action);
|
||||
|
||||
dialogue_init_active_id(d);
|
||||
d->color_scheme = color;
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <widget.h>
|
||||
#include "../connection.h"
|
||||
#include "group.h"
|
||||
|
||||
typedef struct {
|
||||
button_t *element;
|
||||
@@ -60,8 +61,8 @@ dialogue_t *init_asa_modal(app_t *app) {
|
||||
dialogue_t *d = &(app->modal);
|
||||
|
||||
d->w.callback = asa_modal_dialogue_callback;
|
||||
d->g_content = init_group(&(d->win), &(d->w), content,&(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions,&(d->id_map), horizontal);
|
||||
d->g_content = init_group(&(d->win), &(d->w), content,&(d->id_map), horizontal, g_content);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions,&(d->id_map), horizontal, g_action);
|
||||
|
||||
dialogue_init_active_id(d);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <widget.h>
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
@@ -24,8 +25,8 @@ dialogue_t *init_dwn_pr_modal(app_t *app, bool is_upload) {
|
||||
dialogue_t *d = &(app->modal);
|
||||
|
||||
d->w.callback = dwn_pr_modal_cb;
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal, g_content);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
app->query_args->progress_bar = d->g_content->elements[0].element;
|
||||
app->query_args->active_dialogue = d;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@@ -65,8 +66,8 @@ dialogue_t *init_login_credentials_modal(app_t *app) {
|
||||
dialogue_t *d = &(app->modal);
|
||||
|
||||
d->w.callback = init_login_credentials_modal_cb;
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal, g_content);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
dialogue_init_active_id(d);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@@ -56,7 +57,7 @@ dialogue_t *init_login_option_modal(app_t *app) {
|
||||
"option",
|
||||
&(app->coordinates));
|
||||
app->modal.g_action = init_group(&(app->modal.win), &(app->modal.w), children,
|
||||
&(app->modal.id_map), horizontal);
|
||||
&(app->modal.id_map), horizontal, g_action);
|
||||
app->modal.w.callback = login_modal_option_cb;
|
||||
dialogue_init_active_id(&(app->modal));
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@@ -43,7 +44,7 @@ dialogue_t *init_notification_modal(app_t *app) {
|
||||
|
||||
d->w.callback = init_notification_modal_cb;
|
||||
d->g_content = NULL;
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
dialogue_init_active_id(d);
|
||||
|
||||
|
||||
@@ -94,9 +94,9 @@ dialogue_t *init_register_modal(app_t *app) {
|
||||
|
||||
d->w.callback = init_register_modal_cb;
|
||||
d->g_content =
|
||||
init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal);
|
||||
init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal, g_content);
|
||||
d->g_action =
|
||||
init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
dialogue_init_active_id(d);
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
@@ -44,7 +45,7 @@ void *init_server_message_modal(app_t *app) {
|
||||
init_dialogue(&(app->modal), "Server response",
|
||||
app->query_args->server_message.text, &(app->coordinates));
|
||||
app->modal.g_action =
|
||||
init_group(&(app->modal.win), &(app->modal.w), children, &(app->modal.id_map), horizontal);
|
||||
init_group(&(app->modal.win), &(app->modal.w), children, &(app->modal.id_map), horizontal, g_action);
|
||||
app->modal.w.callback = server_message_modal_cb;
|
||||
dialogue_init_active_id(&(app->modal));
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "../file_processor.h"
|
||||
#include "group.h"
|
||||
#include <widget.h>
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
@@ -49,8 +50,8 @@ dialogue_t *init_upload_dialogue_modal(app_t *app) {
|
||||
dialogue_t *d = &(app->modal);
|
||||
|
||||
d->w.callback = upload_dialogue_modal_cb;
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal, g_content);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
app->query_args->active_dialogue = d;
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "group.h"
|
||||
#include <widget.h>
|
||||
#include <ncurses.h>
|
||||
#include <stdint.h>
|
||||
@@ -64,8 +65,8 @@ dialogue_t *init_upload_props_dialogue_modal(app_t *app) {
|
||||
dialogue_t *d = &(app->modal);
|
||||
|
||||
d->w.callback = upload_props_dialogue_modal_cb;
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal);
|
||||
d->g_content = init_group(&(d->win), &(d->w), content, &(d->id_map), horizontal, g_content);
|
||||
d->g_action = init_group(&(d->win), &(d->w), actions, &(d->id_map), horizontal, g_action);
|
||||
|
||||
app->query_args->active_dialogue = d;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user