diff --git a/doc/toxic.1 b/doc/toxic.1 index 5ac28cd..27e9015 100644 --- a/doc/toxic.1 +++ b/doc/toxic.1 @@ -2,12 +2,12 @@ .\" Title: toxic .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 2014-09-15 +.\" Date: 2014-09-19 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC" "1" "2014\-09\-15" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC" "1" "2014\-09\-19" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -62,7 +62,7 @@ Use default locale .PP \-e, \-\-encrypt\-data .RS 4 -Encrypt an unencrypted data file\&. An error will occur if this option is used with a non\-existent or encrypted data file\&. +Encrypt an unencrypted data file\&. An error will occur if this option is used with an encrypted data file\&. .RE .PP \-f, \-\-file data\-file diff --git a/doc/toxic.1.asc b/doc/toxic.1.asc index 865f4ab..5d91296 100644 --- a/doc/toxic.1.asc +++ b/doc/toxic.1.asc @@ -32,7 +32,7 @@ OPTIONS -e, --encrypt-data:: Encrypt an unencrypted data file. An error will occur if this option - is used with a non-existent or encrypted data file. + is used with an encrypted data file. -f, --file data-file:: Use specified 'data-file' instead of '~/.config/tox/data' diff --git a/doc/toxic.conf.5 b/doc/toxic.conf.5 index 7be4c15..0d3a0c3 100644 --- a/doc/toxic.conf.5 +++ b/doc/toxic.conf.5 @@ -2,12 +2,12 @@ .\" Title: toxic.conf .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.78.1 -.\" Date: 2014-08-21 +.\" Date: 2014-08-26 .\" Manual: Toxic Manual .\" Source: toxic __VERSION__ .\" Language: English .\" -.TH "TOXIC\&.CONF" "5" "2014\-08\-21" "toxic __VERSION__" "Toxic Manual" +.TH "TOXIC\&.CONF" "5" "2014\-08\-26" "toxic __VERSION__" "Toxic Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -96,6 +96,11 @@ Show when others are typing in a 1\-on\-1 chat\&. true or false Show others when you\(cqre typing in a 1\-on\-1 chat\&. true or false .RE .PP +\fBshow_welcome_msg\fR +.RS 4 +Show welcome message on startup\&. true or false +.RE +.PP \fBhistory_size\fR .RS 4 Maximum lines for chat window history\&. Integer value\&. (for example: 700) diff --git a/doc/toxic.conf.5.asc b/doc/toxic.conf.5.asc index dd4b9df..976cb00 100644 --- a/doc/toxic.conf.5.asc +++ b/doc/toxic.conf.5.asc @@ -60,6 +60,9 @@ OPTIONS *show_typing_self*;; Show others when you're typing in a 1-on-1 chat. true or false + *show_welcome_msg*;; + Show welcome message on startup. true or false + *history_size*;; Maximum lines for chat window history. Integer value. (for example: 700) diff --git a/misc/toxic.conf.example b/misc/toxic.conf.example index 5147bb4..955e515 100644 --- a/misc/toxic.conf.example +++ b/misc/toxic.conf.example @@ -23,6 +23,9 @@ ui = { // true to show others when you're typing a message in 1-on-1 chats show_typing_self=true; + // true to show the welcome message on startup + show_welcome_msg=true; + // maximum lines for chat window history history_size=700; }; diff --git a/src/prompt.c b/src/prompt.c index 8670bf4..79c11e9 100644 --- a/src/prompt.c +++ b/src/prompt.c @@ -464,7 +464,8 @@ static void prompt_onInit(ToxWindow *self, Tox *m) scrollok(ctx->history, 0); wmove(self->window, y2 - CURS_Y_OFFSET, 0); - print_welcome_msg(self); + if (user_settings_->show_welcome_msg == SHOW_WELCOME_MSG_ON) + print_welcome_msg(self); } ToxWindow new_prompt(void) diff --git a/src/settings.c b/src/settings.c index d744a70..362c1bb 100644 --- a/src/settings.c +++ b/src/settings.c @@ -54,6 +54,7 @@ static struct _ui_strings { const char* history_size; const char* show_typing_self; const char* show_typing_other; + const char* show_welcome_msg; } ui_strings = { "ui", "timestamps", @@ -64,6 +65,7 @@ static struct _ui_strings { "history_size", "show_typing_self", "show_typing_other", + "show_welcome_msg", }; static void ui_defaults(struct user_settings* settings) @@ -76,6 +78,7 @@ static void ui_defaults(struct user_settings* settings) settings->history_size = 700; settings->show_typing_self = SHOW_TYPING_ON; settings->show_typing_other = SHOW_TYPING_ON; + settings->show_welcome_msg = SHOW_WELCOME_MSG_ON; } static const struct _keys_strings { @@ -250,6 +253,7 @@ int settings_load(struct user_settings *s, const char *patharg) config_setting_lookup_int(setting, ui_strings.history_size, &s->history_size); config_setting_lookup_bool(setting, ui_strings.show_typing_self, &s->show_typing_self); config_setting_lookup_bool(setting, ui_strings.show_typing_other, &s->show_typing_other); + config_setting_lookup_bool(setting, ui_strings.show_welcome_msg, &s->show_welcome_msg); config_setting_lookup_int(setting, ui_strings.time_format, &s->time); s->time = s->time == TIME_24 || s->time == TIME_12 ? s->time : TIME_24; /* Check defaults */ } diff --git a/src/settings.h b/src/settings.h index 31ce8a9..31b4448 100644 --- a/src/settings.h +++ b/src/settings.h @@ -35,6 +35,7 @@ struct user_settings { int history_size; /* int between MIN_HISTORY and MAX_HISTORY */ int show_typing_self; /* boolean */ int show_typing_other; /* boolean */ + int show_welcome_msg; /* boolean */ char download_path[PATH_MAX]; char chatlogs_path[PATH_MAX]; @@ -74,6 +75,9 @@ enum { SHOW_TYPING_OFF = 0, SHOW_TYPING_ON = 1, + SHOW_WELCOME_MSG_OFF = 0, + SHOW_WELCOME_MSG_ON = 1, + DFLT_HST_SIZE = 700, } settings_values;