Add info "weechat_upgrading", signal "upgrade_ended", display duration of upgrade

v2.8-utf8proc
Sebastien Helleu 2010-12-26 12:16:47 +01:00
parent b770f9c8c5
commit 391ca47674
24 changed files with 180 additions and 43 deletions

View File

@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.3.4-rc2, 2010-12-20
v0.3.4-rc2, 2010-12-26
Version 0.3.4 (under dev!)
--------------------------
* core: add info "weechat_upgrading", signal "upgrade_ended", display duration
of upgrade
* core: add 256 colors support, new section "palette" in weechat.conf
(task #6834)
* core: replace the 10 nick color options and number of nick colors by a single

View File

@ -52,4 +52,6 @@
| weechat | weechat_site_download | Download-Seite von WeeChat | -
| weechat | weechat_upgrading | 1 if WeeChat is upgrading (command `/upgrade`) | -
|========================================

View File

@ -52,4 +52,6 @@
| weechat | weechat_site_download | WeeChat site, download page | -
| weechat | weechat_upgrading | 1 if WeeChat is upgrading (command `/upgrade`) | -
|========================================

View File

@ -6775,6 +6775,9 @@ Arguments:
| weechat | upgrade | - |
command `/upgrade` issued by user
| weechat | upgrade_ended | - |
end of upgrade process (command `/upgrade`)
| weechat | weechat_highlight | string: message with prefix |
highlight happened

View File

@ -52,4 +52,6 @@
| weechat | weechat_site_download | site WeeChat, page de téléchargement | -
| weechat | weechat_upgrading | 1 si WeeChat est en cours de mise à jour (commande `/upgrade`) | -
|========================================

View File

@ -6862,6 +6862,9 @@ Paramètres :
| weechat | upgrade | - |
la commande `/upgrade` a été exécutée par l'utilisateur
| weechat | upgrade_ended | - |
fin du processus de mise à jour (commande `/upgrade`)
| weechat | weechat_highlight | chaîne : message avec le préfixe |
un highlight est survenu

View File

@ -52,4 +52,6 @@
| weechat | weechat_site_download | sito di WeeChat, pagina di download | -
| weechat | weechat_upgrading | 1 if WeeChat is upgrading (command `/upgrade`) | -
|========================================

View File

@ -6793,6 +6793,10 @@ Argomenti:
| weechat | upgrade | - |
comando `/upgrade` digitato dall'utente
// TRANSLATION MISSING
| weechat | upgrade_ended | - |
end of upgrade process (command `/upgrade`)
| weechat | weechat_highlight | string: messaggio con prefisso |
evento accaduto

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-06 11:55+0100\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2442,6 +2442,11 @@ msgstr "bajt"
msgid "debug: removing file: %s"
msgstr "ladění: odstraňuji soubor: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sChyba aktualizace WeeChat se souborem \"%s\""
@ -5986,6 +5991,9 @@ msgstr "stránka WeeChat"
msgid "WeeChat site, download page"
msgstr "stránka WeeChat, stránka pro stažení"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr "znaková sada terminálu"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.3-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-24 11:54+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-12-21 17:42+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2559,6 +2559,11 @@ msgstr "Byte"
msgid "debug: removing file: %s"
msgstr "debug: lösche Datei: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sFehler bei der Aktualisierung von WeeChat, mit der Datei \"%s\":"
@ -6255,6 +6260,9 @@ msgstr "WeeChat Seite"
msgid "WeeChat site, download page"
msgstr "Download-Seite von WeeChat"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr "Terminal Zeichensatz"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-06 11:56+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2474,6 +2474,11 @@ msgstr "byte"
msgid "debug: removing file: %s"
msgstr "depurado: removiendo el archivo: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sError al actualizar WeeChat con el archivo \"%s\":"
@ -6059,6 +6064,9 @@ msgstr "sitio web de WeeChat"
msgid "WeeChat site, download page"
msgstr "sitio web de WeeChat, página de descarga"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr "set de caracteres de la terminal"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"PO-Revision-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-12-26 11:51+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@ -1796,7 +1796,11 @@ msgid ""
"color name, fg,bg is \"foreground,background\" (example: \"200,-1\"), r/g/b "
"is redefinition of color (terminal must support it) (everything is optional "
"in this format and order is not important)"
msgstr "couleur personnalisée dans la palette, le format est: \"alias;fg,bg;r/g/b\" où alias est le nom de la couleur, fg,bg est \"texte,fond\" (par exemple: \"200,-1\"), r/g/b est la redéfinition de la couleur (le terminal doit le supporter) (tout est optionnel dans ce format et l'ordre n'est pas important)"
msgstr ""
"couleur personnalisée dans la palette, le format est: \"alias;fg,bg;r/g/b\" "
"où alias est le nom de la couleur, fg,bg est \"texte,fond\" (par exemple: "
"\"200,-1\"), r/g/b est la redéfinition de la couleur (le terminal doit le "
"supporter) (tout est optionnel dans ce format et l'ordre n'est pas important)"
#, c-format
msgid "%sError: palette option must be numeric"
@ -2514,6 +2518,11 @@ msgstr "octet"
msgid "debug: removing file: %s"
msgstr "debug: suppression du fichier: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr "Mise à jour terminée (%.02f %s)"
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sErreur de mise à jour de WeeChat avec le fichier \"%s\":"
@ -6138,6 +6147,9 @@ msgstr "site WeeChat"
msgid "WeeChat site, download page"
msgstr "site WeeChat, page de téléchargement"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr "1 si WeeChat est en cours de mise à jour (commande `/upgrade`)"
msgid "terminal charset"
msgstr "charset du terminal"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-05 17:17+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2265,6 +2265,11 @@ msgstr "byte"
msgid "debug: removing file: %s"
msgstr " IRC(%s)\n"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, fuzzy, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "WeeChat frissítése...\n"
@ -5685,6 +5690,9 @@ msgstr "WeeChat szlogen"
msgid "WeeChat site, download page"
msgstr ""
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
#, fuzzy
msgid "terminal charset"
msgstr "pufferek kezelése"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-12-22 11:02+0100\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1791,8 +1791,8 @@ msgstr ""
"colore personalizzato nella tavolozza, il formato è \"alias;fg,bg;r/g/b\" "
"dove l'alias è il nome del colore, fg,bg sono \"colore di primo piano,colore "
"di sfondo (esempio: \"200,-1\"), r/g/b la nuova definizone del colore (il "
"terminale deve supportarla) (tutto è opzionale in questo formato e non importa "
"l'ordine)"
"terminale deve supportarla) (tutto è opzionale in questo formato e non "
"importa l'ordine)"
#, c-format
msgid "%sError: palette option must be numeric"
@ -2492,6 +2492,11 @@ msgstr "byte"
msgid "debug: removing file: %s"
msgstr "debug: rimozione del file: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sErrore durante l'aggiornamento di WeeChat con il file \"%s\""
@ -6105,6 +6110,9 @@ msgstr "sito di WeeChat"
msgid "WeeChat site, download page"
msgstr "sito di WeeChat, pagina di download"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr "set caratteri terminale"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-06 11:56+0100\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2472,6 +2472,11 @@ msgstr "bajt"
msgid "debug: removing file: %s"
msgstr "debug: usuwam plik: %s"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "%sBłąd przy uaktualnianiu WeeChat z użyciem pliku \"%s\":"
@ -6020,6 +6025,9 @@ msgstr "Strona WeeChat"
msgid "WeeChat site, download page"
msgstr "Strona pobrań WeeChat"
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr "kodowanie terminala"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-13 09:26+0100\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1999,6 +1999,11 @@ msgstr ""
msgid "debug: removing file: %s"
msgstr ""
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr ""
@ -5026,6 +5031,9 @@ msgstr ""
msgid "WeeChat site, download page"
msgstr ""
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr ""

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.4-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: 2010-11-05 17:17+0100\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -2281,6 +2281,11 @@ msgstr "байтов"
msgid "debug: removing file: %s"
msgstr " IRC(%s)\n"
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, fuzzy, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr "Обновляю WeeChat...\n"
@ -5700,6 +5705,9 @@ msgstr "слоган WeeChat"
msgid "WeeChat site, download page"
msgstr ""
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
#, fuzzy
msgid "terminal charset"
msgstr "управление буферами"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2010-12-21 09:22+0100\n"
"POT-Creation-Date: 2010-12-26 12:13+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -1938,6 +1938,11 @@ msgstr ""
msgid "debug: removing file: %s"
msgstr ""
#. TRANSLATORS: "%s" is translation of "second" or "seconds"
#, c-format
msgid "Upgrade done (%.02f %s)"
msgstr ""
#, c-format
msgid "%sError upgrading WeeChat with file \"%s\":"
msgstr ""
@ -4962,6 +4967,9 @@ msgstr ""
msgid "WeeChat site, download page"
msgstr ""
msgid "1 if WeeChat is upgrading (command `/upgrade`)"
msgstr ""
msgid "terminal charset"
msgstr ""

View File

@ -3865,7 +3865,7 @@ command_uptime (void *data, struct t_gui_buffer *buffer,
(void) data;
(void) argv_eol;
running_time = time (NULL) - weechat_start_time;
running_time = time (NULL) - weechat_first_start_time;
day = running_time / (60 * 60 * 24);
hour = (running_time % (60 * 60 * 24)) / (60 * 60);
min = ((running_time % (60 * 60 * 24)) % (60 * 60)) / 60;
@ -3880,7 +3880,7 @@ command_uptime (void *data, struct t_gui_buffer *buffer,
hour,
min,
sec,
ctime (&weechat_start_time));
ctime (&weechat_first_start_time));
string[strlen (string) - 1] = '\0';
input_data (buffer, string);
}
@ -3894,7 +3894,7 @@ command_uptime (void *data, struct t_gui_buffer *buffer,
hour,
min,
sec,
util_get_time_string (&weechat_start_time));
util_get_time_string (&weechat_first_start_time));
input_data (buffer, string);
}
else
@ -3918,7 +3918,7 @@ command_uptime (void *data, struct t_gui_buffer *buffer,
sec,
GUI_COLOR(GUI_COLOR_CHAT),
GUI_COLOR(GUI_COLOR_CHAT_BUFFER),
util_get_time_string (&weechat_start_time));
util_get_time_string (&weechat_first_start_time));
}
return WEECHAT_RC_OK;
@ -3953,7 +3953,7 @@ command_version_display (struct t_gui_buffer *buffer,
weechat_upgrade_count,
/* TRANSLATORS: text is: "upgraded xx times" */
NG_("time", "times", weechat_upgrade_count),
util_get_time_string (&weechat_start_time));
util_get_time_string (&weechat_first_start_time));
input_data (buffer, string);
}
}
@ -3972,7 +3972,7 @@ command_version_display (struct t_gui_buffer *buffer,
"Upgraded %d %s, first start: %s",
weechat_upgrade_count,
(weechat_upgrade_count > 1) ? "times" : "time",
ctime (&weechat_start_time));
ctime (&weechat_first_start_time));
string[strlen (string) - 1] = '\0';
input_data (buffer, string);
}
@ -3996,7 +3996,7 @@ command_version_display (struct t_gui_buffer *buffer,
weechat_upgrade_count,
/* TRANSLATORS: text is: "upgraded xx times" */
NG_("time", "times", weechat_upgrade_count),
util_get_time_string (&weechat_start_time));
util_get_time_string (&weechat_first_start_time));
}
}
}

View File

@ -29,9 +29,11 @@
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <sys/time.h>
#include "weechat.h"
#include "wee-upgrade.h"
#include "wee-hook.h"
#include "wee-infolist.h"
#include "wee-string.h"
#include "wee-util.h"
@ -207,7 +209,7 @@ upgrade_weechat_save_uptime (struct t_upgrade_file *upgrade_file)
infolist_free (ptr_infolist);
return 0;
}
if (!infolist_new_var_time (ptr_item, "start_time", weechat_start_time))
if (!infolist_new_var_time (ptr_item, "start_time", weechat_first_start_time))
{
infolist_free (ptr_infolist);
return 0;
@ -539,7 +541,7 @@ upgrade_weechat_read_cb (void *data,
}
break;
case UPGRADE_WEECHAT_TYPE_UPTIME:
weechat_start_time = infolist_time (infolist, "start_time");
weechat_first_start_time = infolist_time (infolist, "start_time");
weechat_upgrade_count = infolist_integer (infolist, "upgrade_count");
break;
case UPGRADE_WEECHAT_TYPE_HOTLIST:
@ -628,14 +630,34 @@ upgrade_weechat_remove_file_cb (void *data, const char *filename)
}
/*
* upgrade_weechat_remove_files: remove *.upgrade files after upgrade
* upgrade_weechat_end: remove *.upgrade files after upgrade and send signal
* "weechat_upgrade_done"
*/
void
upgrade_weechat_remove_files ()
upgrade_weechat_end ()
{
struct timeval tv_now;
long time_diff;
/* remove .upgrade files */
util_exec_on_files (weechat_home,
0,
NULL,
&upgrade_weechat_remove_file_cb);
/* display message for end of /upgrade with duration */
gettimeofday (&tv_now, NULL);
time_diff = util_timeval_diff (&weechat_current_start_timeval, &tv_now);
gui_chat_printf (NULL,
/* TRANSLATORS: "%s" is translation of "second" or "seconds" */
_("Upgrade done (%.02f %s)"),
((float)time_diff) / 1000,
NG_("second", "seconds", time_diff / 1000));
/* upgrading ended */
weechat_upgrading = 0;
/* send signal for end of /upgrade */
hook_signal_send ("upgrade_ended", WEECHAT_HOOK_SIGNAL_STRING, NULL);
}

View File

@ -38,6 +38,6 @@ enum t_upgrade_weechat_type
int upgrade_weechat_save ();
int upgrade_weechat_load ();
void upgrade_weechat_remove_files ();
void upgrade_weechat_end ();
#endif /* __WEECHAT_UPGRADE_H */

View File

@ -45,6 +45,7 @@
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <time.h>
#include <signal.h>
@ -77,8 +78,10 @@
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 */
time_t weechat_start_time = 0; /* start time (used by /uptime cmd) */
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 */
/* duration of /upgrade */
int weechat_quit = 0; /* = 1 if quit request from user */
int weechat_sigsegv = 0; /* SIGSEGV received? */
char *weechat_home = NULL; /* home dir. (default: ~/.weechat) */
@ -89,6 +92,17 @@ int weechat_plugin_no_dlclose = 0; /* remove calls to dlclose for libs */
/* (useful when using valgrind) */
/*
* weechat_init_vars: initialize some variables
*/
void
weechat_init_vars ()
{
weechat_first_start_time = time (NULL);
gettimeofday (&weechat_current_start_timeval, NULL);
}
/*
* weechat_display_usage: display WeeChat usage
*/
@ -299,17 +313,6 @@ weechat_create_home_dirs ()
}
}
/*
* weechat_init_vars: initialize some variables
*/
void
weechat_init_vars ()
{
/* start time, used by /uptime command */
weechat_start_time = time (NULL);
}
/*
* weechat_welcome_message: display WeeChat welcome message - yeah!
*/
@ -373,6 +376,8 @@ weechat_shutdown (int return_code, int crash)
int
main (int argc, char *argv[])
{
weechat_init_vars (); /* initialize some variables */
setlocale (LC_ALL, ""); /* initialize gettext */
#ifdef ENABLE_NLS
bindtextdomain (PACKAGE, LOCALEDIR);
@ -395,7 +400,6 @@ main (int argc, char *argv[])
hook_init (); /* initialize hooks */
debug_init (); /* hook signals for debug */
gui_main_pre_init (&argc, &argv); /* pre-initiliaze interface */
weechat_init_vars (); /* initialize some variables */
command_init (); /* initialize WeeChat commands */
completion_init (); /* add core completion hooks */
gui_keyboard_init (); /* init keyboard */
@ -420,8 +424,7 @@ main (int argc, char *argv[])
command_startup (1); /* command executed after plugins */
gui_layout_window_apply (gui_layout_windows, -1); /* apply saved layout */
if (weechat_upgrading)
upgrade_weechat_remove_files ();/* remove .upgrade files */
weechat_upgrading = 0;
upgrade_weechat_end (); /* remove .upgrade files + signal */
gui_main_loop (); /* WeeChat main loop */

View File

@ -103,7 +103,8 @@
extern int weechat_debug_core;
extern char *weechat_argv0;
extern int weechat_upgrading;
extern time_t weechat_start_time;
extern time_t weechat_first_start_time;
extern struct timeval weechat_current_start_timeval;
extern int weechat_upgrade_count;
extern int weechat_quit;
extern char *weechat_home;

View File

@ -322,6 +322,11 @@ plugin_api_info_get_internal (void *data, const char *info_name,
{
return WEECHAT_WEBSITE_DOWNLOAD;
}
else if (string_strcasecmp (info_name, "weechat_upgrading") == 0)
{
snprintf (value, sizeof (value), "%d", weechat_upgrading);
return value;
}
else if (string_strcasecmp (info_name, "charset_terminal") == 0)
{
return weechat_local_charset;
@ -957,6 +962,8 @@ plugin_api_init ()
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "weechat_site_download", N_("WeeChat site, download page"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "weechat_upgrading", N_("1 if WeeChat is upgrading (command `/upgrade`)"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "charset_terminal", N_("terminal charset"), NULL,
&plugin_api_info_get_internal, NULL);
hook_info (NULL, "charset_internal", N_("WeeChat internal charset"), NULL,