Fix semantics of "general."{systemdialogs,progressbar}
These were renamed from "skip_"* to *. However, we only changed syntax and didn't invert their semantic meaning. Fix this by negating the semantics of those variables. Also, negate these in the configuration file automatically when running `calcurse-upgrade`. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
8916293a26
commit
c85c3cce55
@ -63,5 +63,13 @@ if grep -q -e '^auto_save=' -e '^auto_gc=' -e '^periodic_save=' \
|
|||||||
-e '/^daemon.log=/{N;s/\n//}' "$CONFFILE" > "$tmpfile" || exit 1
|
-e '/^daemon.log=/{N;s/\n//}' "$CONFFILE" > "$tmpfile" || exit 1
|
||||||
mv "$tmpfile" "$CONFFILE" || exit 1
|
mv "$tmpfile" "$CONFFILE" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
awk '
|
||||||
|
BEGIN { FS=OFS="=" }
|
||||||
|
$1 == "general.systemdialogs" || $1 == "general.progressbar" \
|
||||||
|
{ $2 = ($2 == "yes") ? "no" : "yes" }
|
||||||
|
{ print }
|
||||||
|
' < "$CONFFILE" > "$tmpfile" || exit 1
|
||||||
|
mv "$tmpfile" "$CONFFILE" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ main (int argc, char **argv)
|
|||||||
if (notify_bar ())
|
if (notify_bar ())
|
||||||
notify_start_main_thread ();
|
notify_start_main_thread ();
|
||||||
wins_update (FLAG_ALL);
|
wins_update (FLAG_ALL);
|
||||||
io_startup_screen (conf.skip_system_dialogs, no_data_file);
|
io_startup_screen (conf.system_dialogs, no_data_file);
|
||||||
inday = *day_process_storage (0, 0, &inday);
|
inday = *day_process_storage (0, 0, &inday);
|
||||||
wins_slctd_set (CAL);
|
wins_slctd_set (CAL);
|
||||||
wins_update (FLAG_ALL);
|
wins_update (FLAG_ALL);
|
||||||
|
@ -233,8 +233,8 @@ struct conf {
|
|||||||
unsigned periodic_save;
|
unsigned periodic_save;
|
||||||
unsigned confirm_quit;
|
unsigned confirm_quit;
|
||||||
unsigned confirm_delete;
|
unsigned confirm_delete;
|
||||||
unsigned skip_system_dialogs;
|
unsigned system_dialogs;
|
||||||
unsigned skip_progress_bar;
|
unsigned progress_bar;
|
||||||
char *editor;
|
char *editor;
|
||||||
char *pager;
|
char *pager;
|
||||||
char output_datefmt[BUFSIZ]; /* format for displaying date */
|
char output_datefmt[BUFSIZ]; /* format for displaying date */
|
||||||
|
@ -99,8 +99,8 @@ static const struct confvar confmap[] = {
|
|||||||
{ "general.confirmquit", CONFIG_HANDLER_BOOL (conf.confirm_quit) },
|
{ "general.confirmquit", CONFIG_HANDLER_BOOL (conf.confirm_quit) },
|
||||||
{ "general.firstdayofweek", config_parse_first_day_of_week, config_serialize_first_day_of_week, NULL },
|
{ "general.firstdayofweek", config_parse_first_day_of_week, config_serialize_first_day_of_week, NULL },
|
||||||
{ "general.periodicsave", CONFIG_HANDLER_UNSIGNED (conf.periodic_save) },
|
{ "general.periodicsave", CONFIG_HANDLER_UNSIGNED (conf.periodic_save) },
|
||||||
{ "general.progressbar", CONFIG_HANDLER_BOOL (conf.skip_progress_bar) },
|
{ "general.progressbar", CONFIG_HANDLER_BOOL (conf.progress_bar) },
|
||||||
{ "general.systemdialogs", CONFIG_HANDLER_BOOL (conf.skip_system_dialogs) },
|
{ "general.systemdialogs", CONFIG_HANDLER_BOOL (conf.system_dialogs) },
|
||||||
{ "notification.command", CONFIG_HANDLER_STR (nbar.cmd) },
|
{ "notification.command", CONFIG_HANDLER_STR (nbar.cmd) },
|
||||||
{ "notification.notifyall", CONFIG_HANDLER_BOOL (nbar.notify_all) },
|
{ "notification.notifyall", CONFIG_HANDLER_BOOL (nbar.notify_all) },
|
||||||
{ "notification.warning", CONFIG_HANDLER_INT (nbar.cntdwn) }
|
{ "notification.warning", CONFIG_HANDLER_INT (nbar.cntdwn) }
|
||||||
|
16
src/custom.c
16
src/custom.c
@ -644,8 +644,8 @@ print_general_options (WINDOW *win)
|
|||||||
_("periodic_save = "),
|
_("periodic_save = "),
|
||||||
_("confirm_quit = "),
|
_("confirm_quit = "),
|
||||||
_("confirm_delete = "),
|
_("confirm_delete = "),
|
||||||
_("skip_system_dialogs = "),
|
_("system_dialogs = "),
|
||||||
_("skip_progress_bar = "),
|
_("progress_bar = "),
|
||||||
_("week_begins_on_monday = "),
|
_("week_begins_on_monday = "),
|
||||||
_("output_datefmt = "),
|
_("output_datefmt = "),
|
||||||
_("input_datefmt = ")
|
_("input_datefmt = ")
|
||||||
@ -687,17 +687,17 @@ print_general_options (WINDOW *win)
|
|||||||
"before deleting an event)"));
|
"before deleting an event)"));
|
||||||
y += YOFF;
|
y += YOFF;
|
||||||
mvwprintw (win, y, XPOS, "[6] %s ", opt[SKIP_SYSTEM_DIAGS]);
|
mvwprintw (win, y, XPOS, "[6] %s ", opt[SKIP_SYSTEM_DIAGS]);
|
||||||
print_bool_option_incolor (win, conf.skip_system_dialogs, y,
|
print_bool_option_incolor (win, conf.system_dialogs, y,
|
||||||
XPOS + 4 + strlen (opt[SKIP_SYSTEM_DIAGS]));
|
XPOS + 4 + strlen (opt[SKIP_SYSTEM_DIAGS]));
|
||||||
mvwprintw (win, y + 1, XPOS,
|
mvwprintw (win, y + 1, XPOS,
|
||||||
_("(if set to YES, messages about loaded "
|
_("(if set to YES, messages about loaded "
|
||||||
"and saved data will not be displayed)"));
|
"and saved data will be displayed)"));
|
||||||
y += YOFF;
|
y += YOFF;
|
||||||
mvwprintw (win, y, XPOS, "[7] %s ", opt[SKIP_PROGRESS_BAR]);
|
mvwprintw (win, y, XPOS, "[7] %s ", opt[SKIP_PROGRESS_BAR]);
|
||||||
print_bool_option_incolor (win, conf.skip_progress_bar, y,
|
print_bool_option_incolor (win, conf.progress_bar, y,
|
||||||
XPOS + 4 + strlen (opt[SKIP_PROGRESS_BAR]));
|
XPOS + 4 + strlen (opt[SKIP_PROGRESS_BAR]));
|
||||||
mvwprintw (win, y + 1, XPOS,
|
mvwprintw (win, y + 1, XPOS,
|
||||||
_("(if set to YES, progress bar will not be displayed "
|
_("(if set to YES, progress bar will be displayed "
|
||||||
"when saving data)"));
|
"when saving data)"));
|
||||||
y += YOFF;
|
y += YOFF;
|
||||||
mvwprintw (win, y, XPOS, "[8] %s ", opt[WEEK_BEGINS_MONDAY]);
|
mvwprintw (win, y, XPOS, "[8] %s ", opt[WEEK_BEGINS_MONDAY]);
|
||||||
@ -809,10 +809,10 @@ custom_general_config (void)
|
|||||||
conf.confirm_delete = !conf.confirm_delete;
|
conf.confirm_delete = !conf.confirm_delete;
|
||||||
break;
|
break;
|
||||||
case '6':
|
case '6':
|
||||||
conf.skip_system_dialogs = !conf.skip_system_dialogs;
|
conf.system_dialogs = !conf.system_dialogs;
|
||||||
break;
|
break;
|
||||||
case '7':
|
case '7':
|
||||||
conf.skip_progress_bar = !conf.skip_progress_bar;
|
conf.progress_bar = !conf.progress_bar;
|
||||||
break;
|
break;
|
||||||
case '8':
|
case '8':
|
||||||
calendar_change_first_day_of_week ();
|
calendar_change_first_day_of_week ();
|
||||||
|
@ -380,8 +380,8 @@ help_screen (void)
|
|||||||
_("Import data from an icalendar file.\n"
|
_("Import data from an icalendar file.\n"
|
||||||
"You will be asked to enter the file name from which to load ical\n"
|
"You will be asked to enter the file name from which to load ical\n"
|
||||||
"items. At the end of the import process, and if the general option\n"
|
"items. At the end of the import process, and if the general option\n"
|
||||||
"'skip_system_dialogs' is not set to 'yes', a report indicating how\n"
|
"'system_dialogs' is set to 'yes', a report indicating how many items\n"
|
||||||
"many items were imported is shown.\n"
|
"were imported is shown.\n"
|
||||||
"This report contains the total number of lines read, the number of\n"
|
"This report contains the total number of lines read, the number of\n"
|
||||||
"appointments, events and todo items which were successfully imported,\n"
|
"appointments, events and todo items which were successfully imported,\n"
|
||||||
"together with the number of items for which problems occured and that\n"
|
"together with the number of items for which problems occured and that\n"
|
||||||
|
12
src/io.c
12
src/io.c
@ -440,7 +440,7 @@ io_save_cal (enum save_display display)
|
|||||||
|
|
||||||
show_bar = 0;
|
show_bar = 0;
|
||||||
if (ui_mode == UI_CURSES && display == IO_SAVE_DISPLAY_BAR
|
if (ui_mode == UI_CURSES && display == IO_SAVE_DISPLAY_BAR
|
||||||
&& !conf.skip_progress_bar)
|
&& conf.progress_bar)
|
||||||
show_bar = 1;
|
show_bar = 1;
|
||||||
else if (ui_mode == UI_CURSES && display == IO_SAVE_DISPLAY_MARK)
|
else if (ui_mode == UI_CURSES && display == IO_SAVE_DISPLAY_MARK)
|
||||||
display_mark ();
|
display_mark ();
|
||||||
@ -466,7 +466,7 @@ io_save_cal (enum save_display display)
|
|||||||
ERROR_MSG ("%s", access_pb);
|
ERROR_MSG ("%s", access_pb);
|
||||||
|
|
||||||
/* Print a message telling data were saved */
|
/* Print a message telling data were saved */
|
||||||
if (ui_mode == UI_CURSES && !conf.skip_system_dialogs
|
if (ui_mode == UI_CURSES && conf.system_dialogs
|
||||||
&& display != IO_SAVE_DISPLAY_MARK)
|
&& display != IO_SAVE_DISPLAY_MARK)
|
||||||
{
|
{
|
||||||
status_mesg (save_success, enter);
|
status_mesg (save_success, enter);
|
||||||
@ -988,7 +988,7 @@ io_check_data_files (void)
|
|||||||
|
|
||||||
/* Draw the startup screen */
|
/* Draw the startup screen */
|
||||||
void
|
void
|
||||||
io_startup_screen (unsigned skip_dialogs, int no_data_file)
|
io_startup_screen (unsigned show_dialogs, int no_data_file)
|
||||||
{
|
{
|
||||||
char *welcome_mesg =
|
char *welcome_mesg =
|
||||||
_("Welcome to Calcurse. Missing data files were created.");
|
_("Welcome to Calcurse. Missing data files were created.");
|
||||||
@ -1000,7 +1000,7 @@ io_startup_screen (unsigned skip_dialogs, int no_data_file)
|
|||||||
status_mesg (welcome_mesg, enter);
|
status_mesg (welcome_mesg, enter);
|
||||||
wgetch (win[STA].p);
|
wgetch (win[STA].p);
|
||||||
}
|
}
|
||||||
else if (!skip_dialogs)
|
else if (show_dialogs)
|
||||||
{
|
{
|
||||||
status_mesg (data_mesg, enter);
|
status_mesg (data_mesg, enter);
|
||||||
wgetch (win[STA].p);
|
wgetch (win[STA].p);
|
||||||
@ -1040,7 +1040,7 @@ io_export_data (enum export_type type)
|
|||||||
else if (type == IO_EXPORT_PCAL)
|
else if (type == IO_EXPORT_PCAL)
|
||||||
pcal_export_data (stream);
|
pcal_export_data (stream);
|
||||||
|
|
||||||
if (!conf.skip_system_dialogs && ui_mode == UI_CURSES)
|
if (conf.system_dialogs && ui_mode == UI_CURSES)
|
||||||
{
|
{
|
||||||
status_mesg (success, enter);
|
status_mesg (success, enter);
|
||||||
wgetch (win[STA].p);
|
wgetch (win[STA].p);
|
||||||
@ -1171,7 +1171,7 @@ io_import_data (enum import_type type, char *stream_name)
|
|||||||
/* Update the number of todo items. */
|
/* Update the number of todo items. */
|
||||||
todo_set_nb (todo_nb () + stats.todos);
|
todo_set_nb (todo_nb () + stats.todos);
|
||||||
|
|
||||||
if (ui_mode == UI_CURSES && !conf.skip_system_dialogs)
|
if (ui_mode == UI_CURSES && conf.system_dialogs)
|
||||||
{
|
{
|
||||||
char read[BUFSIZ], stat[BUFSIZ];
|
char read[BUFSIZ], stat[BUFSIZ];
|
||||||
|
|
||||||
|
@ -131,8 +131,8 @@ vars_init (void)
|
|||||||
conf.auto_save = 1;
|
conf.auto_save = 1;
|
||||||
conf.auto_gc = 0;
|
conf.auto_gc = 0;
|
||||||
conf.periodic_save = 0;
|
conf.periodic_save = 0;
|
||||||
conf.skip_system_dialogs = 0;
|
conf.system_dialogs = 1;
|
||||||
conf.skip_progress_bar = 0;
|
conf.progress_bar = 1;
|
||||||
strncpy (conf.output_datefmt, "%D", 3);
|
strncpy (conf.output_datefmt, "%D", 3);
|
||||||
conf.input_datefmt = 1;
|
conf.input_datefmt = 1;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user