Code to save the calendar default view in the configuration file.
This commit is contained in:
parent
d678eb411a
commit
758d5ff035
@ -6,6 +6,14 @@
|
||||
* src/help.c: description of the scroll keys added to the generic
|
||||
keys help screen
|
||||
|
||||
* src/custom.c (custom_load_conf): new configuration variable
|
||||
added to define the default calendar view
|
||||
|
||||
* src/calendar.c (calendar_set_view, calendar_get_view): new
|
||||
functions
|
||||
|
||||
* src/io.c (io_save_conf): save the calendar default view
|
||||
|
||||
2009-10-16 Frederic Culot <frederic@culot.org>
|
||||
|
||||
* src/calendar.c (draw_weekly_view): cosmetic changes in the
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $calcurse: calendar.c,v 1.29 2009/10/16 15:52:00 culot Exp $ */
|
||||
/* $calcurse: calendar.c,v 1.30 2009/10/28 15:15:43 culot Exp $ */
|
||||
|
||||
/*
|
||||
* Calcurse - text-based organizer
|
||||
@ -101,6 +101,18 @@ calendar_view_prev (void)
|
||||
calendar_view--;
|
||||
}
|
||||
|
||||
void
|
||||
calendar_set_view (int view)
|
||||
{
|
||||
calendar_view = (view < 0 || view >= CAL_VIEWS) ? CAL_MONTH_VIEW : view;
|
||||
}
|
||||
|
||||
int
|
||||
calendar_get_view (void)
|
||||
{
|
||||
return (int)calendar_view;
|
||||
}
|
||||
|
||||
/* Thread needed to update current date in calendar. */
|
||||
/* ARGSUSED0 */
|
||||
static void *
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $calcurse: calendar.h,v 1.17 2009/08/25 14:51:42 culot Exp $ */
|
||||
/* $calcurse: calendar.h,v 1.18 2009/10/28 15:15:43 culot Exp $ */
|
||||
|
||||
/*
|
||||
* Calcurse - text-based organizer
|
||||
@ -106,6 +106,8 @@ move_t;
|
||||
|
||||
void calendar_view_next (void);
|
||||
void calendar_view_prev (void);
|
||||
void calendar_set_view (int);
|
||||
int calendar_get_view (void);
|
||||
void calendar_start_date_thread (void);
|
||||
void calendar_stop_date_thread (void);
|
||||
void calendar_set_current_date (void);
|
||||
|
10
src/custom.c
10
src/custom.c
@ -1,4 +1,4 @@
|
||||
/* $calcurse: custom.c,v 1.44 2009/08/02 09:29:24 culot Exp $ */
|
||||
/* $calcurse: custom.c,v 1.45 2009/10/28 15:15:44 culot Exp $ */
|
||||
|
||||
/*
|
||||
* Calcurse - text-based organizer
|
||||
@ -273,6 +273,10 @@ custom_load_conf (conf_t *conf, int background)
|
||||
conf->skip_progress_bar = fill_config_var (e_conf);
|
||||
var = 0;
|
||||
break;
|
||||
case CUSTOM_CONF_CALENDAR_DEFAULTVIEW:
|
||||
calendar_set_view (atoi (e_conf));
|
||||
var = 0;
|
||||
break;
|
||||
case CUSTOM_CONF_WEEKBEGINSONMONDAY:
|
||||
if (fill_config_var (e_conf))
|
||||
calendar_set_first_day_of_week (MONDAY);
|
||||
@ -344,7 +348,9 @@ custom_load_conf (conf_t *conf, int background)
|
||||
var = CUSTOM_CONF_SKIPSYSTEMDIALOGS;
|
||||
else if (strncmp (e_conf, "skip_progress_bar=", 18) == 0)
|
||||
var = CUSTOM_CONF_SKIPPROGRESSBAR;
|
||||
else if (strncmp (e_conf, "week_begins_on_monday=", 23) == 0)
|
||||
else if (strncmp (e_conf, "calendar_default_view=", 22) == 0)
|
||||
var = CUSTOM_CONF_CALENDAR_DEFAULTVIEW;
|
||||
else if (strncmp (e_conf, "week_begins_on_monday=", 22) == 0)
|
||||
var = CUSTOM_CONF_WEEKBEGINSONMONDAY;
|
||||
else if (strncmp (e_conf, "color-theme=", 12) == 0)
|
||||
var = CUSTOM_CONF_COLORTHEME;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $calcurse: custom.h,v 1.18 2009/08/02 09:29:24 culot Exp $ */
|
||||
/* $calcurse: custom.h,v 1.19 2009/10/28 15:15:44 culot Exp $ */
|
||||
|
||||
/*
|
||||
* Calcurse - text-based organizer
|
||||
@ -66,6 +66,7 @@ enum
|
||||
CUSTOM_CONF_CONFIRMDELETE,
|
||||
CUSTOM_CONF_SKIPSYSTEMDIALOGS,
|
||||
CUSTOM_CONF_SKIPPROGRESSBAR,
|
||||
CUSTOM_CONF_CALENDAR_DEFAULTVIEW,
|
||||
CUSTOM_CONF_WEEKBEGINSONMONDAY,
|
||||
CUSTOM_CONF_COLORTHEME,
|
||||
CUSTOM_CONF_LAYOUT,
|
||||
|
6
src/io.c
6
src/io.c
@ -1,4 +1,4 @@
|
||||
/* $calcurse: io.c,v 1.78 2009/08/09 16:00:02 culot Exp $ */
|
||||
/* $calcurse: io.c,v 1.79 2009/10/28 15:15:44 culot Exp $ */
|
||||
|
||||
/*
|
||||
* Calcurse - text-based organizer
|
||||
@ -884,6 +884,10 @@ io_save_conf (conf_t *conf)
|
||||
(void)fprintf (fp, "skip_progress_bar=\n");
|
||||
(void)fprintf (fp, "%s\n", (conf->skip_progress_bar) ? "yes" : "no");
|
||||
|
||||
(void)fprintf (fp, "\n# Default calendar view (0)monthly (1)weekly:\n");
|
||||
(void)fprintf (fp, "calendar_default_view=\n");
|
||||
(void)fprintf (fp, "%d\n", calendar_get_view ());
|
||||
|
||||
(void)fprintf (fp, "\n# If this option is set to yes, "
|
||||
"monday is the first day of the week, else it is sunday\n");
|
||||
(void)fprintf (fp, "week_begins_on_monday=\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user