Rename appointment/event-related UI functions
* Rename "interaction.c" to "ui-day.c" since it no longer contains todo-related UI functions. * Rename appointment/event-related UI functions to ui_day_*(). Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
267bf0fc1c
commit
c7f3888607
@ -21,7 +21,6 @@ calcurse_SOURCES = \
|
|||||||
getstring.c \
|
getstring.c \
|
||||||
help.c \
|
help.c \
|
||||||
ical.c \
|
ical.c \
|
||||||
interaction.c \
|
|
||||||
io.c \
|
io.c \
|
||||||
keys.c \
|
keys.c \
|
||||||
llist.c \
|
llist.c \
|
||||||
@ -32,6 +31,7 @@ calcurse_SOURCES = \
|
|||||||
sha1.c \
|
sha1.c \
|
||||||
sigs.c \
|
sigs.c \
|
||||||
todo.c \
|
todo.c \
|
||||||
|
ui-day.c \
|
||||||
ui-todo.c \
|
ui-todo.c \
|
||||||
utf8.c \
|
utf8.c \
|
||||||
utils.c \
|
utils.c \
|
||||||
|
@ -126,7 +126,7 @@ static inline void key_generic_config_menu(void)
|
|||||||
|
|
||||||
static inline void key_generic_add_appt(void)
|
static inline void key_generic_add_appt(void)
|
||||||
{
|
{
|
||||||
interact_day_item_add();
|
ui_day_item_add();
|
||||||
inday = do_storage(1);
|
inday = do_storage(1);
|
||||||
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
||||||
}
|
}
|
||||||
@ -143,7 +143,7 @@ static inline void key_add_item(void)
|
|||||||
{
|
{
|
||||||
switch (wins_slctd()) {
|
switch (wins_slctd()) {
|
||||||
case APP:
|
case APP:
|
||||||
interact_day_item_add();
|
ui_day_item_add();
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
||||||
break;
|
break;
|
||||||
@ -161,7 +161,7 @@ static inline void key_add_item(void)
|
|||||||
static inline void key_edit_item(void)
|
static inline void key_edit_item(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
||||||
interact_day_item_edit();
|
ui_day_item_edit();
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
||||||
} else if (wins_slctd() == TOD && todo_hilt() != 0) {
|
} else if (wins_slctd() == TOD && todo_hilt() != 0) {
|
||||||
@ -173,7 +173,7 @@ static inline void key_edit_item(void)
|
|||||||
static inline void key_del_item(void)
|
static inline void key_del_item(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
||||||
interact_day_item_delete(&inday.nb_events, &inday.nb_apoints, reg);
|
ui_day_item_delete(&inday.nb_events, &inday.nb_apoints, reg);
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
||||||
} else if (wins_slctd() == TOD && todo_hilt() != 0) {
|
} else if (wins_slctd() == TOD && todo_hilt() != 0) {
|
||||||
@ -185,7 +185,7 @@ static inline void key_del_item(void)
|
|||||||
static inline void key_generic_copy(void)
|
static inline void key_generic_copy(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
if (wins_slctd() == APP && apoint_hilt() != 0) {
|
||||||
interact_day_item_copy(&inday.nb_events, &inday.nb_apoints, reg);
|
ui_day_item_copy(&inday.nb_events, &inday.nb_apoints, reg);
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP);
|
wins_update(FLAG_CAL | FLAG_APP);
|
||||||
}
|
}
|
||||||
@ -194,7 +194,7 @@ static inline void key_generic_copy(void)
|
|||||||
static inline void key_generic_paste(void)
|
static inline void key_generic_paste(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP) {
|
if (wins_slctd() == APP) {
|
||||||
interact_day_item_paste(&inday.nb_events, &inday.nb_apoints, reg);
|
ui_day_item_paste(&inday.nb_events, &inday.nb_apoints, reg);
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP);
|
wins_update(FLAG_CAL | FLAG_APP);
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ static inline void key_generic_paste(void)
|
|||||||
static inline void key_repeat_item(void)
|
static inline void key_repeat_item(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0)
|
if (wins_slctd() == APP && apoint_hilt() != 0)
|
||||||
interact_day_item_repeat();
|
ui_day_item_repeat();
|
||||||
inday = do_storage(0);
|
inday = do_storage(0);
|
||||||
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
wins_update(FLAG_CAL | FLAG_APP | FLAG_STA);
|
||||||
}
|
}
|
||||||
@ -223,7 +223,7 @@ static inline void key_flag_item(void)
|
|||||||
static inline void key_pipe_item(void)
|
static inline void key_pipe_item(void)
|
||||||
{
|
{
|
||||||
if (wins_slctd() == APP && apoint_hilt() != 0)
|
if (wins_slctd() == APP && apoint_hilt() != 0)
|
||||||
interact_day_item_pipe();
|
ui_day_item_pipe();
|
||||||
else if (wins_slctd() == TOD && todo_hilt() != 0)
|
else if (wins_slctd() == TOD && todo_hilt() != 0)
|
||||||
ui_todo_pipe();
|
ui_todo_pipe();
|
||||||
wins_update(FLAG_ALL);
|
wins_update(FLAG_ALL);
|
||||||
|
@ -730,14 +730,14 @@ void ical_import_data(FILE *, FILE *, unsigned *, unsigned *, unsigned *,
|
|||||||
void ical_export_data(FILE *);
|
void ical_export_data(FILE *);
|
||||||
|
|
||||||
/* interaction.c */
|
/* interaction.c */
|
||||||
void interact_day_item_add(void);
|
void ui_day_item_add(void);
|
||||||
void interact_day_item_delete(unsigned *, unsigned *, unsigned);
|
void ui_day_item_delete(unsigned *, unsigned *, unsigned);
|
||||||
void interact_day_item_edit(void);
|
void ui_day_item_edit(void);
|
||||||
void interact_day_item_pipe(void);
|
void ui_day_item_pipe(void);
|
||||||
void interact_day_item_repeat(void);
|
void ui_day_item_repeat(void);
|
||||||
void interact_day_item_cut_free(unsigned);
|
void ui_day_item_cut_free(unsigned);
|
||||||
void interact_day_item_copy(unsigned *, unsigned *, unsigned);
|
void ui_day_item_copy(unsigned *, unsigned *, unsigned);
|
||||||
void interact_day_item_paste(unsigned *, unsigned *, unsigned);
|
void ui_day_item_paste(unsigned *, unsigned *, unsigned);
|
||||||
void ui_todo_add(void);
|
void ui_todo_add(void);
|
||||||
void ui_todo_delete(void);
|
void ui_todo_delete(void);
|
||||||
void ui_todo_edit(void);
|
void ui_todo_edit(void);
|
||||||
|
@ -271,7 +271,7 @@ static void update_rept(struct rpt **rpt, const long start)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Edit an already existing item. */
|
/* Edit an already existing item. */
|
||||||
void interact_day_item_edit(void)
|
void ui_day_item_edit(void)
|
||||||
{
|
{
|
||||||
struct day_item *p;
|
struct day_item *p;
|
||||||
struct recur_event *re;
|
struct recur_event *re;
|
||||||
@ -366,7 +366,7 @@ void interact_day_item_edit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Pipe an appointment or event to an external program. */
|
/* Pipe an appointment or event to an external program. */
|
||||||
void interact_day_item_pipe(void)
|
void ui_day_item_pipe(void)
|
||||||
{
|
{
|
||||||
char cmd[BUFSIZ] = "";
|
char cmd[BUFSIZ] = "";
|
||||||
char const *arg[] = { cmd, NULL };
|
char const *arg[] = { cmd, NULL };
|
||||||
@ -410,7 +410,7 @@ void interact_day_item_pipe(void)
|
|||||||
* Add an item in either the appointment or the event list,
|
* Add an item in either the appointment or the event list,
|
||||||
* depending if the start time is entered or not.
|
* depending if the start time is entered or not.
|
||||||
*/
|
*/
|
||||||
void interact_day_item_add(void)
|
void ui_day_item_add(void)
|
||||||
{
|
{
|
||||||
#define LTIME 6
|
#define LTIME 6
|
||||||
#define LDUR 12
|
#define LDUR 12
|
||||||
@ -506,7 +506,7 @@ void interact_day_item_add(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Delete an item from the appointment list. */
|
/* Delete an item from the appointment list. */
|
||||||
void interact_day_item_delete(unsigned *nb_events, unsigned *nb_apoints,
|
void ui_day_item_delete(unsigned *nb_events, unsigned *nb_apoints,
|
||||||
unsigned reg)
|
unsigned reg)
|
||||||
{
|
{
|
||||||
const char *del_app_str = _("Do you really want to delete this item ?");
|
const char *del_app_str = _("Do you really want to delete this item ?");
|
||||||
@ -563,7 +563,7 @@ void interact_day_item_delete(unsigned *nb_events, unsigned *nb_apoints,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
interact_day_item_cut_free(reg);
|
ui_day_item_cut_free(reg);
|
||||||
p = day_cut_item(date, apoint_hilt());
|
p = day_cut_item(date, apoint_hilt());
|
||||||
day_cut[reg].type = p->type;
|
day_cut[reg].type = p->type;
|
||||||
day_cut[reg].item = p->item;
|
day_cut[reg].item = p->item;
|
||||||
@ -601,7 +601,7 @@ void interact_day_item_delete(unsigned *nb_events, unsigned *nb_apoints,
|
|||||||
* o repetition end date
|
* o repetition end date
|
||||||
* and then delete the selected item to recreate it as a recurrent one
|
* and then delete the selected item to recreate it as a recurrent one
|
||||||
*/
|
*/
|
||||||
void interact_day_item_repeat(void)
|
void ui_day_item_repeat(void)
|
||||||
{
|
{
|
||||||
struct tm lt;
|
struct tm lt;
|
||||||
time_t t;
|
time_t t;
|
||||||
@ -728,7 +728,7 @@ void interact_day_item_repeat(void)
|
|||||||
/* NOTREACHED */
|
/* NOTREACHED */
|
||||||
}
|
}
|
||||||
|
|
||||||
interact_day_item_cut_free(REG_BLACK_HOLE);
|
ui_day_item_cut_free(REG_BLACK_HOLE);
|
||||||
p = day_cut_item(date, item_nb);
|
p = day_cut_item(date, item_nb);
|
||||||
day_cut[REG_BLACK_HOLE].type = p->type;
|
day_cut[REG_BLACK_HOLE].type = p->type;
|
||||||
day_cut[REG_BLACK_HOLE].item = p->item;
|
day_cut[REG_BLACK_HOLE].item = p->item;
|
||||||
@ -737,7 +737,7 @@ void interact_day_item_repeat(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Free the current cut item, if any. */
|
/* Free the current cut item, if any. */
|
||||||
void interact_day_item_cut_free(unsigned reg)
|
void ui_day_item_cut_free(unsigned reg)
|
||||||
{
|
{
|
||||||
switch (day_cut[reg].type) {
|
switch (day_cut[reg].type) {
|
||||||
case 0:
|
case 0:
|
||||||
@ -759,7 +759,7 @@ void interact_day_item_cut_free(unsigned reg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Copy an item, so that it can be pasted somewhere else later. */
|
/* Copy an item, so that it can be pasted somewhere else later. */
|
||||||
void interact_day_item_copy(unsigned *nb_events, unsigned *nb_apoints,
|
void ui_day_item_copy(unsigned *nb_events, unsigned *nb_apoints,
|
||||||
unsigned reg)
|
unsigned reg)
|
||||||
{
|
{
|
||||||
const int NBITEMS = *nb_apoints + *nb_events;
|
const int NBITEMS = *nb_apoints + *nb_events;
|
||||||
@ -767,12 +767,12 @@ void interact_day_item_copy(unsigned *nb_events, unsigned *nb_apoints,
|
|||||||
if (NBITEMS == 0 || reg == REG_BLACK_HOLE)
|
if (NBITEMS == 0 || reg == REG_BLACK_HOLE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
interact_day_item_cut_free(reg);
|
ui_day_item_cut_free(reg);
|
||||||
day_item_fork(day_get_item(apoint_hilt()), &day_cut[reg]);
|
day_item_fork(day_get_item(apoint_hilt()), &day_cut[reg]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Paste a previously cut item. */
|
/* Paste a previously cut item. */
|
||||||
void interact_day_item_paste(unsigned *nb_events, unsigned *nb_apoints,
|
void ui_day_item_paste(unsigned *nb_events, unsigned *nb_apoints,
|
||||||
unsigned reg)
|
unsigned reg)
|
||||||
{
|
{
|
||||||
int item_type;
|
int item_type;
|
@ -105,7 +105,7 @@ void free_user_data(void)
|
|||||||
recur_apoint_llist_free();
|
recur_apoint_llist_free();
|
||||||
recur_event_llist_free();
|
recur_event_llist_free();
|
||||||
for (i = 0; i <= 37; i++)
|
for (i = 0; i <= 37; i++)
|
||||||
interact_day_item_cut_free(i);
|
ui_day_item_cut_free(i);
|
||||||
todo_free_list();
|
todo_free_list();
|
||||||
notify_free_app();
|
notify_free_app();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user