diff --git a/ChangeLog.adoc b/ChangeLog.adoc index c8bcf1e50..e43198924 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -24,6 +24,7 @@ New features:: Improvements:: + * core: add last start date in output of command /version after at least one /upgrade (issue #903) * irc: don't smart filter modes given to you (issue #530, issue #897) Build:: diff --git a/po/cs.po b/po/cs.po index aa1d710cc..d3bb24c54 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 21:59+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -988,8 +988,8 @@ msgstr "Čas běhu WeeChat: %s%d %s%s %s%02d%s:%s%02d%s:%s%02d%s, spuštěn %s%s msgid "compiled on" msgstr "kompilováno" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Aktualizováno %d %s, první spuštění: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2523,7 +2523,7 @@ msgstr "" msgid "manage windows" msgstr "spravuje okna" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4593,7 +4593,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, fuzzy, c-format +#, fuzzy, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/de.po b/po/de.po index e7524d2b7..26f1e2b4f 100644 --- a/po/de.po +++ b/po/de.po @@ -19,7 +19,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-22 13:46+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -1011,8 +1011,8 @@ msgstr "" msgid "compiled on" msgstr "kompiliert am" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Es wurde %d %s ein Upgrade durchgeführt, erster Start: %s" # nicht als Zeitangabe, sondern wie oft etwas passiert @@ -2977,6 +2977,7 @@ msgstr "" msgid "manage windows" msgstr "Fenster verwalten" +#, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -5413,7 +5414,7 @@ msgstr "" "list [] || add [[;...]] || addcompletion " " [[;...]] || del [...]" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/es.po b/po/es.po index 3d0cc38b0..c1d8b5a90 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:01+0100\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -982,8 +982,8 @@ msgstr "" msgid "compiled on" msgstr "compilado en" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Actualizado %d %s, primer inicio: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2624,7 +2624,7 @@ msgstr "" msgid "manage windows" msgstr "gestión de ventanas" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4788,7 +4788,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, fuzzy, c-format +#, fuzzy, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/fr.po b/po/fr.po index 7b5ebb319..70e5828ae 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: 2017-01-22 13:29+0100\n" -"PO-Revision-Date: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" +"PO-Revision-Date: 2017-02-03 21:58+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -997,8 +997,8 @@ msgid "compiled on" msgstr "compilé le" #, c-format -msgid "Upgraded %d %s, first start: %s" -msgstr "Mis à jour %d %s, premier démarrage : %s" +msgid "Upgraded %d %s, first start: %s, last start: %s" +msgstr "Mis à jour %d %s, premier démarrage : %s, dernier démarrage : %s" #. TRANSLATORS: text is: "upgraded xx times" msgid "time" @@ -2910,6 +2910,7 @@ msgstr "" msgid "manage windows" msgstr "gestion des fenêtres" +#, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -5301,7 +5302,7 @@ msgstr "" "list [] || add [[;...]] || addcompletion " " [[;...]] || del [...]" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/hu.po b/po/hu.po index 8b5a8e137..f0dccd7d3 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:03+0100\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -1012,7 +1012,7 @@ msgid "compiled on" msgstr "lefordítva:" #, c-format -msgid "Upgraded %d %s, first start: %s" +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "" #. TRANSLATORS: text is: "upgraded xx times" @@ -2178,7 +2178,7 @@ msgstr "" msgid "manage windows" msgstr "ablakok kezelése" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4163,7 +4163,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, fuzzy, c-format +#, fuzzy, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/it.po b/po/it.po index b1a01a456..0e0069974 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:04+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -968,8 +968,8 @@ msgstr "" msgid "compiled on" msgstr "compilato il" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Aggiornato %d %s, primo avvio: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2711,7 +2711,7 @@ msgstr "" msgid "manage windows" msgstr "gestione delle finestre" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4917,7 +4917,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, fuzzy, c-format +#, fuzzy, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/ja.po b/po/ja.po index e85fdc482..d50b7f5a2 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-29 09:00+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -5061,7 +5062,7 @@ msgstr "" "list [] || add [[;...]] || addcompletion " " [[;...]] || del [...]" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/pl.po b/po/pl.po index 42a720c2c..86adb13e9 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:05+0100\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: weechat-dev \n" @@ -1003,8 +1003,8 @@ msgstr "" msgid "compiled on" msgstr "skompilowano" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Uaktualniono %d %s, pierwsze uruchomienie: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2884,7 +2884,7 @@ msgstr "" msgid "manage windows" msgstr "zarządza oknami" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -5177,7 +5177,7 @@ msgstr "" "list [] || add [[;...]] || addcompletion " " [[;...]] || del [...]" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/pt.po b/po/pt.po index 2ce36296f..2df9db204 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-14 21:39+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -991,8 +991,8 @@ msgstr "" msgid "compiled on" msgstr "compilado a" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Atualizado %d %s, primeiro início: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2879,7 +2879,7 @@ msgstr "" msgid "manage windows" msgstr "gerir janelas" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -5176,7 +5176,7 @@ msgstr "" "list [] || add [[;...]] || addcompletion " " [[;...]] || del [...]" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 7ba5c3b40..067731698 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2016-09-03 08:24+0200\n" "Last-Translator: Eduardo Elias \n" "Language-Team: weechat-dev \n" @@ -1004,8 +1004,8 @@ msgstr "" msgid "compiled on" msgstr "compilado em" -#, c-format -msgid "Upgraded %d %s, first start: %s" +#, fuzzy, c-format +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "Atualizado %d %s, primeira inicialização: %s" #. TRANSLATORS: text is: "upgraded xx times" @@ -2674,7 +2674,7 @@ msgstr "" msgid "manage windows" msgstr "gerencia janelas" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4772,7 +4772,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/ru.po b/po/ru.po index c22f7990e..e6749806e 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:06+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -1033,7 +1033,7 @@ msgid "compiled on" msgstr "собран:" #, c-format -msgid "Upgraded %d %s, first start: %s" +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "" #. TRANSLATORS: text is: "upgraded xx times" @@ -2201,7 +2201,7 @@ msgstr "" msgid "manage windows" msgstr "управление окнами" -#, fuzzy +#, fuzzy, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -4202,7 +4202,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, fuzzy, c-format +#, fuzzy, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/tr.po b/po/tr.po index 5f5acf718..f437728a9 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2017-01-06 22:07+0100\n" "Last-Translator: Hasan Kiran \n" "Language-Team: weechat-dev \n" @@ -916,7 +916,7 @@ msgid "compiled on" msgstr "derlenme" #, c-format -msgid "Upgraded %d %s, first start: %s" +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "" #. TRANSLATORS: text is: "upgraded xx times" @@ -1987,6 +1987,7 @@ msgstr "" msgid "manage windows" msgstr "" +#, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -3786,7 +3787,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/po/weechat.pot b/po/weechat.pot index 5eb4aa039..e1130d9b9 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: 2017-01-22 13:29+0100\n" +"POT-Creation-Date: 2017-02-03 21:58+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -920,7 +920,7 @@ msgid "compiled on" msgstr "" #, c-format -msgid "Upgraded %d %s, first start: %s" +msgid "Upgraded %d %s, first start: %s, last start: %s" msgstr "" #. TRANSLATORS: text is: "upgraded xx times" @@ -1986,6 +1986,7 @@ msgstr "" msgid "manage windows" msgstr "" +#, no-c-format msgid "" "list || -1|+1|b#|up|down|left|right [-window ] || || splith|" "splitv [-window ] [] || resize [-window ] [h|v]" @@ -3774,7 +3775,7 @@ msgid "" " [[;...]] || del [...]" msgstr "" -#, c-format +#, no-c-format msgid "" " list: list aliases (without argument, this list is displayed)\n" " add: add an alias\n" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 0c276a92f..be8e0f759 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -6186,7 +6186,7 @@ COMMAND_CALLBACK(upgrade) COMMAND_CALLBACK(uptime) { int days, hours, minutes, seconds; - char string[512]; + char string[512], str_first_start[128]; /* make C compiler happy */ (void) pointer; @@ -6197,6 +6197,10 @@ COMMAND_CALLBACK(uptime) if ((argc >= 2) && (string_strcasecmp (argv[1], "-o") == 0)) { + snprintf (str_first_start, sizeof(str_first_start), + "%s", ctime (&weechat_first_start_time)); + if (str_first_start[0]) + str_first_start[strlen (str_first_start) - 1] = '\0'; snprintf (string, sizeof (string), "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s", days, @@ -6204,8 +6208,7 @@ COMMAND_CALLBACK(uptime) hours, minutes, seconds, - ctime (&weechat_first_start_time)); - string[strlen (string) - 1] = '\0'; + str_first_start); (void) input_data (buffer, string); } else if ((argc >= 2) && (string_strcasecmp (argv[1], "-ol") == 0)) @@ -6258,7 +6261,35 @@ command_version_display (struct t_gui_buffer *buffer, int translated_string, int display_git_version) { - char string[512]; + char string[1024], str_first_start[128], str_last_start[128]; + time_t weechat_last_start_time; + + str_first_start[0] = '\0'; + str_last_start[0] = '\0'; + + if (weechat_upgrade_count > 0) + { + weechat_last_start_time = (time_t)weechat_current_start_timeval.tv_sec; + + if (send_to_buffer_as_input && !translated_string) + { + snprintf (str_first_start, sizeof(str_first_start), + "%s", ctime (&weechat_first_start_time)); + if (str_first_start[0]) + str_first_start[strlen (str_first_start) - 1] = '\0'; + snprintf (str_last_start, sizeof(str_last_start), + "%s", ctime (&weechat_last_start_time)); + if (str_last_start[0]) + str_last_start[strlen (str_last_start) - 1] = '\0'; + } + else + { + snprintf (str_first_start, sizeof(str_first_start), + "%s", util_get_time_string (&weechat_first_start_time)); + snprintf (str_last_start, sizeof(str_last_start), + "%s", util_get_time_string (&weechat_last_start_time)); + } + } if (send_to_buffer_as_input) { @@ -6274,11 +6305,12 @@ command_version_display (struct t_gui_buffer *buffer, if (weechat_upgrade_count > 0) { snprintf (string, sizeof (string), - _("Upgraded %d %s, first start: %s"), + _("Upgraded %d %s, first start: %s, last start: %s"), weechat_upgrade_count, /* TRANSLATORS: text is: "upgraded xx times" */ NG_("time", "times", weechat_upgrade_count), - util_get_time_string (&weechat_first_start_time)); + str_first_start, + str_last_start); (void) input_data (buffer, string); } } @@ -6294,11 +6326,11 @@ command_version_display (struct t_gui_buffer *buffer, if (weechat_upgrade_count > 0) { snprintf (string, sizeof (string), - "Upgraded %d %s, first start: %s", + "Upgraded %d %s, first start: %s, last start: %s", weechat_upgrade_count, (weechat_upgrade_count > 1) ? "times" : "time", - ctime (&weechat_first_start_time)); - string[strlen (string) - 1] = '\0'; + str_first_start, + str_last_start); (void) input_data (buffer, string); } } @@ -6317,11 +6349,12 @@ command_version_display (struct t_gui_buffer *buffer, if (weechat_upgrade_count > 0) { gui_chat_printf (NULL, - _("Upgraded %d %s, first start: %s"), + _("Upgraded %d %s, first start: %s, last start: %s"), weechat_upgrade_count, /* TRANSLATORS: text is: "upgraded xx times" */ NG_("time", "times", weechat_upgrade_count), - util_get_time_string (&weechat_first_start_time)); + str_first_start, + str_last_start); } } }