From 32d165f1c450809bde3f1480cf076497b155f855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 17 Apr 2015 07:57:31 +0200 Subject: [PATCH] core: add a welcome message on first WeeChat run (closes #318) --- ChangeLog.asciidoc | 1 + po/cs.po | 20 ++++++++++++++++- po/de.po | 20 ++++++++++++++++- po/es.po | 20 ++++++++++++++++- po/fr.po | 37 ++++++++++++++++++++++++++++++-- po/hu.po | 20 ++++++++++++++++- po/it.po | 20 ++++++++++++++++- po/ja.po | 20 ++++++++++++++++- po/pl.po | 20 ++++++++++++++++- po/pt_BR.po | 20 ++++++++++++++++- po/ru.po | 20 ++++++++++++++++- po/tr.po | 20 ++++++++++++++++- po/weechat.pot | 20 ++++++++++++++++- src/core/wee-config-file.c | 5 +++++ src/core/weechat.c | 1 + src/core/weechat.h | 1 + src/gui/curses/gui-curses-main.c | 30 ++++++++++++++++++++++++++ 17 files changed, 282 insertions(+), 13 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index c3233352b..528f92f91 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -19,6 +19,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: add a welcome message on first WeeChat run (closes #318) * core: add options weechat.look.word_chars_{highlight|input} (closes #55, task #9459) * core: display a warning on startup if the locale can not be set (closes #373) diff --git a/po/cs.po b/po/cs.po index dc83a28a8..ea64c47c0 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -4158,6 +4158,24 @@ msgstr "Barvy Weechat (použité: %d, zbývá: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminál ztracen, ukončuji WeeChat..." +msgid "" +"\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)." +msgstr "" + #, fuzzy msgid "Mouse is enabled" msgstr "1 pokud jsou filtry povoleny" diff --git a/po/de.po b/po/de.po index f574a9eb7..1dc40dd2d 100644 --- a/po/de.po +++ b/po/de.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-04-15 18:52+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German <>\n" @@ -4899,6 +4899,24 @@ msgstr "WeeChat Farben (in Benutzung: %d; noch frei verfügbar: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminal verloren, beende WeeChat..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "Maus ist aktiv" diff --git a/po/es.po b/po/es.po index 6c7c98275..af05afcb8 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -4377,6 +4377,24 @@ msgstr "Colores de WeeChat (en uso: %d, disponibles: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Se perdió la terminal, cerrando WeeChat..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "Ratón activado" diff --git a/po/fr.po b/po/fr.po index 6c4eaa35e..ac3438973 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" -"PO-Revision-Date: 2015-04-14 07:36+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" +"PO-Revision-Date: 2015-04-17 07:44+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -4791,6 +4791,39 @@ msgstr "Couleurs WeeChat (en utilisation : %d, libres : %d) :" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminal perdu, sortie de WeeChat..." +msgid "" +"\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)." +msgstr "" +"\n" +"Bienvenue dans WeeChat !\n" +"\n" +"Si vous découvrez WeeChat, il est recommandé de lire au moins le guide de " +"démarrage rapide, et le guide utilisateur si vous avez le temps ; ils " +"expliquent les concepts principaux de WeeChat.\n" +"Toutes les documentations sont disponibles ici : https://weechat.org/doc\n" +"\n" +"De plus, il y a de l'aide en ligne avec /help sur toutes les commandes et " +"options (utilisez la touche Tab pour compléter le nom).\n" +"La commande /iset (script iset.pl) peut aider à paramétrer WeeChat : /script " +"install iset.pl\n" +"\n" +"Vous pouvez créer et vous connecter à un serveur IRC avec les commandes /" +"server et /connect (voir /help server)." + msgid "Mouse is enabled" msgstr "La souris est activée" diff --git a/po/hu.po b/po/hu.po index aabf4c95a..13e6f8a5d 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3781,6 +3781,24 @@ msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" +msgid "" +"\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)." +msgstr "" + #, fuzzy msgid "Mouse is enabled" msgstr "a felhasználók le lettek tiltva" diff --git a/po/it.po b/po/it.po index 3c1eef652..743c4e1b7 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4505,6 +4505,24 @@ msgstr "Colori di WeeChat (in uso: %d, rimaste: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminale perduto, chiusura di WeeChat..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "Mouse abilitato" diff --git a/po/ja.po b/po/ja.po index a438f27b4..af273bb84 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-04-13 00:40+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" @@ -4583,6 +4583,24 @@ msgstr "WeeChat 色 (使用中: %d、残り: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "ターミナルが見つかりません、WeeChat の終了中..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "マウスを有効化しました" diff --git a/po/pl.po b/po/pl.po index 80dd73d3f..3ab3dcf65 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -4671,6 +4671,24 @@ msgstr "Kolory WeeChat (w użyciu: %d, zostało: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Utracono terminal, wychodzę z WeeChat..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "Obsługa myszy włączona" diff --git a/po/pt_BR.po b/po/pt_BR.po index 0f53be972..3479810ea 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -4358,6 +4358,24 @@ msgstr "Cores do WeeChat (em uso: %d, sobram: %d):" msgid "Terminal lost, exiting WeeChat..." msgstr "Terminal perdido, saindo do WeeChat..." +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "Mouse está habilitado" diff --git a/po/ru.po b/po/ru.po index b5987ceec..216f55b30 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -3811,6 +3811,24 @@ msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" +msgid "" +"\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)." +msgstr "" + #, fuzzy msgid "Mouse is enabled" msgstr "команда users отключена" diff --git a/po/tr.po b/po/tr.po index 1d624d9cd..379bdd62f 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2015-03-10 21:33+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -3415,6 +3415,24 @@ msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index 7f25aca0e..fff15f7f1 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-04-13 17:19+0200\n" +"POT-Creation-Date: 2015-04-17 07:43+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -3410,6 +3410,24 @@ msgstr "" msgid "Terminal lost, exiting WeeChat..." msgstr "" +msgid "" +"\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)." +msgstr "" + msgid "Mouse is enabled" msgstr "" diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index a1dc67a4e..5868ef374 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -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"); diff --git a/src/core/weechat.c b/src/core/weechat.c index ffdab2511..ba31eb75e 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -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 */ diff --git a/src/core/weechat.h b/src/core/weechat.h index 1f21dd0bc..1c83b8a05 100644 --- a/src/core/weechat.h +++ b/src/core/weechat.h @@ -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; diff --git a/src/gui/curses/gui-curses-main.c b/src/gui/curses/gui-curses-main.c index 3f3016aa9..9f71e9b0f 100644 --- a/src/gui/curses/gui-curses-main.c +++ b/src/gui/curses/gui-curses-main.c @@ -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);