#include "handlers.h"
#include <string.h>
#include <gtk/gtk.h>
#include "frontend.h"
#include "question.h"
#include "fe_gtk.h"
#include "fe_data.h"
#include "ui.h"
Include dependency graph for handlers.c:

Go to the source code of this file.
Functions | |
| static void | set_value_from_toggle_button (struct question *question, GtkToggleButton *toggle_button) |
| Update a boolean question value from the status of a toggle button. | |
| static int | handle_boolean_radio (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| The handler for boolean questions implemented as radio buttons. | |
| static void | handle_false_button (GtkWidget *widget, struct frontend *fe) |
| Handle activation of the "false" button. | |
| static void | handle_true_button (GtkWidget *widget, struct frontend *fe) |
| Handle activation of the "true" button. | |
| static int | handle_boolean_buttons (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| An handler for boolean questions implemented as Yes/No buttons in the action box. | |
| int | fe_gtk_handle_boolean (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| Handler for question of boolean type. | |
| int | fe_gtk_handle_note (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| Handler for "question" of note type. | |
| int | fe_gtk_handle_text (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| Handler for "question" of text type. | |
| static void | set_value_from_entry (struct question *question, GtkEntry *entry) |
| Setter function for handler based on GtkEntry. | |
| static GtkWidget * | create_entry_alignment (GtkWidget *entry) |
| Create a GtkAlignment widget to correctly align entry widget inside the question box. | |
| int | fe_gtk_handle_password (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| Handler for question of password type. | |
| int | fe_gtk_handle_string (struct frontend *fe, struct question *question, GtkWidget *question_box) |
| Handler for question of string type. | |
Definition in file handlers.c.
| static GtkWidget* create_entry_alignment | ( | GtkWidget * | entry | ) | [static] |
Create a GtkAlignment widget to correctly align entry widget inside the question box.
| entry | an entry widget |
Definition at line 279 of file handlers.c.
Referenced by fe_gtk_handle_password(), and fe_gtk_handle_string().
| int fe_gtk_handle_boolean | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) |
Handler for question of boolean type.
This will register the corresponding setter.
| fe | cdebconf frontend | |
| question | handled question | |
| question_box | container for handler's widgets |
Definition at line 221 of file handlers.c.
References handle_boolean_buttons(), handle_boolean_radio(), and IS_QUESTION_SINGLE.
| int fe_gtk_handle_note | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) |
Handler for "question" of note type.
| fe | cdebconf frontend | |
| question | handled question | |
| question_box | container for handler's widgets |
Definition at line 238 of file handlers.c.
References DEFAULT_PADDING, and fe_gtk_add_common_layout().
Referenced by fe_gtk_handle_text().
| int fe_gtk_handle_password | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) |
Handler for question of password type.
| fe | cdebconf frontend | |
| question | handled question | |
| question_box | container for handler's widgets |
Definition at line 298 of file handlers.c.
References create_entry_alignment(), fe_gtk_add_common_layout(), fe_gtk_is_first_question(), fe_gtk_register_setter(), set_value_from_entry(), and SETTER_FUNCTION.
| int fe_gtk_handle_string | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) |
Handler for question of string type.
| fe | cdebconf frontend | |
| question | handled question | |
| question_box | container for handler's widgets |
Definition at line 330 of file handlers.c.
References create_entry_alignment(), fe_gtk_add_common_layout(), fe_gtk_is_first_question(), fe_gtk_register_setter(), set_value_from_entry(), and SETTER_FUNCTION.
| int fe_gtk_handle_text | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) |
Handler for "question" of text type.
This currently just calls fe_gtk_handle_note()
| fe | cdebconf frontend | |
| question | handled question | |
| question_box | container for handler's widgets |
Definition at line 256 of file handlers.c.
References fe_gtk_handle_note().
| static int handle_boolean_buttons | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) | [static] |
An handler for boolean questions implemented as Yes/No buttons in the action box.
This handler will be used when only a single question has been asked.
| fe | cdebconf frontend | |
| question | question being handled | |
| question_box | container for question widgets |
Definition at line 173 of file handlers.c.
References fe_gtk_add_button(), fe_gtk_add_common_layout(), fe_gtk_get_text(), handle_false_button(), and handle_true_button().
Referenced by fe_gtk_handle_boolean().
| static int handle_boolean_radio | ( | struct frontend * | fe, | |
| struct question * | question, | |||
| GtkWidget * | question_box | |||
| ) | [static] |
The handler for boolean questions implemented as radio buttons.
This handler is used when multiple questions are used in a row.
| fe | cdebconf frontend | |
| question | question being handled | |
| question_box | container for question widgets |
Definition at line 77 of file handlers.c.
References DEFAULT_PADDING, fe_gtk_add_common_layout(), fe_gtk_get_text(), fe_gtk_is_first_question(), fe_gtk_register_setter(), set_value_from_toggle_button(), and SETTER_FUNCTION.
Referenced by fe_gtk_handle_boolean().
| static void handle_false_button | ( | GtkWidget * | widget, | |
| struct frontend * | fe | |||
| ) | [static] |
Handle activation of the "false" button.
This will set the value of the corresponding question.
| widget | the activated button | |
| fe | cdebconf frontend |
Definition at line 139 of file handlers.c.
References fe_gtk_set_answer_ok().
Referenced by handle_boolean_buttons().
| static void handle_true_button | ( | GtkWidget * | widget, | |
| struct frontend * | fe | |||
| ) | [static] |
Handle activation of the "true" button.
This will set the value of the corresponding question.
| widget | the activated button | |
| fe | cdebconf frontend |
Definition at line 155 of file handlers.c.
References fe_gtk_set_answer_ok().
Referenced by handle_boolean_buttons().
| static void set_value_from_entry | ( | struct question * | question, | |
| GtkEntry * | entry | |||
| ) | [static] |
Setter function for handler based on GtkEntry.
| question | handled question | |
| entry | entry where the value will be read |
Definition at line 268 of file handlers.c.
Referenced by fe_gtk_handle_password(), and fe_gtk_handle_string().
| static void set_value_from_toggle_button | ( | struct question * | question, | |
| GtkToggleButton * | toggle_button | |||
| ) | [static] |
Update a boolean question value from the status of a toggle button.
| question | question to set | |
| toggle_button | associated toggle button |
Definition at line 59 of file handlers.c.
Referenced by handle_boolean_radio().
1.5.1