From f71c190a975ea6836fa79e90124fb3dd14a6b05b Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Wed, 7 May 2008 14:34:10 +0200 Subject: [PATCH] New option "xfer.file.use_nick_in_filename" for Xfer files (task #7140) --- ChangeLog | 3 ++- po/cs.po | 5 ++++- po/de.po | 5 ++++- po/es.po | 5 ++++- po/fr.po | 7 +++++-- po/hu.po | 5 ++++- po/ru.po | 5 ++++- po/weechat.pot | 5 ++++- src/plugins/xfer/xfer-config.c | 6 ++++++ src/plugins/xfer/xfer-config.h | 1 + src/plugins/xfer/xfer-file.c | 7 +++++-- 11 files changed, 43 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index e48ed6a50..24bf29016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,11 @@ WeeChat - Wee Enhanced Environment for Chat =========================================== -ChangeLog - 2008-05-04 +ChangeLog - 2008-05-07 Version 0.2.7 (under dev!): + * new option "xfer.file.use_nick_in_filename" for Xfer files (task #7140) * removed key functions, replaced by /input command * fixed bug with alias, use current buffer to run commands (bug #22876) * new names for config files (*.conf instead of *.rc) diff --git a/po/cs.po b/po/cs.po index 93b224bb5..9de010b28 100644 --- a/po/cs.po +++ b/po/cs.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -4474,6 +4474,9 @@ msgstr "" "cesta pro čtení souborů při odesílání přes dcc (když není specifikována " "cesta)" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "konvertovat mezery na podtržítka při odesílání souborů" diff --git a/po/de.po b/po/de.po index 03561b768..01d268610 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -4460,6 +4460,9 @@ msgstr "" "Pfad, aus dem Dateien standardmäßig gelesen werden, wenn keine explizite " "Angabe vorliegt" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "Leerzeichen in Unterstriche umwandeln beim Veschicken von Dateien" diff --git a/po/es.po b/po/es.po index 77aaad83c..33e70e110 100644 --- a/po/es.po +++ b/po/es.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: 2007-09-19 12:09+0200\n" "Last-Translator: Roberto González Cardenete \n" "Language-Team: weechat-dev \n" @@ -4466,6 +4466,9 @@ msgstr "" "ruta para la lectura de ficheros cuando se envían a través de dcc (cuando " "no se especifica una ruta)" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "convertir los espacios a subrayados cuando se envían los ficheros" diff --git a/po/fr.po b/po/fr.po index ba962bc5f..eaa4a3432 100644 --- a/po/fr.po +++ b/po/fr.po @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" -"PO-Revision-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" +"PO-Revision-Date: 2008-05-07 14:31+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -4396,6 +4396,9 @@ msgstr "" "chemin pour lire les fichiers envoyés (quand aucun chemin n'est spécifié par " "l'utilisateur)" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "utiliser le pseudo distant comme préfixe dans le nom de fichier local lors de la réception d'un fichier" + msgid "convert spaces to underscores when sending files" msgstr "convertir les espaces en underscores lors d'envoi de fichiers" diff --git a/po/hu.po b/po/hu.po index 61b25ca5e..836eaad35 100644 --- a/po/hu.po +++ b/po/hu.po @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: 2007-10-10 18:07+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -4476,6 +4476,9 @@ msgid "path for reading files when sending (when no path is specified by user)" msgstr "" "dcc-n keresztül küldendő fájlok elérési útvonala (ha nincs külön megadva)" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "szóközök alulvonássá alakítása küldéskor" diff --git a/po/ru.po b/po/ru.po index a0f82d1b0..28e2f880a 100644 --- a/po/ru.po +++ b/po/ru.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.2.7-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -4460,6 +4460,9 @@ msgstr "путь для получаемых файлов" msgid "path for reading files when sending (when no path is specified by user)" msgstr "путь для поиска отправляемых файлов (если не задан полный путь)" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "заменять пробелы знаками подчёркивания при отправке файлов" diff --git a/po/weechat.pot b/po/weechat.pot index f55bc7033..8ca716869 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2008-05-07 13:30+0200\n" +"POT-Creation-Date: 2008-05-07 14:31+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3868,6 +3868,9 @@ msgstr "" msgid "path for reading files when sending (when no path is specified by user)" msgstr "" +msgid "use remote nick as prefix in local filename when receiving a file" +msgstr "" + msgid "convert spaces to underscores when sending files" msgstr "" diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index 915903070..93057eda8 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -54,6 +54,7 @@ struct t_config_option *xfer_config_network_own_ip; struct t_config_option *xfer_config_file_download_path; struct t_config_option *xfer_config_file_upload_path; +struct t_config_option *xfer_config_file_use_nick_in_filename; struct t_config_option *xfer_config_file_convert_spaces; struct t_config_option *xfer_config_file_auto_rename; struct t_config_option *xfer_config_file_auto_resume; @@ -255,6 +256,11 @@ xfer_config_init () N_("path for reading files when sending (when no path is " "specified by user)"), NULL, 0, 0, "~", NULL, NULL, NULL, NULL, NULL, NULL); + xfer_config_file_use_nick_in_filename = weechat_config_new_option ( + xfer_config_file, ptr_section, + "use_nick_in_filename", "boolean", + N_("use remote nick as prefix in local filename when receiving a file"), + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_convert_spaces = weechat_config_new_option ( xfer_config_file, ptr_section, "convert_spaces", "boolean", diff --git a/src/plugins/xfer/xfer-config.h b/src/plugins/xfer/xfer-config.h index 298529737..963d964ea 100644 --- a/src/plugins/xfer/xfer-config.h +++ b/src/plugins/xfer/xfer-config.h @@ -42,6 +42,7 @@ extern struct t_config_option *xfer_config_network_own_ip; extern struct t_config_option *xfer_config_file_download_path; extern struct t_config_option *xfer_config_file_upload_path; +extern struct t_config_option *xfer_config_file_use_nick_in_filename; extern struct t_config_option *xfer_config_file_convert_spaces; extern struct t_config_option *xfer_config_file_auto_rename; extern struct t_config_option *xfer_config_file_auto_resume; diff --git a/src/plugins/xfer/xfer-file.c b/src/plugins/xfer/xfer-file.c index fd72a8840..5e4841c54 100644 --- a/src/plugins/xfer/xfer-file.c +++ b/src/plugins/xfer/xfer-file.c @@ -111,8 +111,11 @@ xfer_file_find_filename (struct t_xfer *xfer) if (dir_separator && (xfer->local_filename[strlen (xfer->local_filename) - 1] != dir_separator[0])) strcat (xfer->local_filename, dir_separator); - strcat (xfer->local_filename, xfer->remote_nick); - strcat (xfer->local_filename, "."); + if (weechat_config_boolean (xfer_config_file_use_nick_in_filename)) + { + strcat (xfer->local_filename, xfer->remote_nick); + strcat (xfer->local_filename, "."); + } strcat (xfer->local_filename, xfer->filename); if (dir1)