1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 18:23:13 +02:00

core: add a welcome message on first WeeChat run (closes #318)

This commit is contained in:
Sébastien Helleu
2015-04-17 07:57:31 +02:00
parent 13332360aa
commit 32d165f1c4
17 changed files with 282 additions and 13 deletions
+5
View File
@@ -35,6 +35,7 @@
#include "weechat.h"
#include "wee-config-file.h"
#include "wee-config.h"
#include "wee-hdata.h"
#include "wee-hook.h"
#include "wee-infolist.h"
@@ -2358,7 +2359,11 @@ config_file_read_internal (struct t_config_file *config_file, int reload)
/* create file with default options if it does not exist */
if (access (filename, F_OK) != 0)
{
if (strcmp (config_file->name, WEECHAT_CONFIG_NAME) == 0)
weechat_first_start = 1;
config_file_write_internal (config_file, 1);
}
/* read config file */
config_file->file = fopen (filename, "r");
+1
View File
@@ -82,6 +82,7 @@
int weechat_debug_core = 0; /* debug level for core */
char *weechat_argv0 = NULL; /* WeeChat binary file name (argv[0])*/
int weechat_upgrading = 0; /* =1 if WeeChat is upgrading */
int weechat_first_start = 0; /* first start of WeeChat? */
time_t weechat_first_start_time = 0; /* start time (used by /uptime cmd) */
int weechat_upgrade_count = 0; /* number of /upgrade done */
struct timeval weechat_current_start_timeval; /* start time used to display */
+1
View File
@@ -95,6 +95,7 @@
extern int weechat_debug_core;
extern char *weechat_argv0;
extern int weechat_upgrading;
extern int weechat_first_start;
extern time_t weechat_first_start_time;
extern struct timeval weechat_current_start_timeval;
extern int weechat_upgrade_count;
+30
View File
@@ -228,6 +228,32 @@ gui_main_init ()
gui_window_set_bracketed_paste_mode (CONFIG_BOOLEAN(config_look_paste_bracketed));
}
/*
* Displays a message on first WeeChat run (when weechat.conf is created).
*/
void
gui_main_welcome_message ()
{
gui_chat_printf (
NULL,
_("\n"
"Welcome to WeeChat!\n"
"\n"
"If you are discovering WeeChat, it is recommended to read at least "
"the quickstart guide, and the user's guide if you have some time; "
"they explain main WeeChat concepts.\n"
"All WeeChat docs are available at: https://weechat.org/doc\n"
"\n"
"Moreover, there is inline help with /help on all commands and "
"options (use Tab key to complete the name).\n"
"The command /iset (script iset.pl) can help to customize WeeChat: "
"/script install iset.pl\n"
"\n"
"You can create and connect to an IRC server with /server and "
"/connect commands (see /help server)."));
}
/*
* Callback for system signal SIGWINCH: refreshes screen.
*/
@@ -375,6 +401,10 @@ gui_main_loop ()
int max_fd;
int ready;
/* message on first run of WeeChat */
if (weechat_first_start)
gui_main_welcome_message ();
/* catch SIGWINCH signal: redraw screen */
util_catch_signal (SIGWINCH, &gui_main_signal_sigwinch);