diff --git a/po/POTFILES.in b/po/POTFILES.in index 6d3141416..516b9857d 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -48,8 +48,6 @@ ./src/gui/gtk/gui-gtk-nicklist.c ./src/gui/gtk/gui-gtk-status.c ./src/gui/gtk/gui-gtk-window.c -./src/gui/gui-action.c -./src/gui/gui-action.h ./src/gui/gui-bar.c ./src/gui/gui-bar.h ./src/gui/gui-bar-item.c diff --git a/po/cs.po b/po/cs.po index c334b9cbf..0f4a0ff11 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -38,7 +38,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -70,9 +69,6 @@ msgstr "nastaví konfigurační možnosti" msgid "%s internal commands:\n" msgstr "%s vnitřní příkazy:\n" -msgid "Internal key functions:\n" -msgstr "Vnitřní klávesové funkce:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -361,17 +357,13 @@ msgid "Buffer command history:" msgstr "zobrazit historii příkazů bufferu" #, fuzzy, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "Nová klávesová zkratka: %s" #, fuzzy msgid "Key bindings:" msgstr "Klávesové zkratky:\n" -#, fuzzy -msgid "Internal key functions:" -msgstr "Vnitřní klávesové funkce:\n" - #, fuzzy msgid "Default key bindings restored" msgstr "Výchozí klávesové zkratky obnoveny\n" @@ -389,10 +381,6 @@ msgstr "Klávesa \"%s\" odpojena\n" msgid "%sError: unable to unbind key \"%s\"" msgstr "%s nemohu odpojit klávesu \"%s\"\n" -#, fuzzy, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%s neznámá klávesová funkce \"%s\"\n" - #, fuzzy msgid "Key:" msgstr "Klávesa: \n" @@ -768,22 +756,28 @@ msgstr "" "clear: vyčistit historii\n" "value: číslo z položek historie kterou ukazat" +#, fuzzy +msgid "functions for command line" +msgstr "vložit řetězec na řádku" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "napojit/odpojit klávesy" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +#, fuzzy +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "" "[klávesa [funkce/příkaz]] [unbind klávesa] [functions] [call funkce " "[\"argumenty\"]] [reset -yes]" +#, fuzzy msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1620,6 +1614,10 @@ msgstr " . hodnoty: mezi %d a %d\n" msgid " . description: %s\n" msgstr " . popis: %s\n" +#, fuzzy, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%s příkaz \"%s\" selhal\n" + #, fuzzy, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%s alias nebo příkaz \"%s\" nenalezen\n" @@ -1779,122 +1777,10 @@ msgstr "%s nemohu přidat buffer do hotlistu\n" msgid "Error: not enough memory for infobar message" msgstr "%s nedostatek paměti pro infobar zprávu\n" -msgid "terminate line" -msgstr "uknočit řádek" - -msgid "complete word" -msgstr "dokončit slovo" - -msgid "find previous completion for word" -msgstr "najít předchozí doplnění pro slovo" - -msgid "delete previous char" -msgstr "smazat předchozí znak" - -msgid "delete next char" -msgstr "smazat další zank" - -msgid "delete until end of line" -msgstr "smazat do konce řádku" - -msgid "delete until beginning of line" -msgstr "smazat do začátku řádku" - -msgid "delete entire line" -msgstr "smazat celý řádek" - -msgid "delete previous word" -msgstr "smazat předchozí slovo" - -msgid "delete next word" -msgstr "smazat další slovo" - -msgid "paste current clipboard content" -msgstr "vložit aktuální obsah schránky" - -msgid "transpose chars" -msgstr "přesunout znaky" - -msgid "go to beginning of line" -msgstr "jdi na začátek řádky" - -msgid "go to end of line" -msgstr "jdi na konec řádky" - -msgid "move one char left" -msgstr "posuň jeden znak vlevo" - -msgid "move to previous word" -msgstr "posuň na předchozí slovo" - -msgid "move one char right" -msgstr "posuň jeden znak vpravo" - -msgid "move to next word" -msgstr "posuň na další slovo" - -msgid "call previous command in history" -msgstr "zavolej předchozí příkaz v historii" - -msgid "call previous command in global history" -msgstr "zavolej předchozí příkaz v globální historii" - -msgid "call next command in history" -msgstr "zavolej další příkaz v historii" - -msgid "call next command in global history" -msgstr "zavolej další příkaz v globální historii" - -msgid "jump to buffer with activity" -msgstr "skoč na buffer s aktivitou" - -msgid "jump to DCC buffer" -msgstr "skoč na DCC buffer" - -msgid "jump to last buffer" -msgstr "skoč na poslední buffer" - -msgid "jump to previous buffer" -msgstr "skoč na předchozí buffer" - -msgid "jump to server buffer" -msgstr "skoč na buffer serveru" - -msgid "jump to next server" -msgstr "skoč na další server" - -msgid "switch active server on servers buffer" -msgstr "přepnout aktivní server na buffer serverů" - -msgid "scroll to first unread line in buffer" -msgstr "přesunout na první nepřečtenout řádku v bufferu" - -msgid "set unread marker on all buffers" -msgstr "nastavit značku nečtení na všech bufferech" - -msgid "clear hotlist" -msgstr "vyčisti hotlist" - -msgid "clear infobar" -msgstr "vyčisti infobar" - -msgid "grab a key" -msgstr "zachytit klávesu" - -msgid "insert a string in command line" -msgstr "vložit řetězec na řádku" - -msgid "search text in buffer history" -msgstr "hledání textu v historii bufferu" - #, fuzzy, c-format msgid "Error: unable to bind key \"%s\"" msgstr "%s nemohu napojit kalávesu \"%s\"\n" -#, fuzzy, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "%s nemohu napojit kalávesu \"%s\" (nevalidní jméno funkce: \"%s\")\n" - #, fuzzy msgid "Error: not enough memory for key binding" msgstr "%s nedostatek paměti pro klávesovou zkratku\n" @@ -4566,6 +4452,127 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s špatné parametry pro příkaz \"%s\"\n" +#~ msgid "Internal key functions:\n" +#~ msgstr "Vnitřní klávesové funkce:\n" + +#, fuzzy +#~ msgid "Internal key functions:" +#~ msgstr "Vnitřní klávesové funkce:\n" + +#, fuzzy +#~ msgid "%sError: unknown key function \"%s\"" +#~ msgstr "%s neznámá klávesová funkce \"%s\"\n" + +#~ msgid "terminate line" +#~ msgstr "uknočit řádek" + +#~ msgid "complete word" +#~ msgstr "dokončit slovo" + +#~ msgid "find previous completion for word" +#~ msgstr "najít předchozí doplnění pro slovo" + +#~ msgid "delete previous char" +#~ msgstr "smazat předchozí znak" + +#~ msgid "delete next char" +#~ msgstr "smazat další zank" + +#~ msgid "delete until end of line" +#~ msgstr "smazat do konce řádku" + +#~ msgid "delete until beginning of line" +#~ msgstr "smazat do začátku řádku" + +#~ msgid "delete entire line" +#~ msgstr "smazat celý řádek" + +#~ msgid "delete previous word" +#~ msgstr "smazat předchozí slovo" + +#~ msgid "delete next word" +#~ msgstr "smazat další slovo" + +#~ msgid "paste current clipboard content" +#~ msgstr "vložit aktuální obsah schránky" + +#~ msgid "transpose chars" +#~ msgstr "přesunout znaky" + +#~ msgid "go to beginning of line" +#~ msgstr "jdi na začátek řádky" + +#~ msgid "go to end of line" +#~ msgstr "jdi na konec řádky" + +#~ msgid "move one char left" +#~ msgstr "posuň jeden znak vlevo" + +#~ msgid "move to previous word" +#~ msgstr "posuň na předchozí slovo" + +#~ msgid "move one char right" +#~ msgstr "posuň jeden znak vpravo" + +#~ msgid "move to next word" +#~ msgstr "posuň na další slovo" + +#~ msgid "call previous command in history" +#~ msgstr "zavolej předchozí příkaz v historii" + +#~ msgid "call previous command in global history" +#~ msgstr "zavolej předchozí příkaz v globální historii" + +#~ msgid "call next command in history" +#~ msgstr "zavolej další příkaz v historii" + +#~ msgid "call next command in global history" +#~ msgstr "zavolej další příkaz v globální historii" + +#~ msgid "jump to buffer with activity" +#~ msgstr "skoč na buffer s aktivitou" + +#~ msgid "jump to DCC buffer" +#~ msgstr "skoč na DCC buffer" + +#~ msgid "jump to last buffer" +#~ msgstr "skoč na poslední buffer" + +#~ msgid "jump to previous buffer" +#~ msgstr "skoč na předchozí buffer" + +#~ msgid "jump to server buffer" +#~ msgstr "skoč na buffer serveru" + +#~ msgid "jump to next server" +#~ msgstr "skoč na další server" + +#~ msgid "switch active server on servers buffer" +#~ msgstr "přepnout aktivní server na buffer serverů" + +#~ msgid "scroll to first unread line in buffer" +#~ msgstr "přesunout na první nepřečtenout řádku v bufferu" + +#~ msgid "set unread marker on all buffers" +#~ msgstr "nastavit značku nečtení na všech bufferech" + +#~ msgid "clear hotlist" +#~ msgstr "vyčisti hotlist" + +#~ msgid "clear infobar" +#~ msgstr "vyčisti infobar" + +#~ msgid "grab a key" +#~ msgstr "zachytit klávesu" + +#~ msgid "search text in buffer history" +#~ msgstr "hledání textu v historii bufferu" + +#, fuzzy +#~ msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" +#~ msgstr "" +#~ "%s nemohu napojit kalávesu \"%s\" (nevalidní jméno funkce: \"%s\")\n" + #, fuzzy #~ msgid "launch WeeChat builtin command (do not look at commands hooked)" #~ msgstr "" @@ -4762,10 +4769,6 @@ msgstr "%s špatné parametry pro příkaz \"%s\"\n" #~ msgid "%sError: wrong number \"%s\" for filter" #~ msgstr "%s špatný počet parametrů pro příkaz \"%s\"\n" -#, fuzzy -#~ msgid "%sError: command \"%s\" failed" -#~ msgstr "%s příkaz \"%s\" selhal\n" - #, fuzzy #~ msgid "%s%s: cannot identify channel for \"%s\" command" #~ msgstr "%s nemohu identifikovat kanál pro příkaz \"%s\"\n" diff --git a/po/de.po b/po/de.po index 26d750055..2fea70a2f 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Thomas Schuetz \n" "Language-Team: weechat-dev \n" @@ -42,7 +42,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -75,9 +74,6 @@ msgstr "Konfigurationsparameter setzen" msgid "%s internal commands:\n" msgstr "%s interne Befehle:\n" -msgid "Internal key functions:\n" -msgstr "Interne Tastenfunktionen:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -366,17 +362,13 @@ msgid "Buffer command history:" msgstr "zeigt Befehlsverlauf des Puffers" #, fuzzy, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "Neue Tastenbelegung: %s" #, fuzzy msgid "Key bindings:" msgstr "Tastenbelegungen:\n" -#, fuzzy -msgid "Internal key functions:" -msgstr "Interne Tastenfunktionen:\n" - #, fuzzy msgid "Default key bindings restored" msgstr "Standardtastenbelegungen wiederhergestellt\n" @@ -395,10 +387,6 @@ msgstr "Tastenbelegung \"%s\" gelöscht\n" msgid "%sError: unable to unbind key \"%s\"" msgstr "%s kann die Tastenbelegung \"%s\" nicht entfernen\n" -#, fuzzy, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%s unbekannte Tasten-Funktion \"%s\"\n" - #, fuzzy msgid "Key:" msgstr "Taste:\n" @@ -761,22 +749,28 @@ msgstr "" "clear: Löscht Verlauf\n" "Anzahl: zeigt die gewünschte Anzahl an Verlaufseinträgen" +#, fuzzy +msgid "functions for command line" +msgstr "füge eine Zeichenkette in der Befehlszeile ein" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "belegen/freigeben von Tasten" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +#, fuzzy +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "" "[Taste [Funktion/Befehl]] [unbind Taste] [functions] [call Funktion " "[\"Argumente\"]] [reset -yes] " +#, fuzzy msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1614,6 +1608,10 @@ msgstr " . Werte: zwischen %d und %d\n" msgid " . description: %s\n" msgstr " . Beschreibung: %s\n" +#, fuzzy, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%s der Befehl \"%s\" schlug fehl\n" + #, fuzzy, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%s Alias oder Befehl \"%s\" nicht gefunden\n" @@ -1780,125 +1778,10 @@ msgstr "%s Puffer kann nicht zur Hotlist hinzugefügt werden\n" msgid "Error: not enough memory for infobar message" msgstr "%s nicht genügend Speicher für Infobar-Nachricht\n" -msgid "terminate line" -msgstr "Zeile terminieren" - -msgid "complete word" -msgstr "Wort vervollständigen" - -msgid "find previous completion for word" -msgstr "finde letzte Wortvervollständigung" - -msgid "delete previous char" -msgstr "vorheriges Zeichen löschen" - -msgid "delete next char" -msgstr "nächstes Zeichen löschen" - -msgid "delete until end of line" -msgstr "bis zum Zeilenende löschen" - -msgid "delete until beginning of line" -msgstr "bis zum Zeilenanfang löschen" - -msgid "delete entire line" -msgstr "ganze Zeile löschen" - -msgid "delete previous word" -msgstr "vorheriges Wort löschen" - -msgid "delete next word" -msgstr "nächstes Wort löschen" - -msgid "paste current clipboard content" -msgstr "einfügen" - -msgid "transpose chars" -msgstr "Zeichen vertauschen" - -msgid "go to beginning of line" -msgstr "zum Zeilenanfang gehen" - -msgid "go to end of line" -msgstr "zum Zeilenende gehen" - -msgid "move one char left" -msgstr "ein Zeichen nach links gehen" - -msgid "move to previous word" -msgstr "ein Wort nach links gehen" - -msgid "move one char right" -msgstr "ein Zeichen nach rechts gehen" - -msgid "move to next word" -msgstr "ein Wort nach rechts gehen" - -msgid "call previous command in history" -msgstr "vorherigen Befehl aus dem Verlauf abfragen" - -msgid "call previous command in global history" -msgstr "vorherigen Befehl aus dem globalen Verlauf abfragen" - -msgid "call next command in history" -msgstr "nächsten Befehl aus dem Verlauf abfragen" - -msgid "call next command in global history" -msgstr "nächsten Befehl aus dem globalen Verlauf abfragen" - -msgid "jump to buffer with activity" -msgstr "zu nächstem aktiven Puffer springen" - -msgid "jump to DCC buffer" -msgstr "zum DCC-Puffer springen" - -msgid "jump to last buffer" -msgstr "zum letzten Puffer springen" - -#, fuzzy -msgid "jump to previous buffer" -msgstr "zum Serverpuffer springen" - -msgid "jump to server buffer" -msgstr "zum Serverpuffer springen" - -msgid "jump to next server" -msgstr "zum nächsten Server springen" - -msgid "switch active server on servers buffer" -msgstr "wechsel den aktiven Server im Server-Puffer" - -msgid "scroll to first unread line in buffer" -msgstr "scrolle zur ersten, ungelesenen Zeile im Puffer" - -#, fuzzy -msgid "set unread marker on all buffers" -msgstr "Fehlerhafte Pufferlänge" - -msgid "clear hotlist" -msgstr "Hotlist leeren" - -msgid "clear infobar" -msgstr "Infobar leeren" - -msgid "grab a key" -msgstr "Tastencode ermitteln und einfügen" - -msgid "insert a string in command line" -msgstr "füge eine Zeichenkette in der Befehlszeile ein" - -msgid "search text in buffer history" -msgstr "suche Text im Pufferverlauf" - #, fuzzy, c-format msgid "Error: unable to bind key \"%s\"" msgstr "%s kann die Taste \"%s\" nicht zuordnen\n" -#, fuzzy, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" -"%s kann die Taste \"%s\" nicht zuornen (ungültiger Funktionsname: \"%s\")\n" - #, fuzzy msgid "Error: not enough memory for key binding" msgstr "%s nicht genügend Speicher für Tastenzuordnung\n" @@ -4558,6 +4441,130 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" +#~ msgid "Internal key functions:\n" +#~ msgstr "Interne Tastenfunktionen:\n" + +#, fuzzy +#~ msgid "Internal key functions:" +#~ msgstr "Interne Tastenfunktionen:\n" + +#, fuzzy +#~ msgid "%sError: unknown key function \"%s\"" +#~ msgstr "%s unbekannte Tasten-Funktion \"%s\"\n" + +#~ msgid "terminate line" +#~ msgstr "Zeile terminieren" + +#~ msgid "complete word" +#~ msgstr "Wort vervollständigen" + +#~ msgid "find previous completion for word" +#~ msgstr "finde letzte Wortvervollständigung" + +#~ msgid "delete previous char" +#~ msgstr "vorheriges Zeichen löschen" + +#~ msgid "delete next char" +#~ msgstr "nächstes Zeichen löschen" + +#~ msgid "delete until end of line" +#~ msgstr "bis zum Zeilenende löschen" + +#~ msgid "delete until beginning of line" +#~ msgstr "bis zum Zeilenanfang löschen" + +#~ msgid "delete entire line" +#~ msgstr "ganze Zeile löschen" + +#~ msgid "delete previous word" +#~ msgstr "vorheriges Wort löschen" + +#~ msgid "delete next word" +#~ msgstr "nächstes Wort löschen" + +#~ msgid "paste current clipboard content" +#~ msgstr "einfügen" + +#~ msgid "transpose chars" +#~ msgstr "Zeichen vertauschen" + +#~ msgid "go to beginning of line" +#~ msgstr "zum Zeilenanfang gehen" + +#~ msgid "go to end of line" +#~ msgstr "zum Zeilenende gehen" + +#~ msgid "move one char left" +#~ msgstr "ein Zeichen nach links gehen" + +#~ msgid "move to previous word" +#~ msgstr "ein Wort nach links gehen" + +#~ msgid "move one char right" +#~ msgstr "ein Zeichen nach rechts gehen" + +#~ msgid "move to next word" +#~ msgstr "ein Wort nach rechts gehen" + +#~ msgid "call previous command in history" +#~ msgstr "vorherigen Befehl aus dem Verlauf abfragen" + +#~ msgid "call previous command in global history" +#~ msgstr "vorherigen Befehl aus dem globalen Verlauf abfragen" + +#~ msgid "call next command in history" +#~ msgstr "nächsten Befehl aus dem Verlauf abfragen" + +#~ msgid "call next command in global history" +#~ msgstr "nächsten Befehl aus dem globalen Verlauf abfragen" + +#~ msgid "jump to buffer with activity" +#~ msgstr "zu nächstem aktiven Puffer springen" + +#~ msgid "jump to DCC buffer" +#~ msgstr "zum DCC-Puffer springen" + +#~ msgid "jump to last buffer" +#~ msgstr "zum letzten Puffer springen" + +#, fuzzy +#~ msgid "jump to previous buffer" +#~ msgstr "zum Serverpuffer springen" + +#~ msgid "jump to server buffer" +#~ msgstr "zum Serverpuffer springen" + +#~ msgid "jump to next server" +#~ msgstr "zum nächsten Server springen" + +#~ msgid "switch active server on servers buffer" +#~ msgstr "wechsel den aktiven Server im Server-Puffer" + +#~ msgid "scroll to first unread line in buffer" +#~ msgstr "scrolle zur ersten, ungelesenen Zeile im Puffer" + +#, fuzzy +#~ msgid "set unread marker on all buffers" +#~ msgstr "Fehlerhafte Pufferlänge" + +#~ msgid "clear hotlist" +#~ msgstr "Hotlist leeren" + +#~ msgid "clear infobar" +#~ msgstr "Infobar leeren" + +#~ msgid "grab a key" +#~ msgstr "Tastencode ermitteln und einfügen" + +#~ msgid "search text in buffer history" +#~ msgstr "suche Text im Pufferverlauf" + +#, fuzzy +#~ msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" +#~ msgstr "" +#~ "%s kann die Taste \"%s\" nicht zuornen (ungültiger Funktionsname: \"%s" +#~ "\")\n" + #, fuzzy #~ msgid "launch WeeChat builtin command (do not look at commands hooked)" #~ msgstr "" @@ -4753,10 +4760,6 @@ msgstr "%s fehlerhafte Argumente für der \"%s\"-Befehl\n" #~ msgid "%sError: wrong number \"%s\" for filter" #~ msgstr "%s fehlerhafte Anzahl von Argumenten für der \"%s\"-Befehl\n" -#, fuzzy -#~ msgid "%sError: command \"%s\" failed" -#~ msgstr "%s der Befehl \"%s\" schlug fehl\n" - #, fuzzy #~ msgid "%s%s: cannot identify channel for \"%s\" command" #~ msgstr "%s kann für den \"%s\"-Befehl keinen Channel identifizieren\n" diff --git a/po/es.po b/po/es.po index 11cf0538f..8e32b36f5 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: 2007-09-19 12:09+0200\n" "Last-Translator: Roberto González Cardenete \n" "Language-Team: weechat-dev \n" @@ -38,7 +38,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -72,9 +71,6 @@ msgstr "poner opciones de configuración" msgid "%s internal commands:\n" msgstr "Comandos internos %s :\n" -msgid "Internal key functions:\n" -msgstr "Funciones de clave internas:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -362,17 +358,13 @@ msgid "Buffer command history:" msgstr "mostrar historial de comandos de búfer" #, fuzzy, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "Nueva anclaje de clave: %s" #, fuzzy msgid "Key bindings:" msgstr "Anclajes de clave:\n" -#, fuzzy -msgid "Internal key functions:" -msgstr "Funciones de clave internas:\n" - #, fuzzy msgid "Default key bindings restored" msgstr "Anclajes de clave por defecto restaurados\n" @@ -391,10 +383,6 @@ msgstr "Clave \"%s\" desatada\n" msgid "%sError: unable to unbind key \"%s\"" msgstr "%s No ha sido posible desatar la clave \"%s\"\n" -#, fuzzy, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%s opción desconocida para el comando \"%s\"\n" - msgid "Key:" msgstr "" @@ -757,22 +745,26 @@ msgstr "" "limpiar: limpiar historial\n" "valor: número de entradas del historial para mostrar" +#, fuzzy +msgid "functions for command line" +msgstr "%s opción desconocida para el comando \"%s\"\n" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "atar/desatar claves" #, fuzzy -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "[clave función/comando] [desatar clave] [funciones] [reset -yes]" #, fuzzy msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1605,6 +1597,10 @@ msgstr " . valores: entre %d y %d\n" msgid " . description: %s\n" msgstr " . descripción: %s\n" +#, fuzzy, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%s el comando \"%s\" ha fallado\n" + #, fuzzy, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%s alias o comando \"%s\" no encontrado\n" @@ -1766,127 +1762,10 @@ msgid "Error: not enough memory for infobar message" msgstr "" "No hay suficiente memoria para el mensaje de la barra de información\n" -msgid "terminate line" -msgstr "terminar línea" - -msgid "complete word" -msgstr "completar palabra" - -msgid "find previous completion for word" -msgstr "" - -msgid "delete previous char" -msgstr "borrar el carácter anterior" - -msgid "delete next char" -msgstr "borrar el carácter siguiente" - -msgid "delete until end of line" -msgstr "borrar hasta fin de línea" - -msgid "delete until beginning of line" -msgstr "borrar hasta principio de línea" - -msgid "delete entire line" -msgstr "borrar línea entera" - -msgid "delete previous word" -msgstr "borrar la palabra anterior" - -msgid "delete next word" -msgstr "borrar la palabra siguiente" - -msgid "paste current clipboard content" -msgstr "pegar el contenido actual del portapapeles" - -msgid "transpose chars" -msgstr "transponer caracteres" - -msgid "go to beginning of line" -msgstr "ir al principio de línea" - -msgid "go to end of line" -msgstr "ir al final de línea" - -msgid "move one char left" -msgstr "mover un carácter a la izquierda" - -msgid "move to previous word" -msgstr "mover a la palabra anterior" - -msgid "move one char right" -msgstr "mover un carácter a la derecha" - -msgid "move to next word" -msgstr "mover a la palabra siguiente" - -msgid "call previous command in history" -msgstr "llamar al comando anterior en el historial" - -msgid "call previous command in global history" -msgstr "llamar al comando anterior en el historial global" - -msgid "call next command in history" -msgstr "llamar al comando siguiente en el historial" - -msgid "call next command in global history" -msgstr "llamar al comando siguiente en el historial global" - -msgid "jump to buffer with activity" -msgstr "saltar al búfer con actividad" - -msgid "jump to DCC buffer" -msgstr "saltar al búfer DCC" - -msgid "jump to last buffer" -msgstr "saltar al último búfer" - -#, fuzzy -msgid "jump to previous buffer" -msgstr "saltar al búfer del servidor" - -msgid "jump to server buffer" -msgstr "saltar al búfer del servidor" - -msgid "jump to next server" -msgstr "saltar al servidor siguiente" - -msgid "switch active server on servers buffer" -msgstr "seleccionar servidor activo en el búfer de servidores" - -msgid "scroll to first unread line in buffer" -msgstr "desplazarse a la primera línea sin leer en el búfer" - -#, fuzzy -msgid "set unread marker on all buffers" -msgstr "longitud inválida para un búfer" - -msgid "clear hotlist" -msgstr "limpiar hotlist" - -msgid "clear infobar" -msgstr "limpiar barra de información" - -msgid "grab a key" -msgstr "capturar una clave" - -msgid "insert a string in command line" -msgstr "" - -#, fuzzy -msgid "search text in buffer history" -msgstr "sesión: cargando historial del búfer\n" - #, fuzzy, c-format msgid "Error: unable to bind key \"%s\"" msgstr "%s No ha sido posible atar la clave \"%s\"\n" -#, fuzzy, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" -"%s No ha sido posible atar la clave \"%s\" (nombre de función inválido: \"%" -"s\")\n" - #, fuzzy msgid "Error: not enough memory for key binding" msgstr "%s no hay suficiente memoria para atar la clave\n" @@ -4570,6 +4449,128 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s argumentos incorrectos para el comando \"%s\"\n" +#~ msgid "Internal key functions:\n" +#~ msgstr "Funciones de clave internas:\n" + +#, fuzzy +#~ msgid "Internal key functions:" +#~ msgstr "Funciones de clave internas:\n" + +#, fuzzy +#~ msgid "%sError: unknown key function \"%s\"" +#~ msgstr "%s opción desconocida para el comando \"%s\"\n" + +#~ msgid "terminate line" +#~ msgstr "terminar línea" + +#~ msgid "complete word" +#~ msgstr "completar palabra" + +#~ msgid "delete previous char" +#~ msgstr "borrar el carácter anterior" + +#~ msgid "delete next char" +#~ msgstr "borrar el carácter siguiente" + +#~ msgid "delete until end of line" +#~ msgstr "borrar hasta fin de línea" + +#~ msgid "delete until beginning of line" +#~ msgstr "borrar hasta principio de línea" + +#~ msgid "delete entire line" +#~ msgstr "borrar línea entera" + +#~ msgid "delete previous word" +#~ msgstr "borrar la palabra anterior" + +#~ msgid "delete next word" +#~ msgstr "borrar la palabra siguiente" + +#~ msgid "paste current clipboard content" +#~ msgstr "pegar el contenido actual del portapapeles" + +#~ msgid "transpose chars" +#~ msgstr "transponer caracteres" + +#~ msgid "go to beginning of line" +#~ msgstr "ir al principio de línea" + +#~ msgid "go to end of line" +#~ msgstr "ir al final de línea" + +#~ msgid "move one char left" +#~ msgstr "mover un carácter a la izquierda" + +#~ msgid "move to previous word" +#~ msgstr "mover a la palabra anterior" + +#~ msgid "move one char right" +#~ msgstr "mover un carácter a la derecha" + +#~ msgid "move to next word" +#~ msgstr "mover a la palabra siguiente" + +#~ msgid "call previous command in history" +#~ msgstr "llamar al comando anterior en el historial" + +#~ msgid "call previous command in global history" +#~ msgstr "llamar al comando anterior en el historial global" + +#~ msgid "call next command in history" +#~ msgstr "llamar al comando siguiente en el historial" + +#~ msgid "call next command in global history" +#~ msgstr "llamar al comando siguiente en el historial global" + +#~ msgid "jump to buffer with activity" +#~ msgstr "saltar al búfer con actividad" + +#~ msgid "jump to DCC buffer" +#~ msgstr "saltar al búfer DCC" + +#~ msgid "jump to last buffer" +#~ msgstr "saltar al último búfer" + +#, fuzzy +#~ msgid "jump to previous buffer" +#~ msgstr "saltar al búfer del servidor" + +#~ msgid "jump to server buffer" +#~ msgstr "saltar al búfer del servidor" + +#~ msgid "jump to next server" +#~ msgstr "saltar al servidor siguiente" + +#~ msgid "switch active server on servers buffer" +#~ msgstr "seleccionar servidor activo en el búfer de servidores" + +#~ msgid "scroll to first unread line in buffer" +#~ msgstr "desplazarse a la primera línea sin leer en el búfer" + +#, fuzzy +#~ msgid "set unread marker on all buffers" +#~ msgstr "longitud inválida para un búfer" + +#~ msgid "clear hotlist" +#~ msgstr "limpiar hotlist" + +#~ msgid "clear infobar" +#~ msgstr "limpiar barra de información" + +#~ msgid "grab a key" +#~ msgstr "capturar una clave" + +#, fuzzy +#~ msgid "search text in buffer history" +#~ msgstr "sesión: cargando historial del búfer\n" + +#, fuzzy +#~ msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" +#~ msgstr "" +#~ "%s No ha sido posible atar la clave \"%s\" (nombre de función inválido: " +#~ "\"%s\")\n" + #, fuzzy #~ msgid "launch WeeChat builtin command (do not look at commands hooked)" #~ msgstr "" @@ -4766,10 +4767,6 @@ msgstr "%s argumentos incorrectos para el comando \"%s\"\n" #~ msgid "%sError: wrong number \"%s\" for filter" #~ msgstr "%s número de argumentos incorrecto para el comando \"%s\"\n" -#, fuzzy -#~ msgid "%sError: command \"%s\" failed" -#~ msgstr "%s el comando \"%s\" ha fallado\n" - #, fuzzy #~ msgid "%s%s: cannot identify channel for \"%s\" command" #~ msgstr "%s no es posible identificar el canal para el comando \"%s\"\n" diff --git a/po/fr.po b/po/fr.po index 45e4c7c70..98dd4d903 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-04-29 13:16+0200\n" -"PO-Revision-Date: 2008-04-29 13:17+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" +"PO-Revision-Date: 2008-04-29 18:22+0200\n" "Last-Translator: FlashCode \n" "Language-Team: weechat-dev \n" "MIME-Version: 1.0\n" @@ -37,7 +37,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -51,8 +50,6 @@ msgstr "" " -c, --config afficher les options du fichier de configuration\n" " -d, --dir définir le répertoire de base pour WeeChat " "(défaut: ~/.weechat)\n" -" -f, --key-functions afficher les fonctions internes WeeChat pour les " -"touches\n" " -h, --help cette aide\n" " -k, --keys afficher les touches WeeChat par défaut\n" " -l, --license afficher la licence WeeChat\n" @@ -70,9 +67,6 @@ msgstr "Options de configuration %s:\n" msgid "%s internal commands:\n" msgstr "Commandes internes %s:\n" -msgid "Internal key functions:\n" -msgstr "Fonctions internes pour les touches:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -335,15 +329,12 @@ msgid "Buffer command history:" msgstr "Historique des commandes du tampon:" #, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" -msgstr "Nouvelle touche: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" +msgstr "Nouvelle touche: %s%s => %s%s" msgid "Key bindings:" msgstr "Associations de touches:" -msgid "Internal key functions:" -msgstr "Fonctions internes pour les touches:" - msgid "Default key bindings restored" msgstr "Touches par défaut restaurées" @@ -361,10 +352,6 @@ msgstr "Touche \"%s\" supprimée" msgid "%sError: unable to unbind key \"%s\"" msgstr "%sErreur: impossible de supprimer la touche \"%s\"" -#, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%sErreur: fonction de touche \"%s\" inconnue" - msgid "Key:" msgstr "Touche:" @@ -760,31 +747,28 @@ msgstr "" "clear: effacer l'historique\n" "valeur: nombre d'entrées dans l'historique à afficher" +msgid "functions for command line" +msgstr "fonctions pour la ligne de commande" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "Cette commande est utilisée par les associations de touches ou les extensions, elle ne doit PAS être appelée par l'utilisateur" + msgid "bind/unbind keys" msgstr "associer/libérer des touches" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" -msgstr "" -"[touche [fonction/commande]] [unbind touche] [functions] [call fonction " -"[\"params\"]] [reset -yes]" +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" +msgstr "[touche [commande [args]]] | [unbind touche] | [reset -yes]" msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" -" touche: voir ou associer cette touche à une fonction interne ou une " -"commande (commençant par \"/\")\n" +" touche: voir ou associer cette touche à une commande\n" " unbind: supprimer l'association à une touche\n" -"functions: lister la liste des fonctions internes pour les associations de " -"touches\n" -" call: appeler une foonction par son nom (avec paramètres optionnels)\n" " reset: restaure les touches aux valeurs par défaut et supprime TOUTES " "les touches personnelles (utiliser avec précaution !)" @@ -1553,6 +1537,10 @@ msgstr " . valeurs: couleur (dépend de l'interface utilisée)\n" msgid " . description: %s\n" msgstr " . description: %s\n" +#, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%sErreur: la commande \"%s\" est en cours d'exécution" + #, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%sErreur: commande \"%s\" inconnue (tapez /help pour l'aide)" @@ -1652,7 +1640,9 @@ msgstr "" "en recréer une autre pour faire cela" msgid "bar priority (high number means bar displayed first)" -msgstr "priorité de la barre (un nombre élevé signifie que la barre est affichée en premier)" +msgstr "" +"priorité de la barre (un nombre élevé signifie que la barre est affichée en " +"premier)" msgid "bar type (root, window, window_active, window_inactive)" msgstr "type de barre (root, window, window_active, window_inactive)" @@ -1710,123 +1700,10 @@ msgstr "Erreur: impossible d'ajouter le tampon à la liste des tampons actifs" msgid "Error: not enough memory for infobar message" msgstr "Erreur: pas assez de mémoire pour un message de la barre d'infos" -msgid "terminate line" -msgstr "terminer la ligne" - -msgid "complete word" -msgstr "compléter le mot" - -msgid "find previous completion for word" -msgstr "trouver le mot complété précédent" - -msgid "delete previous char" -msgstr "effacer le caractère précédent" - -msgid "delete next char" -msgstr "effacer le caractère suivant" - -msgid "delete until end of line" -msgstr "effacer jusqu'à la fin de la ligne" - -msgid "delete until beginning of line" -msgstr "effacer jusqu'au début de la ligne" - -msgid "delete entire line" -msgstr "effacer la ligne entière" - -msgid "delete previous word" -msgstr "effacer le mot précédent" - -msgid "delete next word" -msgstr "effacer le mot suivant" - -msgid "paste current clipboard content" -msgstr "coller le contenu du presse-papier" - -msgid "transpose chars" -msgstr "inverser les caractères" - -msgid "go to beginning of line" -msgstr "aller au début de la ligne" - -msgid "go to end of line" -msgstr "aller à la fin de la ligne" - -msgid "move one char left" -msgstr "se déplacer d'un caractère à gauche" - -msgid "move to previous word" -msgstr "se déplacer au mot précédent" - -msgid "move one char right" -msgstr "se déplacer d'un caractère à droite" - -msgid "move to next word" -msgstr "se déplacer au mot suivant" - -msgid "call previous command in history" -msgstr "appeler la commande précédente dans l'historique" - -msgid "call previous command in global history" -msgstr "appeler la commande précédente dans l'historique global" - -msgid "call next command in history" -msgstr "appeler la commande suivante dans l'historique" - -msgid "call next command in global history" -msgstr "appeler la commande suivante dans l'historique global" - -msgid "jump to buffer with activity" -msgstr "sauter au tampon avec de l'activité" - -msgid "jump to DCC buffer" -msgstr "sauter au tampon DCC" - -msgid "jump to last buffer" -msgstr "sauter au dernier tampon" - -msgid "jump to previous buffer" -msgstr "sauter au tampon précédent" - -msgid "jump to server buffer" -msgstr "sauter au tampon du serveur" - -msgid "jump to next server" -msgstr "sauter au prochain serveur" - -msgid "switch active server on servers buffer" -msgstr "bascule de serveur actif sur le tampon des serveurs" - -msgid "scroll to first unread line in buffer" -msgstr "faire défiler jusqu'à la première ligne non lue du tampon" - -msgid "set unread marker on all buffers" -msgstr "positionner le marqueur de données non lues sur tous les tampons" - -msgid "clear hotlist" -msgstr "effacer la liste d'activité" - -msgid "clear infobar" -msgstr "effacer la barre d'infos" - -msgid "grab a key" -msgstr "capturer une touche" - -msgid "insert a string in command line" -msgstr "insérer une chaîne dans la ligne de commande" - -msgid "search text in buffer history" -msgstr "recherche de texte dans l'historique du tampon" - #, c-format msgid "Error: unable to bind key \"%s\"" msgstr "Erreur: impossible de créer la touche \"%s\"" -#, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" -"Erreur: impossible de créer la touche \"%s\" (nom fonction incorrect: \"%s\")" - msgid "Error: not enough memory for key binding" msgstr "Erreur: pas assez de mémoire pour la touche" @@ -4525,11 +4402,3 @@ msgstr "" #, c-format msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s%s: paramètres invalides pour la fonction \"%s\"" - -#~ msgid "launch WeeChat builtin command (do not look at commands hooked)" -#~ msgstr "" -#~ "lance une commande WeeChat interne (sans regarder les commandes " -#~ "accrochées)" - -#~ msgid "command" -#~ msgstr "commande" diff --git a/po/hu.po b/po/hu.po index 5ff437dfa..1b00e471c 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: 2007-10-10 18:07+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -44,7 +44,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -76,9 +75,6 @@ msgstr "konfigurációs paraméterek beállítása" msgid "%s internal commands:\n" msgstr "%s belső parancsok:\n" -msgid "Internal key functions:\n" -msgstr "Belső billentyűfunkciók:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -365,17 +361,13 @@ msgid "Buffer command history:" msgstr "a pufferben kiadott parancsok előzményének mutatása" #, fuzzy, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "Új billentyűparancs: %s" #, fuzzy msgid "Key bindings:" msgstr "Billentyűparancsok:\n" -#, fuzzy -msgid "Internal key functions:" -msgstr "Belső billentyűfunkciók:\n" - #, fuzzy msgid "Default key bindings restored" msgstr "Alapértelmezett billentyűparancsok visszaállítva\n" @@ -394,10 +386,6 @@ msgstr "A(z) \"%s\" billentyűparancs visszavonva\n" msgid "%sError: unable to unbind key \"%s\"" msgstr "%s nem sikerült a(z) \"%s\" billentyűparancsot visszavonni\n" -#, fuzzy, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%s ismeretlen billentyűparancs \"%s\"\n" - #, fuzzy msgid "Key:" msgstr "Billentyű:\n" @@ -774,22 +762,28 @@ msgstr "" "clear: előzmények törlése\n" "érték: mutatandó előzmények száma" +#, fuzzy +msgid "functions for command line" +msgstr "szöveg beillesztése a parancssorba" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "billentyűk hozzárendelése/hozzárendelés eltávolítása" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +#, fuzzy +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "" "[billentyű [funkció/parancs]] [unbind billentyű] [funkciók] [call funkció " "[\"paraméterek\"]] [reset -yes]" +#, fuzzy msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1623,6 +1617,10 @@ msgstr " . értékek: %d és %d között\n" msgid " . description: %s\n" msgstr " . leírás : %s\n" +#, fuzzy, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%s a \"%s\" parancs végrehajtása sikertelen\n" + #, fuzzy, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%s a \"%s\" aliasz vagy parancs nem található\n" @@ -1781,124 +1779,10 @@ msgstr "%s nincs elég memória az ignore elkészítéséhez\n" msgid "Error: not enough memory for infobar message" msgstr "%s nincs elég memória az információs pult üzenethez\n" -msgid "terminate line" -msgstr "sor megszakítása" - -msgid "complete word" -msgstr "szó kiegészítése" - -msgid "find previous completion for word" -msgstr "előző kiegészítés keresése a szóhoz" - -msgid "delete previous char" -msgstr "előző karakter törlése" - -msgid "delete next char" -msgstr "következő karakter törlése" - -msgid "delete until end of line" -msgstr "törlés a sor végéig" - -msgid "delete until beginning of line" -msgstr "törlés a sor elejéig" - -msgid "delete entire line" -msgstr "egész sor törlése" - -msgid "delete previous word" -msgstr "előző szó törlése" - -msgid "delete next word" -msgstr "következő szó törlése" - -msgid "paste current clipboard content" -msgstr "következő vágólapelem beillesztése" - -msgid "transpose chars" -msgstr "karakterek felcserélése" - -msgid "go to beginning of line" -msgstr "ugrás a sor elejére" - -msgid "go to end of line" -msgstr "ugrás a sor végére" - -msgid "move one char left" -msgstr "egy karaktert balra" - -msgid "move to previous word" -msgstr "ugrás az előző szóra" - -msgid "move one char right" -msgstr "egy karaktert balra" - -msgid "move to next word" -msgstr "ugrás a következő szóra" - -msgid "call previous command in history" -msgstr "előző parancs hívása az előzményekből" - -msgid "call previous command in global history" -msgstr "előző parancs hívása a globális előzményekből" - -msgid "call next command in history" -msgstr "kövezkező parancs hívása az előzményekből" - -msgid "call next command in global history" -msgstr "következő parancs hívása a globális előzményekből" - -msgid "jump to buffer with activity" -msgstr "ugrás aktív pufferre" - -msgid "jump to DCC buffer" -msgstr "ugrás a DCC pufferre" - -msgid "jump to last buffer" -msgstr "ugrás az utolsó pufferre" - -msgid "jump to previous buffer" -msgstr "ugrás az előző pufferre" - -msgid "jump to server buffer" -msgstr "ugrás a szerver pufferre" - -msgid "jump to next server" -msgstr "ugrás a következő szerverre" - -msgid "switch active server on servers buffer" -msgstr "aktív szerverek változtatása a szerver pufferben" - -msgid "scroll to first unread line in buffer" -msgstr "ugrás az első olvasatlan sorra a pufferben" - -msgid "set unread marker on all buffers" -msgstr "olvasatlan jelölő bekapcsolása az összes pufferen" - -msgid "clear hotlist" -msgstr "hotlist törlése" - -msgid "clear infobar" -msgstr "információs pult törlése" - -msgid "grab a key" -msgstr "vállasszon billentyűt" - -msgid "insert a string in command line" -msgstr "szöveg beillesztése a parancssorba" - -msgid "search text in buffer history" -msgstr "szöveg keresése a puffertörténetben" - #, fuzzy, c-format msgid "Error: unable to bind key \"%s\"" msgstr "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni\n" -#, fuzzy, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" -"%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni (érvénytelen " -"funkciónév: \"%s\")\n" - #, fuzzy msgid "Error: not enough memory for key binding" msgstr "%s nincs elég memória a billentyűhozzárendeléshez\n" @@ -4572,6 +4456,128 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s rossz argumentum a \"%s\" parancsnak\n" +#~ msgid "Internal key functions:\n" +#~ msgstr "Belső billentyűfunkciók:\n" + +#, fuzzy +#~ msgid "Internal key functions:" +#~ msgstr "Belső billentyűfunkciók:\n" + +#, fuzzy +#~ msgid "%sError: unknown key function \"%s\"" +#~ msgstr "%s ismeretlen billentyűparancs \"%s\"\n" + +#~ msgid "terminate line" +#~ msgstr "sor megszakítása" + +#~ msgid "complete word" +#~ msgstr "szó kiegészítése" + +#~ msgid "find previous completion for word" +#~ msgstr "előző kiegészítés keresése a szóhoz" + +#~ msgid "delete previous char" +#~ msgstr "előző karakter törlése" + +#~ msgid "delete next char" +#~ msgstr "következő karakter törlése" + +#~ msgid "delete until end of line" +#~ msgstr "törlés a sor végéig" + +#~ msgid "delete until beginning of line" +#~ msgstr "törlés a sor elejéig" + +#~ msgid "delete entire line" +#~ msgstr "egész sor törlése" + +#~ msgid "delete previous word" +#~ msgstr "előző szó törlése" + +#~ msgid "delete next word" +#~ msgstr "következő szó törlése" + +#~ msgid "paste current clipboard content" +#~ msgstr "következő vágólapelem beillesztése" + +#~ msgid "transpose chars" +#~ msgstr "karakterek felcserélése" + +#~ msgid "go to beginning of line" +#~ msgstr "ugrás a sor elejére" + +#~ msgid "go to end of line" +#~ msgstr "ugrás a sor végére" + +#~ msgid "move one char left" +#~ msgstr "egy karaktert balra" + +#~ msgid "move to previous word" +#~ msgstr "ugrás az előző szóra" + +#~ msgid "move one char right" +#~ msgstr "egy karaktert balra" + +#~ msgid "move to next word" +#~ msgstr "ugrás a következő szóra" + +#~ msgid "call previous command in history" +#~ msgstr "előző parancs hívása az előzményekből" + +#~ msgid "call previous command in global history" +#~ msgstr "előző parancs hívása a globális előzményekből" + +#~ msgid "call next command in history" +#~ msgstr "kövezkező parancs hívása az előzményekből" + +#~ msgid "call next command in global history" +#~ msgstr "következő parancs hívása a globális előzményekből" + +#~ msgid "jump to buffer with activity" +#~ msgstr "ugrás aktív pufferre" + +#~ msgid "jump to DCC buffer" +#~ msgstr "ugrás a DCC pufferre" + +#~ msgid "jump to last buffer" +#~ msgstr "ugrás az utolsó pufferre" + +#~ msgid "jump to previous buffer" +#~ msgstr "ugrás az előző pufferre" + +#~ msgid "jump to server buffer" +#~ msgstr "ugrás a szerver pufferre" + +#~ msgid "jump to next server" +#~ msgstr "ugrás a következő szerverre" + +#~ msgid "switch active server on servers buffer" +#~ msgstr "aktív szerverek változtatása a szerver pufferben" + +#~ msgid "scroll to first unread line in buffer" +#~ msgstr "ugrás az első olvasatlan sorra a pufferben" + +#~ msgid "set unread marker on all buffers" +#~ msgstr "olvasatlan jelölő bekapcsolása az összes pufferen" + +#~ msgid "clear hotlist" +#~ msgstr "hotlist törlése" + +#~ msgid "clear infobar" +#~ msgstr "információs pult törlése" + +#~ msgid "grab a key" +#~ msgstr "vállasszon billentyűt" + +#~ msgid "search text in buffer history" +#~ msgstr "szöveg keresése a puffertörténetben" + +#, fuzzy +#~ msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" +#~ msgstr "" +#~ "%s nem sikerült a(z) \"%s\" billentyűt hozzárendelni (érvénytelen " +#~ "funkciónév: \"%s\")\n" + #, fuzzy #~ msgid "launch WeeChat builtin command (do not look at commands hooked)" #~ msgstr "" @@ -4768,10 +4774,6 @@ msgstr "%s rossz argumentum a \"%s\" parancsnak\n" #~ msgid "%sError: wrong number \"%s\" for filter" #~ msgstr "%s rossz argumentum szám a \"%s\" parancsnak\n" -#, fuzzy -#~ msgid "%sError: command \"%s\" failed" -#~ msgstr "%s a \"%s\" parancs végrehajtása sikertelen\n" - #, fuzzy #~ msgid "%s%s: cannot identify channel for \"%s\" command" #~ msgstr "%s nem sikerült azonosítani a szobát a \"%s\" parancshoz\n" diff --git a/po/ru.po b/po/ru.po index 9b4c8e8cc..f979bc23b 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: 2007-09-06 12:44+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -39,7 +39,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -72,9 +71,6 @@ msgstr "настроить параметры конфигурации" msgid "%s internal commands:\n" msgstr "Внутренние команды %s:\n" -msgid "Internal key functions:\n" -msgstr "Встроенные функции клавиш:\n" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -363,17 +359,13 @@ msgid "Buffer command history:" msgstr "показать историю буфера команд" #, fuzzy, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "Новая комбинация клавиш: %s" #, fuzzy msgid "Key bindings:" msgstr "Комбинации клавиш:\n" -#, fuzzy -msgid "Internal key functions:" -msgstr "Встроенные функции клавиш:\n" - #, fuzzy msgid "Default key bindings restored" msgstr "Комбинации клавиш по умолчанию восстановлены\n" @@ -391,10 +383,6 @@ msgstr "Клавиша \"%s\" не привязана\n" msgid "%sError: unable to unbind key \"%s\"" msgstr "%s не могу отвязать клавишу \"%s\"\n" -#, fuzzy, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "%s неизвестная функция клавиши \"%s\"\n" - #, fuzzy msgid "Key:" msgstr "Клавиша:\n" @@ -770,22 +758,28 @@ msgstr "" " clear: очистить историю\n" "значение: количество отображаемых пунктов истории" +#, fuzzy +msgid "functions for command line" +msgstr "вставить строку в поле ввода" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "установить/снять клавиши" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +#, fuzzy +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "" "[клавиша [функция/команда]] [unbind клавиша] [функции] [call функция " "[\"аргументы\"]] [reset -yes]" +#, fuzzy msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1626,6 +1620,10 @@ msgstr " . значения: от %d до %d\n" msgid " . description: %s\n" msgstr " . описание: %s\n" +#, fuzzy, c-format +msgid "%sError: command \"%s\" is running" +msgstr "%s команда \"%s\" не удалась\n" + #, fuzzy, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "%s сокращение или команда \"%s\" не найдены\n" @@ -1788,124 +1786,10 @@ msgstr "%s не могу добавить буфер в хотлист\n" msgid "Error: not enough memory for infobar message" msgstr "%s недостаточно памяти для сообщения в строке информации\n" -msgid "terminate line" -msgstr "удалить строку" - -msgid "complete word" -msgstr "завершить слово" - -msgid "find previous completion for word" -msgstr "найти предыдущее дополнение слова" - -msgid "delete previous char" -msgstr "стереть предыдущий символ" - -msgid "delete next char" -msgstr "стереть следующий символ" - -msgid "delete until end of line" -msgstr "стереть до конца строки" - -msgid "delete until beginning of line" -msgstr "стереть до начала строки" - -msgid "delete entire line" -msgstr "стереть всю строку" - -msgid "delete previous word" -msgstr "стереть предыдущее слово" - -msgid "delete next word" -msgstr "стереть следующее слово" - -msgid "paste current clipboard content" -msgstr "вставить содержимое буфера обмена" - -msgid "transpose chars" -msgstr "развернуть символы" - -msgid "go to beginning of line" -msgstr "перейти к началу строки" - -msgid "go to end of line" -msgstr "перейти к концу строки" - -msgid "move one char left" -msgstr "перейти на 1 символ влево" - -msgid "move to previous word" -msgstr "перейти к предыдущему слову" - -msgid "move one char right" -msgstr "перейти на 1 символ вправо" - -msgid "move to next word" -msgstr "перейти к следующему слову" - -msgid "call previous command in history" -msgstr "вызвать предыдущую команду из истории" - -msgid "call previous command in global history" -msgstr "вызвать предыдущую команду из глобальной истории" - -msgid "call next command in history" -msgstr "вызвать следующую команду из истории" - -msgid "call next command in global history" -msgstr "вызвать следующую команду из глобальной истории" - -msgid "jump to buffer with activity" -msgstr "перейти к буферу с активностью:" - -msgid "jump to DCC buffer" -msgstr "перейти к буферу DCC" - -msgid "jump to last buffer" -msgstr "перейти к последнему буферу" - -msgid "jump to previous buffer" -msgstr "перейти к предыдущему буферу" - -msgid "jump to server buffer" -msgstr "перейти к буферу сервера" - -msgid "jump to next server" -msgstr "перейти к следующему буферу" - -msgid "switch active server on servers buffer" -msgstr "перейти к активному серверу в буфере серверов" - -msgid "scroll to first unread line in buffer" -msgstr "перейти к первой непрочитанной строчке буфера" - -msgid "set unread marker on all buffers" -msgstr "пометить все буферы как непрочитанные" - -msgid "clear hotlist" -msgstr "очистить хотлист" - -msgid "clear infobar" -msgstr "очистить информационную панель" - -msgid "grab a key" -msgstr "захватить клавишу" - -msgid "insert a string in command line" -msgstr "вставить строку в поле ввода" - -msgid "search text in buffer history" -msgstr "поиск текста в истории буфера" - #, fuzzy, c-format msgid "Error: unable to bind key \"%s\"" msgstr "%s не могу установить клавишу \"%s\"\n" -#, fuzzy, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" -"%s не могу установить клавишу \"%s\" (некорректное название функции: \"%s" -"\")\n" - #, fuzzy msgid "Error: not enough memory for key binding" msgstr "%s недостаточно памяти для установки клавиши\n" @@ -4557,6 +4441,128 @@ msgstr "" msgid "%s%s: wrong arguments for function \"%s\"" msgstr "%s некорректные аргументы команды \"%s\"\n" +#~ msgid "Internal key functions:\n" +#~ msgstr "Встроенные функции клавиш:\n" + +#, fuzzy +#~ msgid "Internal key functions:" +#~ msgstr "Встроенные функции клавиш:\n" + +#, fuzzy +#~ msgid "%sError: unknown key function \"%s\"" +#~ msgstr "%s неизвестная функция клавиши \"%s\"\n" + +#~ msgid "terminate line" +#~ msgstr "удалить строку" + +#~ msgid "complete word" +#~ msgstr "завершить слово" + +#~ msgid "find previous completion for word" +#~ msgstr "найти предыдущее дополнение слова" + +#~ msgid "delete previous char" +#~ msgstr "стереть предыдущий символ" + +#~ msgid "delete next char" +#~ msgstr "стереть следующий символ" + +#~ msgid "delete until end of line" +#~ msgstr "стереть до конца строки" + +#~ msgid "delete until beginning of line" +#~ msgstr "стереть до начала строки" + +#~ msgid "delete entire line" +#~ msgstr "стереть всю строку" + +#~ msgid "delete previous word" +#~ msgstr "стереть предыдущее слово" + +#~ msgid "delete next word" +#~ msgstr "стереть следующее слово" + +#~ msgid "paste current clipboard content" +#~ msgstr "вставить содержимое буфера обмена" + +#~ msgid "transpose chars" +#~ msgstr "развернуть символы" + +#~ msgid "go to beginning of line" +#~ msgstr "перейти к началу строки" + +#~ msgid "go to end of line" +#~ msgstr "перейти к концу строки" + +#~ msgid "move one char left" +#~ msgstr "перейти на 1 символ влево" + +#~ msgid "move to previous word" +#~ msgstr "перейти к предыдущему слову" + +#~ msgid "move one char right" +#~ msgstr "перейти на 1 символ вправо" + +#~ msgid "move to next word" +#~ msgstr "перейти к следующему слову" + +#~ msgid "call previous command in history" +#~ msgstr "вызвать предыдущую команду из истории" + +#~ msgid "call previous command in global history" +#~ msgstr "вызвать предыдущую команду из глобальной истории" + +#~ msgid "call next command in history" +#~ msgstr "вызвать следующую команду из истории" + +#~ msgid "call next command in global history" +#~ msgstr "вызвать следующую команду из глобальной истории" + +#~ msgid "jump to buffer with activity" +#~ msgstr "перейти к буферу с активностью:" + +#~ msgid "jump to DCC buffer" +#~ msgstr "перейти к буферу DCC" + +#~ msgid "jump to last buffer" +#~ msgstr "перейти к последнему буферу" + +#~ msgid "jump to previous buffer" +#~ msgstr "перейти к предыдущему буферу" + +#~ msgid "jump to server buffer" +#~ msgstr "перейти к буферу сервера" + +#~ msgid "jump to next server" +#~ msgstr "перейти к следующему буферу" + +#~ msgid "switch active server on servers buffer" +#~ msgstr "перейти к активному серверу в буфере серверов" + +#~ msgid "scroll to first unread line in buffer" +#~ msgstr "перейти к первой непрочитанной строчке буфера" + +#~ msgid "set unread marker on all buffers" +#~ msgstr "пометить все буферы как непрочитанные" + +#~ msgid "clear hotlist" +#~ msgstr "очистить хотлист" + +#~ msgid "clear infobar" +#~ msgstr "очистить информационную панель" + +#~ msgid "grab a key" +#~ msgstr "захватить клавишу" + +#~ msgid "search text in buffer history" +#~ msgstr "поиск текста в истории буфера" + +#, fuzzy +#~ msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" +#~ msgstr "" +#~ "%s не могу установить клавишу \"%s\" (некорректное название функции: \"%s" +#~ "\")\n" + #, fuzzy #~ msgid "launch WeeChat builtin command (do not look at commands hooked)" #~ msgstr "" @@ -4753,10 +4759,6 @@ msgstr "%s некорректные аргументы команды \"%s\"\n" #~ msgid "%sError: wrong number \"%s\" for filter" #~ msgstr "%s некорректное количество аргументов команды \"%s\"\n" -#, fuzzy -#~ msgid "%sError: command \"%s\" failed" -#~ msgstr "%s команда \"%s\" не удалась\n" - #, fuzzy #~ msgid "%s%s: cannot identify channel for \"%s\" command" #~ msgstr "%s не могу опознать канал для команды \"%s\"\n" diff --git a/po/srcfiles.cmake b/po/srcfiles.cmake index 9bbbbdb61..a43340566 100644 --- a/po/srcfiles.cmake +++ b/po/srcfiles.cmake @@ -49,8 +49,6 @@ SET(WEECHAT_SOURCES ./src/gui/gtk/gui-gtk-nicklist.c ./src/gui/gtk/gui-gtk-status.c ./src/gui/gtk/gui-gtk-window.c -./src/gui/gui-action.c -./src/gui/gui-action.h ./src/gui/gui-bar.c ./src/gui/gui-bar.h ./src/gui/gui-bar-item.c diff --git a/po/weechat.pot b/po/weechat.pot index 905daf9a3..ff316eb23 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-04-29 13:16+0200\n" +"POT-Creation-Date: 2008-04-29 18:22+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -33,7 +33,6 @@ msgid "" " -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" -" -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -53,9 +52,6 @@ msgstr "" msgid "%s internal commands:\n" msgstr "" -msgid "Internal key functions:\n" -msgstr "" - #. TRANSLATORS: %s is "weechat" #, c-format msgid "%s default keys:\n" @@ -316,15 +312,12 @@ msgid "Buffer command history:" msgstr "" #, c-format -msgid "New key binding: %s%s => %s%s%s%s%s" +msgid "New key binding: %s%s => %s%s" msgstr "" msgid "Key bindings:" msgstr "" -msgid "Internal key functions:" -msgstr "" - msgid "Default key bindings restored" msgstr "" @@ -340,10 +333,6 @@ msgstr "" msgid "%sError: unable to unbind key \"%s\"" msgstr "" -#, c-format -msgid "%sError: unknown key function \"%s\"" -msgstr "" - msgid "Key:" msgstr "" @@ -657,20 +646,23 @@ msgid "" "value: number of history entries to show" msgstr "" +msgid "functions for command line" +msgstr "" + +msgid "" +"This command is used by key bindings or plugins, it must NOT be called by " +"user" +msgstr "" + msgid "bind/unbind keys" msgstr "" -msgid "" -"[key [function/command]] [unbind key] [functions] [call function [\"args\"]] " -"[reset -yes]" +msgid "[key [command [args]]] | [unbind key] | [reset -yes]" msgstr "" msgid "" -" key: display or bind this key to an internal function or a command " -"(beginning by \"/\")\n" +" key: display or bind this key to a command\n" " unbind: unbind a key\n" -"functions: list internal functions for key bindings\n" -" call: call a function by name (with optional arguments)\n" " reset: restore bindings to the default values and delete ALL personal " "bindings (use carefully!)" msgstr "" @@ -1330,6 +1322,10 @@ msgstr "" msgid " . description: %s\n" msgstr "" +#, c-format +msgid "%sError: command \"%s\" is running" +msgstr "" + #, c-format msgid "%sError: unknown command \"%s\" (type /help for help)" msgstr "" @@ -1470,122 +1466,10 @@ msgstr "" msgid "Error: not enough memory for infobar message" msgstr "" -msgid "terminate line" -msgstr "" - -msgid "complete word" -msgstr "" - -msgid "find previous completion for word" -msgstr "" - -msgid "delete previous char" -msgstr "" - -msgid "delete next char" -msgstr "" - -msgid "delete until end of line" -msgstr "" - -msgid "delete until beginning of line" -msgstr "" - -msgid "delete entire line" -msgstr "" - -msgid "delete previous word" -msgstr "" - -msgid "delete next word" -msgstr "" - -msgid "paste current clipboard content" -msgstr "" - -msgid "transpose chars" -msgstr "" - -msgid "go to beginning of line" -msgstr "" - -msgid "go to end of line" -msgstr "" - -msgid "move one char left" -msgstr "" - -msgid "move to previous word" -msgstr "" - -msgid "move one char right" -msgstr "" - -msgid "move to next word" -msgstr "" - -msgid "call previous command in history" -msgstr "" - -msgid "call previous command in global history" -msgstr "" - -msgid "call next command in history" -msgstr "" - -msgid "call next command in global history" -msgstr "" - -msgid "jump to buffer with activity" -msgstr "" - -msgid "jump to DCC buffer" -msgstr "" - -msgid "jump to last buffer" -msgstr "" - -msgid "jump to previous buffer" -msgstr "" - -msgid "jump to server buffer" -msgstr "" - -msgid "jump to next server" -msgstr "" - -msgid "switch active server on servers buffer" -msgstr "" - -msgid "scroll to first unread line in buffer" -msgstr "" - -msgid "set unread marker on all buffers" -msgstr "" - -msgid "clear hotlist" -msgstr "" - -msgid "clear infobar" -msgstr "" - -msgid "grab a key" -msgstr "" - -msgid "insert a string in command line" -msgstr "" - -msgid "search text in buffer history" -msgstr "" - #, c-format msgid "Error: unable to bind key \"%s\"" msgstr "" -#, c-format -msgid "Error: unable to bind key \"%s\" (invalid function name: \"%s\")" -msgstr "" - msgid "Error: not enough memory for key binding" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index fb4266c62..31a995047 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1125,6 +1125,92 @@ command_history (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } +/* + * command_input: input actions (used by key bindings) + */ + +int +command_input (void *data, struct t_gui_buffer *buffer, + int argc, char **argv, char **argv_eol) +{ + /* make C compiler happy */ + (void) data; + (void) buffer; + + if (argc > 1) + { + if (string_strcasecmp (argv[1], "return") == 0) + gui_input_return (); + else if (string_strcasecmp (argv[1], "complete_next") == 0) + gui_input_complete_next (); + else if (string_strcasecmp (argv[1], "complete_previous") == 0) + gui_input_complete_previous (); + else if (string_strcasecmp (argv[1], "search_text") == 0) + gui_input_search_text (); + else if (string_strcasecmp (argv[1], "delete_previous_char") == 0) + gui_input_delete_previous_char (); + else if (string_strcasecmp (argv[1], "delete_next_char") == 0) + gui_input_delete_next_char (); + else if (string_strcasecmp (argv[1], "delete_previous_word") == 0) + gui_input_delete_previous_word (); + else if (string_strcasecmp (argv[1], "delete_next_word") == 0) + gui_input_delete_next_word (); + else if (string_strcasecmp (argv[1], "delete_beginning_of_line") == 0) + gui_input_delete_beginning_of_line (); + else if (string_strcasecmp (argv[1], "delete_end_of_line") == 0) + gui_input_delete_end_of_line (); + else if (string_strcasecmp (argv[1], "delete_line") == 0) + gui_input_delete_line (); + else if (string_strcasecmp (argv[1], "clipboard_paste") == 0) + gui_input_clipboard_paste (); + else if (string_strcasecmp (argv[1], "transpose_chars") == 0) + gui_input_transpose_chars (); + else if (string_strcasecmp (argv[1], "move_beginning_of_line") == 0) + gui_input_move_beginning_of_line (); + else if (string_strcasecmp (argv[1], "move_end_of_line") == 0) + gui_input_move_end_of_line (); + else if (string_strcasecmp (argv[1], "move_previous_char") == 0) + gui_input_move_previous_char (); + else if (string_strcasecmp (argv[1], "move_next_char") == 0) + gui_input_move_next_char (); + else if (string_strcasecmp (argv[1], "move_previous_word") == 0) + gui_input_move_previous_word (); + else if (string_strcasecmp (argv[1], "move_next_word") == 0) + gui_input_move_next_word (); + else if (string_strcasecmp (argv[1], "history_previous") == 0) + gui_input_history_previous (); + else if (string_strcasecmp (argv[1], "history_next") == 0) + gui_input_history_next (); + else if (string_strcasecmp (argv[1], "history_global_previous") == 0) + gui_input_history_global_previous (); + else if (string_strcasecmp (argv[1], "history_global_next") == 0) + gui_input_history_global_next (); + else if (string_strcasecmp (argv[1], "jump_smart") == 0) + gui_input_jump_smart (); + else if (string_strcasecmp (argv[1], "jump_last_buffer") == 0) + gui_input_jump_last_buffer (); + else if (string_strcasecmp (argv[1], "jump_previous_buffer") == 0) + gui_input_jump_previous_buffer (); + else if (string_strcasecmp (argv[1], "hotlist_clear") == 0) + gui_input_hotlist_clear (); + else if (string_strcasecmp (argv[1], "infobar_clear") == 0) + gui_input_infobar_clear (); + else if (string_strcasecmp (argv[1], "grab_key") == 0) + gui_input_grab_key (); + else if (string_strcasecmp (argv[1], "scroll_unread") == 0) + gui_input_scroll_unread (); + else if (string_strcasecmp (argv[1], "set_unread") == 0) + gui_input_set_unread (); + else if (string_strcasecmp (argv[1], "insert") == 0) + { + if (argc > 2) + gui_input_insert (argv_eol[2]); + } + } + + return WEECHAT_RC_OK; +} + /* * command_key_display: display a key binding */ @@ -1138,27 +1224,19 @@ command_key_display (struct t_gui_key *key, int new_key) if (new_key) { gui_chat_printf (NULL, - _("New key binding: %s%s => %s%s%s%s%s"), + _("New key binding: %s%s => %s%s"), (expanded_name) ? expanded_name : key->key, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT), - (key->function) ? - gui_keyboard_function_search_by_ptr (key->function) : key->command, - (key->args) ? " \"" : "", - (key->args) ? key->args : "", - (key->args) ? "\"" : ""); + key->command); } else { - gui_chat_printf (NULL, " %20s%s => %s%s%s%s%s", + gui_chat_printf (NULL, " %20s%s => %s%s", (expanded_name) ? expanded_name : key->key, GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS), GUI_COLOR(GUI_COLOR_CHAT), - (key->function) ? - gui_keyboard_function_search_by_ptr (key->function) : key->command, - (key->args) ? " \"" : "", - (key->args) ? key->args : "", - (key->args) ? "\"" : ""); + key->command); } if (expanded_name) free (expanded_name); @@ -1172,10 +1250,8 @@ int command_key (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { - char *args, *internal_code; - int i; + char *internal_code; struct t_gui_key *ptr_key; - t_gui_key_func *ptr_function; /* make C compiler happy */ (void) data; @@ -1193,23 +1269,6 @@ command_key (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } - /* display key functions */ - if (string_strcasecmp (argv[1], "functions") == 0) - { - gui_chat_printf (NULL, ""); - gui_chat_printf (NULL, _("Internal key functions:")); - i = 0; - while (gui_key_functions[i].function_name) - { - gui_chat_printf (NULL, - "%25s %s", - gui_key_functions[i].function_name, - _(gui_key_functions[i].description)); - i++; - } - return WEECHAT_RC_OK; - } - /* reset keys (only with "-yes", for security reason) */ if (string_strcasecmp (argv[1], "reset") == 0) { @@ -1254,36 +1313,6 @@ command_key (void *data, struct t_gui_buffer *buffer, return WEECHAT_RC_OK; } - /* call a key function */ - if (string_strcasecmp (argv[1], "call") == 0) - { - if (argc >= 3) - { - ptr_function = gui_keyboard_function_search_by_name (argv[2]); - if (ptr_function) - { - if (argc >= 4) - { - args = string_remove_quotes (argv_eol[3], "'\""); - (void)(*ptr_function)((args) ? args : argv_eol[3]); - if (args) - free (args); - } - else - (void)(*ptr_function)(NULL); - } - else - { - gui_chat_printf (NULL, - _("%sError: unknown key function \"%s\""), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - argv[2]); - return WEECHAT_RC_ERROR; - } - } - return WEECHAT_RC_OK; - } - /* display a key */ if (argc == 2) { @@ -2616,21 +2645,34 @@ command_init () N_("[clear | value]"), N_("clear: clear history\n" "value: number of history entries to show"), - "-clear", + "clear", &command_history, NULL); + hook_command (NULL, "input", + N_("functions for command line"), + "return | complete_next | complete_previous | search_next | " + "delete_previous_char | delete_next_char | " + "delete_previous_word | delete_next_word | " + "delete_beginning_of_line | delete_end_of_line | " + "delete_line | clipboard_paste | transpose_chars | " + "move_beginning_of_line | move_end_of_line | " + "move_previous_char | move_next_char | move_previous_word | " + "move_next_word | history_previous | history_next | " + "history_global_previous | history_global_next | " + "jump_smart | jump_last_buffer | jump_previous_buffer | " + "hotlist_clear | infobar_clear | grab_key | scroll_unread | " + "set_unread | insert [args]", + _("This command is used by key bindings or plugins, it must " + "NOT be called by user"), + "", + &command_input, NULL); hook_command (NULL, "key", N_("bind/unbind keys"), - N_("[key [function/command]] [unbind key] [functions] " - "[call function [\"args\"]] [reset -yes]"), - N_(" key: display or bind this key to an internal " - "function or a command (beginning by \"/\")\n" + N_("[key [command [args]]] | [unbind key] | [reset -yes]"), + N_(" key: display or bind this key to a command\n" " unbind: unbind a key\n" - "functions: list internal functions for key bindings\n" - " call: call a function by name (with optional " - "arguments)\n" " reset: restore bindings to the default values and " "delete ALL personal bindings (use carefully!)"), - "unbind|functions|call|reset %k", + "unbind|reset", &command_key, NULL); hook_command (NULL, "plugin", N_("list/load/unload plugins"), diff --git a/src/core/wee-config.c b/src/core/wee-config.c index fef497462..d6733fb54 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -707,7 +707,7 @@ config_weechat_key_write (void *data, struct t_config_file *config_file, char *section_name) { struct t_gui_key *ptr_key; - char *expanded_name, *function_name; + char *expanded_name; /* make C compiler happy */ (void) data; @@ -717,28 +717,11 @@ config_weechat_key_write (void *data, struct t_config_file *config_file, for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key) { expanded_name = gui_keyboard_get_expanded_name (ptr_key->key); - if (ptr_key->function) - { - function_name = gui_keyboard_function_search_by_ptr (ptr_key->function); - if (function_name) - { - config_file_write_line (config_file, - (expanded_name) ? - expanded_name : ptr_key->key, - "\"%s%s%s\"", - function_name, - (ptr_key->args) ? " " : "", - (ptr_key->args) ? ptr_key->args : ""); - } - } - else - { - config_file_write_line (config_file, - (expanded_name) ? - expanded_name : ptr_key->key, - "\"%s\"", - ptr_key->command); - } + config_file_write_line (config_file, + (expanded_name) ? + expanded_name : ptr_key->key, + "\"%s\"", + ptr_key->command); if (expanded_name) free (expanded_name); } diff --git a/src/core/wee-hook.c b/src/core/wee-hook.c index d8c2413a1..a0099f29f 100644 --- a/src/core/wee-hook.c +++ b/src/core/wee-hook.c @@ -369,6 +369,7 @@ hook_command (struct t_weechat_plugin *plugin, char *command, char *description, * -2 if command is ambigous (same command exists * for another plugin, and we don't know which * one to run) + * -3 if command is already running */ int @@ -378,7 +379,7 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, struct t_hook *ptr_hook, *next_hook; struct t_hook *hook_for_plugin, *hook_for_other_plugin; char **argv, **argv_eol; - int argc, rc; + int argc, rc, command_is_running; rc = -1; @@ -397,26 +398,31 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, hook_for_plugin = NULL; hook_for_other_plugin = NULL; + command_is_running = 0; ptr_hook = weechat_hooks[HOOK_TYPE_COMMAND]; while (ptr_hook) { next_hook = ptr_hook->next_hook; if (!ptr_hook->deleted - && !ptr_hook->running && ((!any_plugin || HOOK_COMMAND(ptr_hook, level) == 0)) && ((argv[0][0] == '/') && (string_strcasecmp (argv[0] + 1, HOOK_COMMAND(ptr_hook, command)) == 0))) { - if (ptr_hook->plugin == plugin) - { - if (!hook_for_plugin) - hook_for_plugin = ptr_hook; - } + if (ptr_hook->running) + command_is_running = 1; else { - if (!hook_for_other_plugin) - hook_for_other_plugin = ptr_hook; + if (ptr_hook->plugin == plugin) + { + if (!hook_for_plugin) + hook_for_plugin = ptr_hook; + } + else + { + if (!hook_for_other_plugin) + hook_for_other_plugin = ptr_hook; + } } } @@ -426,7 +432,9 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, /* ambiguous: command found for current plugin and other one, we don't know which one to run! */ if (any_plugin && hook_for_plugin && hook_for_other_plugin) + { rc = -2; + } else { if (any_plugin || hook_for_plugin) @@ -445,6 +453,16 @@ hook_command_exec (struct t_gui_buffer *buffer, int any_plugin, else rc = 1; } + else + { + if (command_is_running) + rc = -3; + } + } + else + { + if (command_is_running) + rc = -3; } } diff --git a/src/core/wee-input.c b/src/core/wee-input.c index c7b0b45c2..c0e938bc3 100644 --- a/src/core/wee-input.c +++ b/src/core/wee-input.c @@ -112,6 +112,12 @@ input_exec_command (struct t_gui_buffer *buffer, break; case 1: /* command hooked, OK (executed) */ break; + case -3: /* command is running */ + gui_chat_printf (NULL, + _("%sError: command \"%s\" is running"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + command + 1); + break; default: /* no command hooked */ gui_chat_printf (NULL, _("%sError: unknown command \"%s\" (type /help " diff --git a/src/core/weechat.c b/src/core/weechat.c index f56910e70..60628a9d3 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -104,7 +104,6 @@ weechat_display_usage (char *exec_name) _(" -a, --no-connect disable auto-connect to servers at startup\n" " -c, --config display config file options\n" " -d, --dir set WeeChat home directory (default: ~/.weechat)\n" - " -f, --key-functions display WeeChat internal functions for keys\n" " -h, --help this help\n" " -m, --commands display WeeChat commands\n" " -k, --keys display WeeChat default keys\n" @@ -143,28 +142,6 @@ weechat_display_commands () command_print_stdout (); } -/* - * weechat_display_key_functions: display WeeChat key functions - */ - -void -weechat_display_key_functions () -{ - int i; - - string_iconv_fprintf (stdout, _("Internal key functions:\n")); - string_iconv_fprintf (stdout, "\n"); - i = 0; - while (gui_key_functions[i].function_name) - { - string_iconv_fprintf (stdout, - "* %s: %s\n", - gui_key_functions[i].function_name, - _(gui_key_functions[i].description)); - i++; - } -} - /* * weechat_display_keys: display WeeChat default keys */ @@ -186,8 +163,7 @@ weechat_display_keys () string_iconv_fprintf (stdout, "* %s => %s\n", (expanded_name) ? expanded_name : ptr_key->key, - (ptr_key->function) ? - gui_keyboard_function_search_by_ptr (ptr_key->function) : ptr_key->command); + ptr_key->command); if (expanded_name) free (expanded_name); } @@ -245,12 +221,6 @@ weechat_parse_args (int argc, char *argv[]) weechat_shutdown (EXIT_FAILURE, 0); } } - else if ((strcmp (argv[i], "-f") == 0) - || (strcmp (argv[i], "--key-functions") == 0)) - { - weechat_display_key_functions (); - weechat_shutdown (EXIT_SUCCESS, 0); - } else if ((strcmp (argv[i], "-h") == 0) || (strcmp (argv[i], "--help") == 0)) { diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 6b6757ab6..02570b11f 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -18,13 +18,12 @@ IF(NOT DISABLE_NCURSES) SUBDIRS( curses ) ENDIF(NOT DISABLE_NCURSES) -SET(LIB_GUI_COMMON_SRC gui-action.c gui-action.h gui-bar.c gui-bar.h -gui-bar-item.c gui-bar-item.h gui-buffer.c gui-buffer.h gui-chat.c gui-chat.h -gui-color.c gui-color.h gui-filter.c gui-filter.h gui-completion.c -gui-completion.h gui-history.c gui-history.h gui-hotlist.c gui-hotlist.h -gui-infobar.c gui-infobar.h gui-input.c gui-input.h gui-keyboard.c -gui-keyboard.h gui-main.h gui-nicklist.c gui-nicklist.h gui-status.c -gui-status.h gui-window.c gui-window.h) +SET(LIB_GUI_COMMON_SRC gui-bar.c gui-bar.h gui-bar-item.c gui-bar-item.h +gui-buffer.c gui-buffer.h gui-chat.c gui-chat.h gui-color.c gui-color.h +gui-filter.c gui-filter.h gui-completion.c gui-completion.h gui-history.c +gui-history.h gui-hotlist.c gui-hotlist.h gui-infobar.c gui-infobar.h +gui-input.c gui-input.h gui-keyboard.c gui-keyboard.h gui-main.h gui-nicklist.c +gui-nicklist.h gui-status.c gui-status.h gui-window.c gui-window.h) INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR}) ADD_LIBRARY(weechat_gui_common STATIC ${LIB_GUI_COMMON_SRC}) diff --git a/src/gui/Makefile.am b/src/gui/Makefile.am index 916a4dc08..fc4a19ece 100644 --- a/src/gui/Makefile.am +++ b/src/gui/Makefile.am @@ -18,9 +18,7 @@ INCLUDES = -DLOCALEDIR=\"$(datadir)/locale\" noinst_LIBRARIES = lib_weechat_gui_common.a -lib_weechat_gui_common_a_SOURCES = gui-action.c \ - gui-action.h \ - gui-bar.c \ +lib_weechat_gui_common_a_SOURCES = gui-bar.c \ gui-bar.h \ gui-bar-item.c \ gui-bar-item.h \ diff --git a/src/gui/curses/gui-curses-keyboard.c b/src/gui/curses/gui-curses-keyboard.c index 74131aa7a..d0278786d 100644 --- a/src/gui/curses/gui-curses-keyboard.c +++ b/src/gui/curses/gui-curses-keyboard.c @@ -54,62 +54,55 @@ gui_keyboard_default_bindings () int i; char key_str[32], command[32]; - /* keys bound with internal functions */ - gui_keyboard_bind (NULL, /* RC */ "ctrl-M", "return"); - gui_keyboard_bind (NULL, /* RC */ "ctrl-J", "return"); - gui_keyboard_bind (NULL, /* tab */ "ctrl-I", "tab"); - gui_keyboard_bind (NULL, /* s-tab */ "meta2-Z", "tab_previous"); - gui_keyboard_bind (NULL, /* basckpace */ "ctrl-H", "backspace"); - gui_keyboard_bind (NULL, /* basckpace */ "ctrl-?", "backspace"); - gui_keyboard_bind (NULL, /* del */ "meta2-3~", "delete"); - gui_keyboard_bind (NULL, /* ^D */ "ctrl-D", "delete"); - gui_keyboard_bind (NULL, /* ^K */ "ctrl-K", "delete_end_line"); - gui_keyboard_bind (NULL, /* ^U */ "ctrl-U", "delete_beginning_line"); - gui_keyboard_bind (NULL, /* ^W */ "ctrl-W", "delete_previous_word"); - gui_keyboard_bind (NULL, /* ^Y */ "ctrl-Y", "clipboard_paste"); - gui_keyboard_bind (NULL, /* ^T */ "ctrl-T", "transpose_chars"); - gui_keyboard_bind (NULL, /* home */ "meta2-1~", "home"); - gui_keyboard_bind (NULL, /* home */ "meta2-H", "home"); - gui_keyboard_bind (NULL, /* home */ "meta2-7~", "home"); - gui_keyboard_bind (NULL, /* ^A */ "ctrl-A", "home"); - gui_keyboard_bind (NULL, /* end */ "meta2-4~", "end"); - gui_keyboard_bind (NULL, /* end */ "meta2-F", "end"); - gui_keyboard_bind (NULL, /* end */ "meta2-8~", "end"); - gui_keyboard_bind (NULL, /* ^E */ "ctrl-E", "end"); - gui_keyboard_bind (NULL, /* left */ "meta2-D", "left"); - gui_keyboard_bind (NULL, /* ^B */ "ctrl-B", "left"); - gui_keyboard_bind (NULL, /* right */ "meta2-C", "right"); - gui_keyboard_bind (NULL, /* ^F */ "ctrl-F", "right"); - gui_keyboard_bind (NULL, /* up */ "meta2-A", "up"); - gui_keyboard_bind (NULL, /* ^up */ "meta-Oa", "up_global"); - gui_keyboard_bind (NULL, /* down */ "meta2-B", "down"); - gui_keyboard_bind (NULL, /* ^down */ "meta-Ob", "down_global"); - gui_keyboard_bind (NULL, /* m-a */ "meta-a", "jump_smart"); - gui_keyboard_bind (NULL, /* m-b */ "meta-b", "previous_word"); - gui_keyboard_bind (NULL, /* ^left */ "meta-Od", "previous_word"); - gui_keyboard_bind (NULL, /* m-d */ "meta-d", "delete_next_word"); - gui_keyboard_bind (NULL, /* m-f */ "meta-f", "next_word"); - gui_keyboard_bind (NULL, /* ^right */ "meta-Oc", "next_word"); - gui_keyboard_bind (NULL, /* m-h */ "meta-h", "hotlist_clear"); - gui_keyboard_bind (NULL, /* m-i */ "meta-i" , "infobar_clear"); - gui_keyboard_bind (NULL, /* m-j,m-d */ "meta-jmeta-d", "jump_dcc"); - gui_keyboard_bind (NULL, /* m-j,m-l */ "meta-jmeta-l", "jump_last_buffer"); - gui_keyboard_bind (NULL, /* m-j,m-p */ "meta-jmeta-p", "jump_previous_buffer"); - gui_keyboard_bind (NULL, /* m-j,m-s */ "meta-jmeta-s", "jump_server"); - gui_keyboard_bind (NULL, /* m-j,m-x */ "meta-jmeta-x", "jump_next_server"); - gui_keyboard_bind (NULL, /* m-k */ "meta-k", "grab_key"); - gui_keyboard_bind (NULL, /* m-r */ "meta-r", "delete_line"); - gui_keyboard_bind (NULL, /* m-s */ "meta-s", "switch_server"); - gui_keyboard_bind (NULL, /* m-u */ "meta-u", "scroll_unread"); - gui_keyboard_bind (NULL, /* ^S^U */ "ctrl-Sctrl-U", "set_unread"); - gui_keyboard_bind (NULL, /* ^R */ "ctrl-R", "search_text"); - gui_keyboard_bind (NULL, /* ^Cb */ "ctrl-Cb", "insert \\x02"); - gui_keyboard_bind (NULL, /* ^Cc */ "ctrl-Cc", "insert \\x03"); - gui_keyboard_bind (NULL, /* ^Co */ "ctrl-Co", "insert \\x0F"); - gui_keyboard_bind (NULL, /* ^Cr */ "ctrl-Cr", "insert \\x12"); - gui_keyboard_bind (NULL, /* ^Cu */ "ctrl-Cu", "insert \\x15"); - - /* keys bound with commands */ + gui_keyboard_bind (NULL, /* RC */ "ctrl-M", "/input return"); + gui_keyboard_bind (NULL, /* RC */ "ctrl-J", "/input return"); + gui_keyboard_bind (NULL, /* tab */ "ctrl-I", "/input complete_next"); + gui_keyboard_bind (NULL, /* s-tab */ "meta2-Z", "/input complete_previous"); + gui_keyboard_bind (NULL, /* ^R */ "ctrl-R", "/input search_text"); + gui_keyboard_bind (NULL, /* basckpace */ "ctrl-H", "/input delete_previous_char"); + gui_keyboard_bind (NULL, /* basckpace */ "ctrl-?", "/input delete_previous_char"); + gui_keyboard_bind (NULL, /* del */ "meta2-3~", "/input delete_next_char"); + gui_keyboard_bind (NULL, /* ^D */ "ctrl-D", "/input delete_next_char"); + gui_keyboard_bind (NULL, /* ^W */ "ctrl-W", "/input delete_previous_word"); + gui_keyboard_bind (NULL, /* m-d */ "meta-d", "/input delete_next_word"); + gui_keyboard_bind (NULL, /* ^K */ "ctrl-K", "/input delete_end_of_line"); + gui_keyboard_bind (NULL, /* m-r */ "meta-r", "/input delete_line"); + gui_keyboard_bind (NULL, /* ^T */ "ctrl-T", "/input transpose_chars"); + gui_keyboard_bind (NULL, /* ^U */ "ctrl-U", "/input delete_beginning_of_line"); + gui_keyboard_bind (NULL, /* ^Y */ "ctrl-Y", "/input clipboard_paste"); + gui_keyboard_bind (NULL, /* home */ "meta2-1~", "/input move_beginning_of_line"); + gui_keyboard_bind (NULL, /* home */ "meta2-H", "/input move_beginning_of_line"); + gui_keyboard_bind (NULL, /* home */ "meta2-7~", "/input move_beginning_of_line"); + gui_keyboard_bind (NULL, /* ^A */ "ctrl-A", "/input move_beginning_of_line"); + gui_keyboard_bind (NULL, /* end */ "meta2-4~", "/input move_end_of_line"); + gui_keyboard_bind (NULL, /* end */ "meta2-F", "/input move_end_of_line"); + gui_keyboard_bind (NULL, /* end */ "meta2-8~", "/input move_end_of_line"); + gui_keyboard_bind (NULL, /* ^E */ "ctrl-E", "/input move_end_of_line"); + gui_keyboard_bind (NULL, /* left */ "meta2-D", "/input move_previous_char"); + gui_keyboard_bind (NULL, /* ^B */ "ctrl-B", "/input move_previous_char"); + gui_keyboard_bind (NULL, /* right */ "meta2-C", "/input move_next_char"); + gui_keyboard_bind (NULL, /* ^F */ "ctrl-F", "/input move_next_char"); + gui_keyboard_bind (NULL, /* m-b */ "meta-b", "/input move_previous_word"); + gui_keyboard_bind (NULL, /* ^left */ "meta-Od", "/input move_previous_word"); + gui_keyboard_bind (NULL, /* m-f */ "meta-f", "/input move_next_word"); + gui_keyboard_bind (NULL, /* ^right */ "meta-Oc", "/input move_next_word"); + gui_keyboard_bind (NULL, /* up */ "meta2-A", "/input history_previous"); + gui_keyboard_bind (NULL, /* down */ "meta2-B", "/input history_next"); + gui_keyboard_bind (NULL, /* ^up */ "meta-Oa", "/input history_global_previous"); + gui_keyboard_bind (NULL, /* ^down */ "meta-Ob", "/input history_global_next"); + gui_keyboard_bind (NULL, /* m-a */ "meta-a", "/input jump_smart"); + gui_keyboard_bind (NULL, /* m-j,m-l */ "meta-jmeta-l", "/input jump_last_buffer"); + gui_keyboard_bind (NULL, /* m-j,m-p */ "meta-jmeta-p", "/input jump_previous_buffer"); + gui_keyboard_bind (NULL, /* m-h */ "meta-h", "/input hotlist_clear"); + gui_keyboard_bind (NULL, /* m-i */ "meta-i", "/input infobar_clear"); + gui_keyboard_bind (NULL, /* m-k */ "meta-k", "/input grab_key"); + gui_keyboard_bind (NULL, /* m-u */ "meta-u", "/input scroll_unread"); + gui_keyboard_bind (NULL, /* ^S^U */ "ctrl-Sctrl-U", "/input set_unread"); + gui_keyboard_bind (NULL, /* ^Cb */ "ctrl-Cb", "/input insert \\x02"); + gui_keyboard_bind (NULL, /* ^Cc */ "ctrl-Cc", "/input insert \\x03"); + gui_keyboard_bind (NULL, /* ^Co */ "ctrl-Co", "/input insert \\x0F"); + gui_keyboard_bind (NULL, /* ^Cr */ "ctrl-Cr", "/input insert \\x12"); + gui_keyboard_bind (NULL, /* ^Cu */ "ctrl-Cu", "/input insert \\x15"); gui_keyboard_bind (NULL, /* m-left */ "meta-meta2-D", "/buffer -1"); gui_keyboard_bind (NULL, /* m-left (kde) */ "meta2-1;3D", "/buffer -1"); gui_keyboard_bind (NULL, /* F5 */ "meta2-15~", "/buffer -1"); diff --git a/src/gui/gui-action.c b/src/gui/gui-action.c deleted file mode 100644 index f2190bdc5..000000000 --- a/src/gui/gui-action.c +++ /dev/null @@ -1,1260 +0,0 @@ -/* - * Copyright (c) 2003-2008 by FlashCode - * See README for License detail, AUTHORS for developers list. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/* gui-action.c: GUI actions */ - - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include - -#include "../core/weechat.h" -#include "../core/wee-config.h" -#include "../core/wee-input.h" -#include "../core/wee-log.h" -#include "../core/wee-string.h" -#include "../core/wee-utf8.h" -#include "gui-action.h" -#include "gui-buffer.h" -#include "gui-chat.h" -#include "gui-completion.h" -#include "gui-history.h" -#include "gui-hotlist.h" -#include "gui-infobar.h" -#include "gui-input.h" -#include "gui-keyboard.h" -#include "gui-status.h" -#include "gui-window.h" - - -/* - * gui_action_clipboard_copy: copy string into clipboard - */ - -void -gui_action_clipboard_copy (char *buffer, int size) -{ - if (size <= 0) - return; - - if (gui_input_clipboard != NULL) - free (gui_input_clipboard); - - gui_input_clipboard = malloc((size + 1) * sizeof(*gui_input_clipboard)); - - if (gui_input_clipboard) - { - memcpy (gui_input_clipboard, buffer, size); - gui_input_clipboard[size] = '\0'; - } -} - -/* - * gui_action_clipboard_paste: paste clipboard at cursor pos in input line - */ - -void -gui_action_clipboard_paste (char *args) -{ - /* make C compiler happy */ - (void) args; - - if ((gui_current_window->buffer->input) - && gui_input_clipboard) - { - gui_input_insert_string (gui_current_window->buffer, - gui_input_clipboard, -1); - gui_current_window->buffer->completion->position = -1; - gui_input_draw (gui_current_window->buffer, 0); - } -} - -/* - * gui_action_return: terminate line (return pressed) - */ - -void -gui_action_return (char *args) -{ - char *command; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED) - gui_window_search_stop (gui_current_window); - else if (gui_current_window->buffer->input_buffer_size > 0) - { - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - command = strdup (gui_current_window->buffer->input_buffer); - if (!command) - return; - gui_history_buffer_add (gui_current_window->buffer, - gui_current_window->buffer->input_buffer); - gui_history_global_add (gui_current_window->buffer->input_buffer); - gui_current_window->buffer->input_buffer[0] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[0] = '\0'; - gui_current_window->buffer->input_buffer_size = 0; - gui_current_window->buffer->input_buffer_length = 0; - gui_current_window->buffer->input_buffer_pos = 0; - gui_current_window->buffer->input_buffer_1st_display = 0; - gui_current_window->buffer->completion->position = -1; - gui_current_window->buffer->ptr_history = NULL; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - input_data (gui_current_window->buffer, command); - free (command); - } - } -} - -/* - * gui_action_tab: tab key => completion - */ - -void -gui_action_tab (char *args) -{ - /* make C compiler happy */ - (void) args; - - if ((gui_current_window->buffer->input) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - gui_completion_search (gui_current_window->buffer->completion, - 1, - gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_size, - utf8_real_pos (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos)); - gui_input_complete (gui_current_window->buffer); - } -} - -/* - * gui_action_tab_previous: shift-tab key => find previous completion - */ - -void -gui_action_tab_previous (char *args) -{ - /* make C compiler happy */ - (void) args; - - if ((gui_current_window->buffer->input) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - gui_completion_search (gui_current_window->buffer->completion, - -1, - gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_size, - utf8_real_pos (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos)); - gui_input_complete (gui_current_window->buffer); - } -} - -/* - * gui_action_backspace: backspace key - */ - -void -gui_action_backspace (char *args) -{ - char *pos, *pos_last; - int char_size, size_to_move; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - pos = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - pos_last = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); - char_size = pos - pos_last; - size_to_move = strlen (pos); - gui_input_move (gui_current_window->buffer, pos_last, pos, size_to_move); - gui_current_window->buffer->input_buffer_size -= char_size; - gui_current_window->buffer->input_buffer_length--; - gui_current_window->buffer->input_buffer_pos--; - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } - } -} - -/* - * gui_action_delete: delete next char - */ - -void -gui_action_delete (char *args) -{ - char *pos, *pos_next; - int char_size, size_to_move; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos < - gui_current_window->buffer->input_buffer_length) - { - pos = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - pos_next = utf8_next_char (pos); - char_size = pos_next - pos; - size_to_move = strlen (pos_next); - gui_input_move (gui_current_window->buffer, pos, pos_next, size_to_move); - gui_current_window->buffer->input_buffer_size -= char_size; - gui_current_window->buffer->input_buffer_length--; - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } - } -} - -/* - * gui_action_delete_previous_word: delete previous word - */ - -void -gui_action_delete_previous_word (char *args) -{ - int length_deleted, size_deleted; - char *start, *string; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - start = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos - 1); - string = start; - while (string && (string[0] == ' ')) - { - string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); - } - if (string) - { - while (string && (string[0] != ' ')) - { - string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); - } - if (string) - { - while (string && (string[0] == ' ')) - { - string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); - } - } - } - - if (string) - string = utf8_next_char (utf8_next_char (string)); - else - string = gui_current_window->buffer->input_buffer; - - size_deleted = utf8_next_char (start) - string; - length_deleted = utf8_strnlen (string, size_deleted); - - gui_action_clipboard_copy (string, size_deleted); - - gui_input_move (gui_current_window->buffer, string, string + size_deleted, strlen (string + size_deleted)); - - gui_current_window->buffer->input_buffer_size -= size_deleted; - gui_current_window->buffer->input_buffer_length -= length_deleted; - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_pos -= length_deleted; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } - } -} - -/* - * gui_action_delete_next_word: delete next word - */ - -void -gui_action_delete_next_word (char *args) -{ - int size_deleted, length_deleted; - char *start, *string; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - start = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - string = start; - length_deleted = 0; - while (string[0]) - { - if ((string[0] == ' ') && (string > start)) - break; - string = utf8_next_char (string); - length_deleted++; - } - size_deleted = string - start; - - gui_action_clipboard_copy(start, size_deleted); - - gui_input_move (gui_current_window->buffer, start, string, strlen (string)); - - gui_current_window->buffer->input_buffer_size -= size_deleted; - gui_current_window->buffer->input_buffer_length -= length_deleted; - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } -} - -/* - * gui_action_delete_begin_of_line: delete all from cursor pos to beginning of line - */ - -void -gui_action_delete_begin_of_line (char *args) -{ - int length_deleted, size_deleted, pos_start; - char *start; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - start = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - pos_start = start - gui_current_window->buffer->input_buffer; - size_deleted = start - gui_current_window->buffer->input_buffer; - length_deleted = utf8_strnlen (gui_current_window->buffer->input_buffer, size_deleted); - gui_action_clipboard_copy (gui_current_window->buffer->input_buffer, - start - gui_current_window->buffer->input_buffer); - - gui_input_move (gui_current_window->buffer, gui_current_window->buffer->input_buffer, start, strlen (start)); - - gui_current_window->buffer->input_buffer_size -= size_deleted; - gui_current_window->buffer->input_buffer_length -= length_deleted; - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_pos = 0; - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } - } -} - -/* - * gui_action_delete_end_of_line: delete all from cursor pos to end of line - */ - -void -gui_action_delete_end_of_line (char *args) -{ - char *start; - int size_deleted, length_deleted, pos_start; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - start = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - pos_start = start - gui_current_window->buffer->input_buffer; - size_deleted = strlen (start); - length_deleted = utf8_strlen (start); - gui_action_clipboard_copy (start, size_deleted); - start[0] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[pos_start] = '\0'; - gui_current_window->buffer->input_buffer_size = strlen (gui_current_window->buffer->input_buffer); - gui_current_window->buffer->input_buffer_length = utf8_strlen (gui_current_window->buffer->input_buffer); - gui_input_optimize_size (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } -} - -/* - * gui_action_delete_line: delete entire line - */ - -void -gui_action_delete_line (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_input_delete_line (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); -} - -/* - * gui_action_transpose_chars: transpose chars (on lth left) at cursor pos - */ - -void -gui_action_transpose_chars (char *args) -{ - /* make C compiler happy */ - (void) args; - - char *start, *prev_char, saved_char[5]; - int size_prev_char, size_start_char; - int pos_prev_char, pos_start; - - if (gui_current_window->buffer->input) - { - if ((gui_current_window->buffer->input_buffer_pos > 0) - && (gui_current_window->buffer->input_buffer_length > 1)) - { - if (gui_current_window->buffer->input_buffer_pos == gui_current_window->buffer->input_buffer_length) - gui_current_window->buffer->input_buffer_pos--; - - start = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - pos_start = start - gui_current_window->buffer->input_buffer; - prev_char = utf8_prev_char (gui_current_window->buffer->input_buffer, - start); - pos_prev_char = prev_char - gui_current_window->buffer->input_buffer; - size_prev_char = start - prev_char; - size_start_char = utf8_char_size (start); - - memcpy (saved_char, prev_char, size_prev_char); - memcpy (prev_char, start, size_start_char); - memcpy (prev_char + size_start_char, saved_char, size_prev_char); - - memcpy (saved_char, gui_current_window->buffer->input_buffer_color_mask + pos_prev_char, size_prev_char); - memcpy (gui_current_window->buffer->input_buffer_color_mask + pos_prev_char, - gui_current_window->buffer->input_buffer_color_mask + pos_start, size_start_char); - memcpy (gui_current_window->buffer->input_buffer_color_mask + pos_prev_char + size_start_char, - saved_char, size_prev_char); - - gui_current_window->buffer->input_buffer_pos++; - - gui_input_draw (gui_current_window->buffer, 0); - gui_current_window->buffer->completion->position = -1; - } - } -} - -/* - * gui_action_home: home key - */ - -void -gui_action_home (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - gui_current_window->buffer->input_buffer_pos = 0; - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_end: end key - */ - -void -gui_action_end (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos < - gui_current_window->buffer->input_buffer_length) - { - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_left: move to previous char - */ - -void -gui_action_left (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - gui_current_window->buffer->input_buffer_pos--; - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_previous_word: move to beginning of previous word - */ - -void -gui_action_previous_word (char *args) -{ - char *pos; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos > 0) - { - pos = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos - 1); - while (pos && (pos[0] == ' ')) - { - pos = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); - } - if (pos) - { - while (pos && (pos[0] != ' ')) - { - pos = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); - } - if (pos) - pos = utf8_next_char (pos); - else - pos = gui_current_window->buffer->input_buffer; - gui_current_window->buffer->input_buffer_pos = utf8_pos (gui_current_window->buffer->input_buffer, - pos - gui_current_window->buffer->input_buffer); - } - else - gui_current_window->buffer->input_buffer_pos = 0; - - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_right: move to next char - */ - -void -gui_action_right (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos < - gui_current_window->buffer->input_buffer_length) - { - gui_current_window->buffer->input_buffer_pos++; - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_next_word: move to the end of next - */ - -void -gui_action_next_word (char *args) -{ - char *pos; - - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->input_buffer_pos < - gui_current_window->buffer->input_buffer_length) - { - pos = utf8_add_offset (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->input_buffer_pos); - while (pos[0] && (pos[0] == ' ')) - { - pos = utf8_next_char (pos); - } - if (pos[0]) - { - while (pos[0] && (pos[0] != ' ')) - { - pos = utf8_next_char (pos); - } - if (pos[0]) - gui_current_window->buffer->input_buffer_pos = - utf8_pos (gui_current_window->buffer->input_buffer, - pos - gui_current_window->buffer->input_buffer); - else - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - } - else - gui_current_window->buffer->input_buffer_pos = - utf8_pos (gui_current_window->buffer->input_buffer, - utf8_prev_char (gui_current_window->buffer->input_buffer, pos) - gui_current_window->buffer->input_buffer); - - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_up: recall last command or move to previous DCC in list - */ - -void -gui_action_up (char *args) -{ - /* make C compiler happy */ - (void) args; - - /*if (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FREE) - { - if (irc_dcc_list) - { - if (window->dcc_selected - && ((t_irc_dcc *)(window->dcc_selected))->prev_dcc) - { - if (window->dcc_selected == - window->dcc_first) - window->dcc_first = - ((t_irc_dcc *)(window->dcc_first))->prev_dcc; - window->dcc_selected = - ((t_irc_dcc *)(window->dcc_selected))->prev_dcc; - gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); - gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); - } - } - } - else*/ if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (gui_current_window->buffer->ptr_history) - { - gui_current_window->buffer->ptr_history = - gui_current_window->buffer->ptr_history->next_history; - if (!gui_current_window->buffer->ptr_history) - gui_current_window->buffer->ptr_history = - gui_current_window->buffer->history; - } - else - gui_current_window->buffer->ptr_history = - gui_current_window->buffer->history; - if (gui_current_window->buffer->ptr_history) - { - /* bash/readline like use of history */ - if (gui_current_window->buffer->ptr_history->prev_history == NULL) - { - if (gui_current_window->buffer->input_buffer_size > 0) - { - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_history_buffer_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer); - gui_history_global_add (gui_current_window->buffer->input_buffer); - } - } - else - { - if (gui_current_window->buffer->input_buffer_size > 0) - { - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - if (gui_current_window->buffer->ptr_history->prev_history->text) - free(gui_current_window->buffer->ptr_history->prev_history->text); - gui_current_window->buffer->ptr_history->prev_history->text = strdup (gui_current_window->buffer->input_buffer); - } - } - gui_current_window->buffer->input_buffer_size = - strlen (gui_current_window->buffer->ptr_history->text); - gui_current_window->buffer->input_buffer_length = - utf8_strlen (gui_current_window->buffer->ptr_history->text); - gui_input_optimize_size (gui_current_window->buffer); - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - gui_current_window->buffer->input_buffer_1st_display = 0; - strcpy (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->ptr_history->text); - gui_input_init_color_mask (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - } - } - else - { - /* search backward in buffer history */ - gui_current_window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD; - (void) gui_window_search_text (gui_current_window); - } - } -} - -/* - * gui_action_up_global: recall last command in global history - */ - -void -gui_action_up_global (char *args) -{ - /* make C compiler happy */ - (void) args; - - if ((gui_current_window->buffer->input) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - if (history_global_ptr) - { - history_global_ptr = history_global_ptr->next_history; - if (!history_global_ptr) - history_global_ptr = history_global; - } - else - history_global_ptr = history_global; - if (history_global_ptr) - { - gui_current_window->buffer->input_buffer_size = - strlen (history_global_ptr->text); - gui_current_window->buffer->input_buffer_length = - utf8_strlen (history_global_ptr->text); - gui_input_optimize_size (gui_current_window->buffer); - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - gui_current_window->buffer->input_buffer_1st_display = 0; - strcpy (gui_current_window->buffer->input_buffer, - history_global_ptr->text); - gui_input_init_color_mask (gui_current_window->buffer); - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_down: recall next command or move to next DCC in list - */ - -void -gui_action_down (char *args) -{ - /* make C compiler happy */ - (void) args; - - /*if (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FREE) - { - if (irc_dcc_list) - { - if (!window->dcc_selected - || ((t_irc_dcc *)(window->dcc_selected))->next_dcc) - { - if (window->dcc_last_displayed - && (window->dcc_selected == - window->dcc_last_displayed)) - { - if (window->dcc_first) - window->dcc_first = - ((t_irc_dcc *)(window->dcc_first))->next_dcc; - else - window->dcc_first = - irc_dcc_list->next_dcc; - } - if (window->dcc_selected) - window->dcc_selected = - ((t_irc_dcc *)(window->dcc_selected))->next_dcc; - else - window->dcc_selected = - irc_dcc_list->next_dcc; - gui_buffer_ask_chat_refresh (gui_current_window->buffer, 1); - gui_buffer_ask_input_refresh (gui_current_window->buffer, 1); - } - } - } - else */if (gui_current_window->buffer->input) - { - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (gui_current_window->buffer->ptr_history) - { - gui_current_window->buffer->ptr_history = - gui_current_window->buffer->ptr_history->prev_history; - if (gui_current_window->buffer->ptr_history) - { - gui_current_window->buffer->input_buffer_size = - strlen (gui_current_window->buffer->ptr_history->text); - gui_current_window->buffer->input_buffer_length = - utf8_strlen (gui_current_window->buffer->ptr_history->text); - } - else - { - gui_current_window->buffer->input_buffer_size = 0; - gui_current_window->buffer->input_buffer_length = 0; - } - gui_input_optimize_size (gui_current_window->buffer); - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - gui_current_window->buffer->input_buffer_1st_display = 0; - if (gui_current_window->buffer->ptr_history) - { - strcpy (gui_current_window->buffer->input_buffer, - gui_current_window->buffer->ptr_history->text); - gui_input_init_color_mask (gui_current_window->buffer); - } - gui_input_draw (gui_current_window->buffer, 0); - } - else - { - /* add line to history then clear input */ - if (gui_current_window->buffer->input_buffer_size > 0) - { - gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; - gui_history_buffer_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer); - gui_history_global_add (gui_current_window->buffer->input_buffer); - gui_current_window->buffer->input_buffer_size = 0; - gui_current_window->buffer->input_buffer_length = 0; - gui_input_optimize_size (gui_current_window->buffer); - gui_current_window->buffer->input_buffer_pos = 0; - gui_current_window->buffer->input_buffer_1st_display = 0; - gui_input_draw (gui_current_window->buffer, 0); - } - } - } - else - { - /* search forward in buffer history */ - gui_current_window->buffer->text_search = GUI_TEXT_SEARCH_FORWARD; - (void) gui_window_search_text (gui_current_window); - } - } -} - -/* - * gui_action_down_global: recall next command in global history - */ - -void -gui_action_down_global (char *args) -{ - /* make C compiler happy */ - (void) args; - - if ((gui_current_window->buffer->input) - && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) - { - if (history_global_ptr) - { - history_global_ptr = history_global_ptr->prev_history; - if (history_global_ptr) - { - gui_current_window->buffer->input_buffer_size = - strlen (history_global_ptr->text); - gui_current_window->buffer->input_buffer_length = - utf8_strlen (history_global_ptr->text); - } - else - { - gui_current_window->buffer->input_buffer_size = 0; - gui_current_window->buffer->input_buffer_length = 0; - } - gui_input_optimize_size (gui_current_window->buffer); - gui_current_window->buffer->input_buffer_pos = - gui_current_window->buffer->input_buffer_length; - gui_current_window->buffer->input_buffer_1st_display = 0; - if (history_global_ptr) - { - strcpy (gui_current_window->buffer->input_buffer, - history_global_ptr->text); - gui_input_init_color_mask (gui_current_window->buffer); - } - gui_input_draw (gui_current_window->buffer, 0); - } - } -} - -/* - * gui_action_jump_smart: jump to buffer with activity (alt-A by default) - */ - -void -gui_action_jump_smart (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (gui_hotlist) - { - if (!gui_hotlist_initial_buffer) - gui_hotlist_initial_buffer = gui_current_window->buffer; - gui_window_switch_to_buffer (gui_current_window, - gui_hotlist->buffer); - gui_window_redraw_buffer (gui_current_window->buffer); - } - else - { - if (gui_hotlist_initial_buffer) - { - gui_window_switch_to_buffer (gui_current_window, - gui_hotlist_initial_buffer); - gui_window_redraw_buffer (gui_current_window->buffer); - gui_hotlist_initial_buffer = NULL; - } - } - } -} - -/* - * gui_action_jump_dcc: jump to DCC buffer - */ - -void -gui_action_jump_dcc (char *args) -{ - /* make C compiler happy */ - (void) args; - - /*if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (gui_current_window->buffer->type == GUI_BUFFER_TYPE_DCC) - { - if (gui_buffer_before_dcc) - { - gui_window_switch_to_buffer (window, - gui_buffer_before_dcc); - gui_window_redraw_buffer (gui_current_window->buffer); - } - } - else - { - gui_buffer_before_dcc = buffer; - gui_buffer_switch_dcc (window); - } - }*/ -} - -/* - * gui_action_jump_last_buffer: jump to last buffer - */ - -void -gui_action_jump_last_buffer (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (last_gui_buffer) - gui_buffer_switch_by_number (gui_current_window, - last_gui_buffer->number); - } -} - -/* - * gui_action_jump_previous_buffer: jump to previous buffer (the one displayed - * before current one) - */ - -void -gui_action_jump_previous_buffer (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (gui_previous_buffer) - gui_buffer_switch_by_number (gui_current_window, - gui_previous_buffer->number); - } -} - -/* - * gui_action_jump_server: jump to server buffer - */ - -void -gui_action_jump_server (char *args) -{ - /* make C compiler happy */ - (void) args; - - /*if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (GUI_SERVER(buffer)) - { - if (GUI_SERVER(buffer)->buffer != - buffer) - { - gui_window_switch_to_buffer (window, - GUI_SERVER(buffer)->buffer); - gui_window_redraw_buffer (gui_current_window->buffer); - } - } - }*/ -} - -/* - * gui_action_jump_next_server: jump to next server - */ - -void -gui_action_jump_next_server (char *args) -{ - //t_irc_server *ptr_server; - //t_gui_buffer *ptr_buffer; - - /* make C compiler happy */ - (void) args; - - /*if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (GUI_SERVER(buffer)) - { - ptr_server = GUI_SERVER(buffer)->next_server; - if (!ptr_server) - ptr_server = irc_servers; - while (ptr_server != GUI_SERVER(buffer)) - { - if (ptr_server->buffer) - break; - ptr_server = (ptr_server->next_server) ? - ptr_server->next_server : irc_servers; - } - if (ptr_server != GUI_SERVER(buffer)) - { - // save current buffer - GUI_SERVER(buffer)->saved_buffer = buffer; - - // come back to memorized chan if found - if (ptr_server->saved_buffer) - ptr_buffer = ptr_server->saved_buffer; - else - ptr_buffer = (ptr_server->channels) ? - ptr_server->channels->buffer : ptr_server->buffer; - if ((ptr_server->buffer == ptr_buffer) - && (ptr_buffer->all_servers)) - ptr_buffer->server = ptr_server; - gui_window_switch_to_buffer (window, ptr_buffer); - gui_window_redraw_buffer (gui_current_window->buffer); - } - } - }*/ -} - -/* - * gui_action_switch_server: switch server on servers buffer - * (if same buffer is used for all buffers) - */ - -void -gui_action_switch_server (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_window_switch_server (gui_current_window); -} - -/* - * gui_action_scroll_unread: scroll to first unread line of buffer - */ - -void -gui_action_scroll_unread (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - { - if (CONFIG_STRING(config_look_read_marker) && - CONFIG_STRING(config_look_read_marker)[0] && - (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) && - gui_current_window->buffer->last_read_line && - gui_current_window->buffer->last_read_line != gui_current_window->buffer->last_line) - { - gui_current_window->start_line = - gui_current_window->buffer->last_read_line->next_line; - gui_current_window->start_line_pos = 0; - gui_current_window->first_line_displayed = - (gui_current_window->start_line == gui_chat_get_first_line_displayed (gui_current_window->buffer)); - gui_buffer_ask_chat_refresh (gui_current_window->buffer, 2); - gui_status_refresh_needed = 1; - } - } -} - -/* - * gui_action_set_unread: set unread marker for all buffers - */ - -void -gui_action_set_unread (char *args) -{ - struct t_gui_buffer *ptr_buffer; - - /* make C compiler happy */ - (void) args; - - /* set read marker for all standard buffers */ - for (ptr_buffer = gui_buffers; ptr_buffer; - ptr_buffer = ptr_buffer->next_buffer) - { - if (ptr_buffer->type == GUI_BUFFER_TYPE_FORMATED) - ptr_buffer->last_read_line = ptr_buffer->last_line; - } - - /* refresh all windows */ - gui_window_redraw_all_buffers (); -} - -/* - * gui_action_hotlist_clear: clear hotlist - */ - -void -gui_action_hotlist_clear (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_hotlist) - { - gui_hotlist_free_all (&gui_hotlist, &last_gui_hotlist); - gui_window_redraw_buffer (gui_current_window->buffer); - } - gui_hotlist_initial_buffer = gui_current_window->buffer; -} - -/* - * gui_action_infobar_clear: clear infobar - */ - -void -gui_action_infobar_clear (char *args) -{ - /* make C compiler happy */ - (void) args; - - gui_infobar_remove (); - gui_infobar_draw (gui_current_window->buffer, 1); -} - -/* - * gui_action_grab_key: init "grab key mode" (next key will be inserted into input buffer) - */ - -void -gui_action_grab_key (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->input) - gui_keyboard_grab_init (); -} - -/* - * gui_action_insert_string: insert a string in command line - */ - -void -gui_action_insert_string (char *args) -{ - char *args2; - - if (args) - { - args2 = string_convert_hex_chars (args); - gui_input_insert_string (gui_current_window->buffer, (args2) ? args2 : args, -1); - gui_input_draw (gui_current_window->buffer, 0); - if (args2) - free (args2); - } -} - -/* - * gui_action_search_text: search text in buffer history - */ - -void -gui_action_search_text (char *args) -{ - /* make C compiler happy */ - (void) args; - - if (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) - { - /* toggle search */ - if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) - gui_window_search_start (gui_current_window); - else - { - gui_current_window->buffer->text_search_exact ^= 1; - gui_window_search_restart (gui_current_window); - gui_input_draw (gui_current_window->buffer, 1); - } - } -} diff --git a/src/gui/gui-action.h b/src/gui/gui-action.h deleted file mode 100644 index f44ceaa56..000000000 --- a/src/gui/gui-action.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2003-2008 by FlashCode - * See README for License detail, AUTHORS for developers list. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - - -#ifndef __WEECHAT_GUI_ACTION_H -#define __WEECHAT_GUI_ACTION_H 1 - -/* action functions */ - -extern void gui_action_clipboard_copy (char *buffer, int size); -extern void gui_action_clipboard_paste (char *args); -extern void gui_action_return (char *args); -extern void gui_action_tab (char *args); -extern void gui_action_tab_previous (char *args); -extern void gui_action_backspace (char *args); -extern void gui_action_delete (char *args); -extern void gui_action_delete_previous_word (char *args); -extern void gui_action_delete_next_word (char *args); -extern void gui_action_delete_begin_of_line (char *args); -extern void gui_action_delete_end_of_line (char *args); -extern void gui_action_delete_line (char *args); -extern void gui_action_transpose_chars (char *args); -extern void gui_action_home (char *args); -extern void gui_action_end (char *args); -extern void gui_action_left (char *args); -extern void gui_action_previous_word (char *args); -extern void gui_action_right (char *args); -extern void gui_action_next_word (char *args); -extern void gui_action_up (char *args); -extern void gui_action_up_global (char *args); -extern void gui_action_down (char *args); -extern void gui_action_down_global (char *args); -extern void gui_action_page_up (char *args); -extern void gui_action_page_down (char *args); -extern void gui_action_scroll_up (char *args); -extern void gui_action_scroll_down (char *args); -extern void gui_action_scroll_top (char *args); -extern void gui_action_scroll_bottom (char *args); -extern void gui_action_scroll_topic_left (char *args); -extern void gui_action_scroll_topic_right (char *args); -extern void gui_action_nick_beginning (char *args); -extern void gui_action_nick_end (char *args); -extern void gui_action_nick_page_up (char *args); -extern void gui_action_nick_page_down (char *args); -extern void gui_action_jump_smart (char *args); -extern void gui_action_jump_dcc (char *args); -extern void gui_action_jump_last_buffer (char *args); -extern void gui_action_jump_previous_buffer (char *args); -extern void gui_action_jump_server (char *args); -extern void gui_action_jump_next_server (char *args); -extern void gui_action_switch_server (char *args); -extern void gui_action_scroll_previous_highlight (char *args); -extern void gui_action_scroll_next_highlight (char *args); -extern void gui_action_scroll_unread (char *args); -extern void gui_action_set_unread (char *args); -extern void gui_action_hotlist_clear (char *args); -extern void gui_action_infobar_clear (char *args); -extern void gui_action_refresh_screen (char *args); -extern void gui_action_grab_key (char *args); -extern void gui_action_insert_string (char *args); -extern void gui_action_search_text (char *args); - -#endif /* gui-action.h */ diff --git a/src/gui/gui-completion.c b/src/gui/gui-completion.c index 9acb3160f..f7a108b85 100644 --- a/src/gui/gui-completion.c +++ b/src/gui/gui-completion.c @@ -449,23 +449,6 @@ gui_completion_list_add_command_hooks (struct t_gui_completion *completion) } } -/* - * gui_completion_list_add_key_cmd: add key commands/functions to completion - * list - */ - -void -gui_completion_list_add_key_cmd (struct t_gui_completion *completion) -{ - int i; - - for (i = 0; gui_key_functions[i].function_name; i++) - { - gui_completion_list_add (completion, gui_key_functions[i].function_name, - 0, WEECHAT_LIST_POS_SORT); - } -} - /* * gui_completion_list_add_self_nick: add self nick on server to completion list */ @@ -892,9 +875,6 @@ gui_completion_build_list_template (struct t_gui_completion *completion, case 'h': /* command hooks */ gui_completion_list_add_command_hooks (completion); break; - case 'k': /* key cmd/funtcions*/ - gui_completion_list_add_key_cmd (completion); - break; case 'm': /* self nickname */ gui_completion_list_add_self_nick (completion); break; diff --git a/src/gui/gui-input.c b/src/gui/gui-input.c index 3cb5dfa21..a0544e601 100644 --- a/src/gui/gui-input.c +++ b/src/gui/gui-input.c @@ -28,11 +28,19 @@ #include "../core/weechat.h" #include "../core/wee-config.h" +#include "../core/wee-input.h" +#include "../core/wee-string.h" #include "../core/wee-utf8.h" #include "../plugins/plugin.h" #include "gui-input.h" #include "gui-buffer.h" +#include "gui-chat.h" #include "gui-completion.h" +#include "gui-history.h" +#include "gui-hotlist.h" +#include "gui-infobar.h" +#include "gui-keyboard.h" +#include "gui-status.h" #include "gui-window.h" @@ -168,6 +176,158 @@ gui_input_insert_string (struct t_gui_buffer *buffer, char *string, int pos) return 0; } +/* + * gui_input_get_prompt_length: return input prompt length (displayed on screen) + */ + +int +gui_input_get_prompt_length (struct t_gui_buffer *buffer) +{ + char *pos, saved_char; + int char_size, length; + + if (buffer->text_search != GUI_TEXT_SEARCH_DISABLED) + { + if (buffer->text_search_exact) + return utf8_strlen_screen (_("Text search (exact): ")); + else + return utf8_strlen_screen (_("Text search: ")); + } + + length = 0; + pos = CONFIG_STRING(config_look_input_format); + while (pos && pos[0]) + { + switch (pos[0]) + { + case '%': + pos++; + switch (pos[0]) + { + case 'c': /* buffer name */ + length += utf8_strlen_screen (buffer->name); + pos++; + break; + case 'm': // nick modes + /*if (GUI_SERVER(buffer) && GUI_SERVER(buffer)->is_connected) + { + if (GUI_SERVER(buffer)->nick_modes + && GUI_SERVER(buffer)->nick_modes[0]) + length += strlen (GUI_SERVER(buffer)->nick_modes); + }*/ + pos++; + break; + case 'n': /* nick */ + if (buffer->input_nick) + length += utf8_strlen_screen (buffer->input_nick); + pos++; + break; + default: + length++; + if (pos[0]) + { + if (pos[0] == '%') + pos++; + else + { + length++; + pos += utf8_char_size (pos); + } + } + break; + } + break; + default: + char_size = utf8_char_size (pos); + saved_char = pos[char_size]; + pos[char_size] = '\0'; + length += utf8_strlen_screen (pos); + pos[char_size] = saved_char; + pos += char_size; + break; + } + } + return length; +} + +/* + * gui_input_clipboard_copy: copy string into clipboard + */ + +void +gui_input_clipboard_copy (char *buffer, int size) +{ + if (size <= 0) + return; + + if (gui_input_clipboard != NULL) + free (gui_input_clipboard); + + gui_input_clipboard = malloc((size + 1) * sizeof(*gui_input_clipboard)); + + if (gui_input_clipboard) + { + memcpy (gui_input_clipboard, buffer, size); + gui_input_clipboard[size] = '\0'; + } +} + +/* + * gui_action_clipboard_paste: paste clipboard at cursor pos in input line + */ + +void +gui_input_clipboard_paste () +{ + if ((gui_current_window->buffer->input) + && gui_input_clipboard) + { + gui_input_insert_string (gui_current_window->buffer, + gui_input_clipboard, -1); + gui_current_window->buffer->completion->position = -1; + gui_input_draw (gui_current_window->buffer, 0); + } +} + +/* + * gui_input_return: terminate line + */ + +void +gui_input_return () +{ + char *command; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->text_search != GUI_TEXT_SEARCH_DISABLED) + gui_window_search_stop (gui_current_window); + else if (gui_current_window->buffer->input_buffer_size > 0) + { + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + command = strdup (gui_current_window->buffer->input_buffer); + if (!command) + return; + gui_history_buffer_add (gui_current_window->buffer, + gui_current_window->buffer->input_buffer); + gui_history_global_add (gui_current_window->buffer->input_buffer); + gui_current_window->buffer->input_buffer[0] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[0] = '\0'; + gui_current_window->buffer->input_buffer_size = 0; + gui_current_window->buffer->input_buffer_length = 0; + gui_current_window->buffer->input_buffer_pos = 0; + gui_current_window->buffer->input_buffer_1st_display = 0; + gui_current_window->buffer->completion->position = -1; + gui_current_window->buffer->ptr_history = NULL; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + input_data (gui_current_window->buffer, command); + free (command); + } + } +} + /* * gui_input_complete: complete a word in input buffer */ @@ -282,194 +442,903 @@ gui_input_complete (struct t_gui_buffer *buffer) } /* - * gui_input_delete_line: delete entire input line + * gui_input_complete_next: complete with next word (default key: tab) */ void -gui_input_delete_line (struct t_gui_buffer *buffer) +gui_input_complete_next () +{ + if ((gui_current_window->buffer->input) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + gui_completion_search (gui_current_window->buffer->completion, + 1, + gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_size, + utf8_real_pos (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos)); + gui_input_complete (gui_current_window->buffer); + } +} + +/* + * gui_complete_previous: complete with previous word (default key: shift-tab) + */ + +void +gui_input_complete_previous () +{ + if ((gui_current_window->buffer->input) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + gui_completion_search (gui_current_window->buffer->completion, + -1, + gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_size, + utf8_real_pos (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos)); + gui_input_complete (gui_current_window->buffer); + } +} + +/* + * gui_input_search_text: search text in buffer history (default key: ctrl-r) + */ + +void +gui_input_search_text () +{ + if (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) + { + /* toggle search */ + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + gui_window_search_start (gui_current_window); + else + { + gui_current_window->buffer->text_search_exact ^= 1; + gui_window_search_restart (gui_current_window); + gui_input_draw (gui_current_window->buffer, 1); + } + } +} + + +/* + * gui_input_delete_previous_char: delete previous char (default key: backspace) + */ + +void +gui_input_delete_previous_char () +{ + char *pos, *pos_last; + int char_size, size_to_move; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + pos = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + pos_last = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); + char_size = pos - pos_last; + size_to_move = strlen (pos); + gui_input_move (gui_current_window->buffer, pos_last, pos, size_to_move); + gui_current_window->buffer->input_buffer_size -= char_size; + gui_current_window->buffer->input_buffer_length--; + gui_current_window->buffer->input_buffer_pos--; + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } + } +} + +/* + * gui_input_delete_next_char: delete next char (default key: del) + */ + +void +gui_input_delete_next_char () +{ + char *pos, *pos_next; + int char_size, size_to_move; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos < + gui_current_window->buffer->input_buffer_length) + { + pos = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + pos_next = utf8_next_char (pos); + char_size = pos_next - pos; + size_to_move = strlen (pos_next); + gui_input_move (gui_current_window->buffer, pos, pos_next, size_to_move); + gui_current_window->buffer->input_buffer_size -= char_size; + gui_current_window->buffer->input_buffer_length--; + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } + } +} + +/* + * gui_input_delete_previous_word: delete previous word (default key: ctrl-w) + */ + +void +gui_input_delete_previous_word () +{ + int length_deleted, size_deleted; + char *start, *string; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + start = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos - 1); + string = start; + while (string && (string[0] == ' ')) + { + string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); + } + if (string) + { + while (string && (string[0] != ' ')) + { + string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); + } + if (string) + { + while (string && (string[0] == ' ')) + { + string = utf8_prev_char (gui_current_window->buffer->input_buffer, string); + } + } + } + + if (string) + string = utf8_next_char (utf8_next_char (string)); + else + string = gui_current_window->buffer->input_buffer; + + size_deleted = utf8_next_char (start) - string; + length_deleted = utf8_strnlen (string, size_deleted); + + gui_input_clipboard_copy (string, size_deleted); + + gui_input_move (gui_current_window->buffer, string, string + size_deleted, strlen (string + size_deleted)); + + gui_current_window->buffer->input_buffer_size -= size_deleted; + gui_current_window->buffer->input_buffer_length -= length_deleted; + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_pos -= length_deleted; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } + } +} + +/* + * gui_input_delete_next_word: delete next word (default key: meta-d) + */ + +void +gui_input_delete_next_word () +{ + int size_deleted, length_deleted; + char *start, *string; + + if (gui_current_window->buffer->input) + { + start = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + string = start; + length_deleted = 0; + while (string[0]) + { + if ((string[0] == ' ') && (string > start)) + break; + string = utf8_next_char (string); + length_deleted++; + } + size_deleted = string - start; + + gui_input_clipboard_copy (start, size_deleted); + + gui_input_move (gui_current_window->buffer, start, string, strlen (string)); + + gui_current_window->buffer->input_buffer_size -= size_deleted; + gui_current_window->buffer->input_buffer_length -= length_deleted; + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } +} + + +/* + * gui_input_delete_beginning_of_line: delete all from cursor pos to beginning of line + * (default key: ctrl-u) + */ + +void +gui_input_delete_beginning_of_line () +{ + int length_deleted, size_deleted, pos_start; + char *start; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + start = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + pos_start = start - gui_current_window->buffer->input_buffer; + size_deleted = start - gui_current_window->buffer->input_buffer; + length_deleted = utf8_strnlen (gui_current_window->buffer->input_buffer, size_deleted); + gui_input_clipboard_copy (gui_current_window->buffer->input_buffer, + start - gui_current_window->buffer->input_buffer); + + gui_input_move (gui_current_window->buffer, gui_current_window->buffer->input_buffer, start, strlen (start)); + + gui_current_window->buffer->input_buffer_size -= size_deleted; + gui_current_window->buffer->input_buffer_length -= length_deleted; + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_pos = 0; + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } + } +} + +/* + * gui_input_delete_end_of_line: delete all from cursor pos to end of line + * (default key: ctrl-k) + */ + +void +gui_input_delete_end_of_line (char *args) +{ + char *start; + int size_deleted, length_deleted, pos_start; + + /* make C compiler happy */ + (void) args; + + if (gui_current_window->buffer->input) + { + start = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + pos_start = start - gui_current_window->buffer->input_buffer; + size_deleted = strlen (start); + length_deleted = utf8_strlen (start); + gui_input_clipboard_copy (start, size_deleted); + start[0] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[pos_start] = '\0'; + gui_current_window->buffer->input_buffer_size = strlen (gui_current_window->buffer->input_buffer); + gui_current_window->buffer->input_buffer_length = utf8_strlen (gui_current_window->buffer->input_buffer); + gui_input_optimize_size (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } +} + +/* + * gui_input_delete_line: delete entire line (default key: meta-r) + */ + +void +gui_input_delete_line () { if (gui_current_window->buffer->input) { - buffer->input_buffer[0] = '\0'; - buffer->input_buffer_color_mask[0] = '\0'; - buffer->input_buffer_size = 0; - buffer->input_buffer_length = 0; - buffer->input_buffer_pos = 0; - gui_input_optimize_size (buffer); - buffer->completion->position = -1; + gui_current_window->buffer->input_buffer[0] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[0] = '\0'; + gui_current_window->buffer->input_buffer_size = 0; + gui_current_window->buffer->input_buffer_length = 0; + gui_current_window->buffer->input_buffer_pos = 0; + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->completion->position = -1; + gui_input_draw (gui_current_window->buffer, 0); } } /* - * gui_input_get_prompt_length: return input prompt length (displayed on screen) - */ - -int -gui_input_get_prompt_length (struct t_gui_buffer *buffer) -{ - char *pos, saved_char; - int char_size, length; - - if (buffer->text_search != GUI_TEXT_SEARCH_DISABLED) - { - if (buffer->text_search_exact) - return utf8_strlen_screen (_("Text search (exact): ")); - else - return utf8_strlen_screen (_("Text search: ")); - } - - length = 0; - pos = CONFIG_STRING(config_look_input_format); - while (pos && pos[0]) - { - switch (pos[0]) - { - case '%': - pos++; - switch (pos[0]) - { - case 'c': /* buffer name */ - length += utf8_strlen_screen (buffer->name); - pos++; - break; - case 'm': // nick modes - /*if (GUI_SERVER(buffer) && GUI_SERVER(buffer)->is_connected) - { - if (GUI_SERVER(buffer)->nick_modes - && GUI_SERVER(buffer)->nick_modes[0]) - length += strlen (GUI_SERVER(buffer)->nick_modes); - }*/ - pos++; - break; - case 'n': /* nick */ - if (buffer->input_nick) - length += utf8_strlen_screen (buffer->input_nick); - pos++; - break; - default: - length++; - if (pos[0]) - { - if (pos[0] == '%') - pos++; - else - { - length++; - pos += utf8_char_size (pos); - } - } - break; - } - break; - default: - char_size = utf8_char_size (pos); - saved_char = pos[char_size]; - pos[char_size] = '\0'; - length += utf8_strlen_screen (pos); - pos[char_size] = saved_char; - pos += char_size; - break; - } - } - return length; -} - -/* - * gui_exec_action_dcc: execute an action on a DCC after a user input - * return -1 if DCC buffer was closed due to action, - * 0 otherwise + * gui_input_transpose_chars: transpose chars (on lth left) at cursor pos + * (default key: ctrl-t) */ void -gui_exec_action_dcc (struct t_gui_window *window, char *actions) +gui_input_transpose_chars () { - (void) window; - (void) actions; - /*t_irc_dcc *dcc_selected, *ptr_dcc, *ptr_dcc_next; - struct t_gui_window *ptr_win; - struct t_gui_buffer *ptr_buffer; + char *start, *prev_char, saved_char[5]; + int size_prev_char, size_start_char; + int pos_prev_char, pos_start; - while (actions[0]) + if (gui_current_window->buffer->input) { - if (actions[0] >= 32) + if ((gui_current_window->buffer->input_buffer_pos > 0) + && (gui_current_window->buffer->input_buffer_length > 1)) { - dcc_selected = (window->dcc_selected) ? - (t_irc_dcc *) window->dcc_selected : irc_dcc_list; + if (gui_current_window->buffer->input_buffer_pos == gui_current_window->buffer->input_buffer_length) + gui_current_window->buffer->input_buffer_pos--; - switch (actions[0]) + start = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + pos_start = start - gui_current_window->buffer->input_buffer; + prev_char = utf8_prev_char (gui_current_window->buffer->input_buffer, + start); + pos_prev_char = prev_char - gui_current_window->buffer->input_buffer; + size_prev_char = start - prev_char; + size_start_char = utf8_char_size (start); + + memcpy (saved_char, prev_char, size_prev_char); + memcpy (prev_char, start, size_start_char); + memcpy (prev_char + size_start_char, saved_char, size_prev_char); + + memcpy (saved_char, gui_current_window->buffer->input_buffer_color_mask + pos_prev_char, size_prev_char); + memcpy (gui_current_window->buffer->input_buffer_color_mask + pos_prev_char, + gui_current_window->buffer->input_buffer_color_mask + pos_start, size_start_char); + memcpy (gui_current_window->buffer->input_buffer_color_mask + pos_prev_char + size_start_char, + saved_char, size_prev_char); + + gui_current_window->buffer->input_buffer_pos++; + + gui_input_draw (gui_current_window->buffer, 0); + gui_current_window->buffer->completion->position = -1; + } + } +} + +/* + * gui_input_move_beginning_of_line: move cursor to beginning of line (default key: home) + */ + +void +gui_input_move_beginning_of_line () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + gui_current_window->buffer->input_buffer_pos = 0; + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_move_end_of_line: move cursor to end of line (default key: end) + */ + +void +gui_input_move_end_of_line () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos < + gui_current_window->buffer->input_buffer_length) + { + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_move_previous_char: move cursor to previous char (default key: left) + */ + +void +gui_input_move_previous_char () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + gui_current_window->buffer->input_buffer_pos--; + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_move_next_char: move cursor to next char (default key: right) + */ + +void +gui_input_move_next_char () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos < + gui_current_window->buffer->input_buffer_length) + { + gui_current_window->buffer->input_buffer_pos++; + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_move_previous_word: move cursor to beginning of previous word + * (default key: meta-b or ctrl-left) + */ + +void +gui_input_move_previous_word () +{ + char *pos; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos > 0) + { + pos = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos - 1); + while (pos && (pos[0] == ' ')) { - // accept DCC - case 'a': - case 'A': - if (dcc_selected - && (IRC_DCC_IS_RECV(dcc_selected->status)) - && (dcc_selected->status == IRC_DCC_WAITING)) + pos = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); + } + if (pos) + { + while (pos && (pos[0] != ' ')) + { + pos = utf8_prev_char (gui_current_window->buffer->input_buffer, pos); + } + if (pos) + pos = utf8_next_char (pos); + else + pos = gui_current_window->buffer->input_buffer; + gui_current_window->buffer->input_buffer_pos = utf8_pos (gui_current_window->buffer->input_buffer, + pos - gui_current_window->buffer->input_buffer); + } + else + gui_current_window->buffer->input_buffer_pos = 0; + + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_move_next_word: move cursor to the beginning of next word + * (default key: meta-f or ctrl-right) + */ + +void +gui_input_move_next_word () +{ + char *pos; + + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->input_buffer_pos < + gui_current_window->buffer->input_buffer_length) + { + pos = utf8_add_offset (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->input_buffer_pos); + while (pos[0] && (pos[0] == ' ')) + { + pos = utf8_next_char (pos); + } + if (pos[0]) + { + while (pos[0] && (pos[0] != ' ')) + { + pos = utf8_next_char (pos); + } + if (pos[0]) + gui_current_window->buffer->input_buffer_pos = + utf8_pos (gui_current_window->buffer->input_buffer, + pos - gui_current_window->buffer->input_buffer); + else + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + } + else + gui_current_window->buffer->input_buffer_pos = + utf8_pos (gui_current_window->buffer->input_buffer, + utf8_prev_char (gui_current_window->buffer->input_buffer, pos) - gui_current_window->buffer->input_buffer); + + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_history_previous: recall previous command (default key: up) + */ + +void +gui_input_history_previous () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (gui_current_window->buffer->ptr_history) + { + gui_current_window->buffer->ptr_history = + gui_current_window->buffer->ptr_history->next_history; + if (!gui_current_window->buffer->ptr_history) + gui_current_window->buffer->ptr_history = + gui_current_window->buffer->history; + } + else + gui_current_window->buffer->ptr_history = + gui_current_window->buffer->history; + if (gui_current_window->buffer->ptr_history) + { + /* bash/readline like use of history */ + if (gui_current_window->buffer->ptr_history->prev_history == NULL) + { + if (gui_current_window->buffer->input_buffer_size > 0) { - irc_dcc_accept (dcc_selected); + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_history_buffer_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer); + gui_history_global_add (gui_current_window->buffer->input_buffer); } - break; - // cancel DCC - case 'c': - case 'C': - if (dcc_selected - && (!IRC_DCC_ENDED(dcc_selected->status))) + } + else + { + if (gui_current_window->buffer->input_buffer_size > 0) { - irc_dcc_close (dcc_selected, IRC_DCC_ABORTED); - gui_window_redraw_buffer (window->buffer); + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + if (gui_current_window->buffer->ptr_history->prev_history->text) + free(gui_current_window->buffer->ptr_history->prev_history->text); + gui_current_window->buffer->ptr_history->prev_history->text = strdup (gui_current_window->buffer->input_buffer); } - break; - // purge old DCC - case 'p': - case 'P': - window->dcc_first = NULL; - window->dcc_selected = NULL; - window->dcc_last_displayed = NULL; - ptr_dcc = irc_dcc_list; - while (ptr_dcc) - { - ptr_dcc_next = ptr_dcc->next_dcc; - if (IRC_DCC_ENDED(ptr_dcc->status)) - irc_dcc_free (ptr_dcc); - ptr_dcc = ptr_dcc_next; - } - gui_window_redraw_buffer (window->buffer); - break; - // close DCC window - case 'q': - case 'Q': - if (gui_buffer_before_dcc) - { - ptr_buffer = window->buffer; - for (ptr_win = gui_windows; ptr_win; - ptr_win = ptr_win->next_window) - { - if (ptr_win->buffer == ptr_buffer) - gui_window_switch_to_buffer (ptr_win, - gui_buffer_before_dcc); - } - gui_buffer_free (ptr_buffer, 0); - } - else - gui_buffer_free (window->buffer, 1); - gui_window_redraw_buffer (window->buffer); - return; - break; - // remove from DCC list - case 'r': - case 'R': - if (dcc_selected - && (IRC_DCC_ENDED(dcc_selected->status))) - { - if (dcc_selected->next_dcc) - window->dcc_selected = dcc_selected->next_dcc; - else - window->dcc_selected = NULL; - irc_dcc_free (dcc_selected); - gui_window_redraw_buffer (window->buffer); - } - break; + } + gui_current_window->buffer->input_buffer_size = + strlen (gui_current_window->buffer->ptr_history->text); + gui_current_window->buffer->input_buffer_length = + utf8_strlen (gui_current_window->buffer->ptr_history->text); + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + gui_current_window->buffer->input_buffer_1st_display = 0; + strcpy (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->ptr_history->text); + gui_input_init_color_mask (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); } } - actions = utf8_next_char (actions); - }*/ + else + { + /* search backward in buffer history */ + gui_current_window->buffer->text_search = GUI_TEXT_SEARCH_BACKWARD; + (void) gui_window_search_text (gui_current_window); + } + } +} + +/* + * gui_input_history_next: recall next command (default key: down) + */ + +void +gui_input_history_next () +{ + if (gui_current_window->buffer->input) + { + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (gui_current_window->buffer->ptr_history) + { + gui_current_window->buffer->ptr_history = + gui_current_window->buffer->ptr_history->prev_history; + if (gui_current_window->buffer->ptr_history) + { + gui_current_window->buffer->input_buffer_size = + strlen (gui_current_window->buffer->ptr_history->text); + gui_current_window->buffer->input_buffer_length = + utf8_strlen (gui_current_window->buffer->ptr_history->text); + } + else + { + gui_current_window->buffer->input_buffer_size = 0; + gui_current_window->buffer->input_buffer_length = 0; + } + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + gui_current_window->buffer->input_buffer_1st_display = 0; + if (gui_current_window->buffer->ptr_history) + { + strcpy (gui_current_window->buffer->input_buffer, + gui_current_window->buffer->ptr_history->text); + gui_input_init_color_mask (gui_current_window->buffer); + } + gui_input_draw (gui_current_window->buffer, 0); + } + else + { + /* add line to history then clear input */ + if (gui_current_window->buffer->input_buffer_size > 0) + { + gui_current_window->buffer->input_buffer[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_current_window->buffer->input_buffer_color_mask[gui_current_window->buffer->input_buffer_size] = '\0'; + gui_history_buffer_add (gui_current_window->buffer, gui_current_window->buffer->input_buffer); + gui_history_global_add (gui_current_window->buffer->input_buffer); + gui_current_window->buffer->input_buffer_size = 0; + gui_current_window->buffer->input_buffer_length = 0; + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->input_buffer_pos = 0; + gui_current_window->buffer->input_buffer_1st_display = 0; + gui_input_draw (gui_current_window->buffer, 0); + } + } + } + else + { + /* search forward in buffer history */ + gui_current_window->buffer->text_search = GUI_TEXT_SEARCH_FORWARD; + (void) gui_window_search_text (gui_current_window); + } + } +} + +/* + * gui_input_history_global_previous: recall previous command in global history + * (default key: ctrl-up) + */ + +void +gui_input_history_global_previous () +{ + if ((gui_current_window->buffer->input) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + if (history_global_ptr) + { + history_global_ptr = history_global_ptr->next_history; + if (!history_global_ptr) + history_global_ptr = history_global; + } + else + history_global_ptr = history_global; + if (history_global_ptr) + { + gui_current_window->buffer->input_buffer_size = + strlen (history_global_ptr->text); + gui_current_window->buffer->input_buffer_length = + utf8_strlen (history_global_ptr->text); + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + gui_current_window->buffer->input_buffer_1st_display = 0; + strcpy (gui_current_window->buffer->input_buffer, + history_global_ptr->text); + gui_input_init_color_mask (gui_current_window->buffer); + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_history_global_next: recall next command in global history + * (default key: ctrl-down) + */ + +void +gui_input_history_global_next () +{ + if ((gui_current_window->buffer->input) + && (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED)) + { + if (history_global_ptr) + { + history_global_ptr = history_global_ptr->prev_history; + if (history_global_ptr) + { + gui_current_window->buffer->input_buffer_size = + strlen (history_global_ptr->text); + gui_current_window->buffer->input_buffer_length = + utf8_strlen (history_global_ptr->text); + } + else + { + gui_current_window->buffer->input_buffer_size = 0; + gui_current_window->buffer->input_buffer_length = 0; + } + gui_input_optimize_size (gui_current_window->buffer); + gui_current_window->buffer->input_buffer_pos = + gui_current_window->buffer->input_buffer_length; + gui_current_window->buffer->input_buffer_1st_display = 0; + if (history_global_ptr) + { + strcpy (gui_current_window->buffer->input_buffer, + history_global_ptr->text); + gui_input_init_color_mask (gui_current_window->buffer); + } + gui_input_draw (gui_current_window->buffer, 0); + } + } +} + +/* + * gui_input_jump_smart: jump to buffer with activity (default key: alt-A) + */ + +void +gui_input_jump_smart () +{ + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (gui_hotlist) + { + if (!gui_hotlist_initial_buffer) + gui_hotlist_initial_buffer = gui_current_window->buffer; + gui_window_switch_to_buffer (gui_current_window, + gui_hotlist->buffer); + gui_window_redraw_buffer (gui_current_window->buffer); + } + else + { + if (gui_hotlist_initial_buffer) + { + gui_window_switch_to_buffer (gui_current_window, + gui_hotlist_initial_buffer); + gui_window_redraw_buffer (gui_current_window->buffer); + gui_hotlist_initial_buffer = NULL; + } + } + } +} + +/* + * gui_input_jump_last_buffer: jump to last buffer + * (default key: meta-j, meta-l) + */ + +void +gui_input_jump_last_buffer () +{ + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (last_gui_buffer) + gui_buffer_switch_by_number (gui_current_window, + last_gui_buffer->number); + } +} + +/* + * gui_input_jump_previous_buffer: jump to previous buffer (the one displayed + * before current one) + * (default key: meta-j, meta-p) + */ + +void +gui_input_jump_previous_buffer () +{ + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (gui_previous_buffer) + gui_buffer_switch_by_number (gui_current_window, + gui_previous_buffer->number); + } +} + +/* + * gui_input_hotlist_clear: clear hotlist (default key: meta-h) + */ + +void +gui_input_hotlist_clear () +{ + if (gui_hotlist) + { + gui_hotlist_free_all (&gui_hotlist, &last_gui_hotlist); + gui_window_redraw_buffer (gui_current_window->buffer); + } + gui_hotlist_initial_buffer = gui_current_window->buffer; +} + +/* + * gui_input_infobar_clear: clear infobar (default key: meta-i) + */ + +void +gui_input_infobar_clear () +{ + gui_infobar_remove (); + gui_infobar_draw (gui_current_window->buffer, 1); +} + +/* + * gui_input_grab_key: init "grab key mode" (next key will be inserted into + * input buffer) (default key: meta-k) + */ + +void +gui_input_grab_key () +{ + if (gui_current_window->buffer->input) + gui_keyboard_grab_init (); +} + +/* + * gui_input_scroll_unread: scroll to first unread line of buffer + * (default key: meta-u) + */ + +void +gui_input_scroll_unread () +{ + if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) + { + if (CONFIG_STRING(config_look_read_marker) && + CONFIG_STRING(config_look_read_marker)[0] && + (gui_current_window->buffer->type == GUI_BUFFER_TYPE_FORMATED) && + gui_current_window->buffer->last_read_line && + gui_current_window->buffer->last_read_line != gui_current_window->buffer->last_line) + { + gui_current_window->start_line = + gui_current_window->buffer->last_read_line->next_line; + gui_current_window->start_line_pos = 0; + gui_current_window->first_line_displayed = + (gui_current_window->start_line == gui_chat_get_first_line_displayed (gui_current_window->buffer)); + gui_buffer_ask_chat_refresh (gui_current_window->buffer, 2); + gui_status_refresh_needed = 1; + } + } +} + +/* + * gui_input_set_unread: set unread marker for all buffers + * (default key: ctrl-s, ctrl-u) + */ + +void +gui_input_set_unread () +{ + struct t_gui_buffer *ptr_buffer; + + /* set read marker for all standard buffers */ + for (ptr_buffer = gui_buffers; ptr_buffer; + ptr_buffer = ptr_buffer->next_buffer) + { + if (ptr_buffer->type == GUI_BUFFER_TYPE_FORMATED) + ptr_buffer->last_read_line = ptr_buffer->last_line; + } + + /* refresh all windows */ + gui_window_redraw_all_buffers (); +} + +/* + * gui_input_insert: insert a string in command line + * (many default keys are bound to this function) + */ + +void +gui_input_insert (char *args) +{ + char *args2; + + if (args) + { + args2 = string_convert_hex_chars (args); + gui_input_insert_string (gui_current_window->buffer, (args2) ? args2 : args, -1); + gui_input_draw (gui_current_window->buffer, 0); + if (args2) + free (args2); + } } diff --git a/src/gui/gui-input.h b/src/gui/gui-input.h index 3a7b977c6..17fd6a573 100644 --- a/src/gui/gui-input.h +++ b/src/gui/gui-input.h @@ -34,9 +34,39 @@ extern void gui_input_move (struct t_gui_buffer *buffer, char *target, char *source, int size); extern int gui_input_insert_string (struct t_gui_buffer *buffer, char *string, int pos); -extern void gui_input_complete (struct t_gui_buffer *buffer); -extern void gui_input_delete_line (struct t_gui_buffer *buffer); extern int gui_input_get_prompt_length (struct t_gui_buffer *buffer); +extern void gui_input_return (); +extern void gui_input_clipboard_paste (); +extern void gui_input_complete_next (); +extern void gui_input_complete_previous (); +extern void gui_input_search_text (); +extern void gui_input_delete_previous_char (); +extern void gui_input_delete_next_char (); +extern void gui_input_delete_previous_word (); +extern void gui_input_delete_next_word (); +extern void gui_input_delete_beginning_of_line (); +extern void gui_input_delete_end_of_line (); +extern void gui_input_delete_line (); +extern void gui_input_transpose_chars (); +extern void gui_input_move_beginning_of_line (); +extern void gui_input_move_end_of_line (); +extern void gui_input_move_previous_char (); +extern void gui_input_move_next_char (); +extern void gui_input_move_previous_word (); +extern void gui_input_move_next_word (); +extern void gui_input_history_previous (); +extern void gui_input_history_next (); +extern void gui_input_history_global_previous (); +extern void gui_input_history_global_next (); +extern void gui_input_jump_smart (); +extern void gui_input_jump_last_buffer (); +extern void gui_input_jump_previous_buffer (); +extern void gui_input_hotlist_clear (); +extern void gui_input_infobar_clear (); +extern void gui_input_grab_key (); +extern void gui_input_scroll_unread (); +extern void gui_input_set_unread (); +extern void gui_input_insert (); /* input functions (GUI dependent) */ diff --git a/src/gui/gui-keyboard.c b/src/gui/gui-keyboard.c index 6d94d8268..cff63b9a0 100644 --- a/src/gui/gui-keyboard.c +++ b/src/gui/gui-keyboard.c @@ -33,7 +33,6 @@ #include "../core/wee-string.h" #include "../plugins/plugin.h" #include "gui-keyboard.h" -#include "gui-action.h" #include "gui-buffer.h" #include "gui-completion.h" #include "gui-input.h" @@ -57,82 +56,6 @@ int gui_keyboard_paste_lines = 0; /* number of lines for pending paste */ time_t gui_keyboard_last_activity_time = 0; /* last activity time (key) */ -struct t_gui_key_function gui_key_functions[] = -{ { "return", gui_action_return, - N_("terminate line") }, - { "tab", gui_action_tab, - N_("complete word") }, - { "tab_previous", gui_action_tab_previous, - N_("find previous completion for word") }, - { "backspace", gui_action_backspace, - N_("delete previous char") }, - { "delete", gui_action_delete, - N_("delete next char") }, - { "delete_end_line", gui_action_delete_end_of_line, - N_("delete until end of line") }, - { "delete_beginning_line", gui_action_delete_begin_of_line, - N_("delete until beginning of line") }, - { "delete_line", gui_action_delete_line, - N_("delete entire line") }, - { "delete_previous_word", gui_action_delete_previous_word, - N_("delete previous word") }, - { "delete_next_word", gui_action_delete_next_word, - N_("delete next word") }, - { "clipboard_paste", gui_action_clipboard_paste, - N_("paste current clipboard content") }, - { "transpose_chars", gui_action_transpose_chars, - N_("transpose chars") }, - { "home", gui_action_home, - N_("go to beginning of line") }, - { "end", gui_action_end, - N_("go to end of line") }, - { "left", gui_action_left, - N_("move one char left") }, - { "previous_word", gui_action_previous_word, - N_("move to previous word") }, - { "right", gui_action_right, - N_("move one char right") }, - { "next_word", gui_action_next_word, - N_("move to next word") }, - { "up", gui_action_up, - N_("call previous command in history") }, - { "up_global", gui_action_up_global, - N_("call previous command in global history") }, - { "down", gui_action_down, - N_("call next command in history") }, - { "down_global", gui_action_down_global, - N_("call next command in global history") }, - { "jump_smart", gui_action_jump_smart, - N_("jump to buffer with activity") }, - { "jump_dcc", gui_action_jump_dcc, - N_("jump to DCC buffer") }, - { "jump_last_buffer", gui_action_jump_last_buffer, - N_("jump to last buffer") }, - { "jump_previous_buffer", gui_action_jump_previous_buffer, - N_("jump to previous buffer") }, - { "jump_server", gui_action_jump_server, - N_("jump to server buffer") }, - { "jump_next_server", gui_action_jump_next_server, - N_("jump to next server") }, - { "switch_server", gui_action_switch_server, - N_("switch active server on servers buffer") }, - { "scroll_unread", gui_action_scroll_unread, - N_("scroll to first unread line in buffer") }, - { "set_unread", gui_action_set_unread, - N_("set unread marker on all buffers") }, - { "hotlist_clear", gui_action_hotlist_clear, - N_("clear hotlist") }, - { "infobar_clear", gui_action_infobar_clear, - N_("clear infobar") }, - { "grab_key", gui_action_grab_key, - N_("grab a key") }, - { "insert", gui_action_insert_string, - N_("insert a string in command line") }, - { "search_text", gui_action_search_text, - N_("search text in buffer history") }, - { NULL, NULL, NULL } -}; - /* * gui_keyboard_init: init keyboard (create default key bindings) @@ -356,13 +279,10 @@ gui_keyboard_insert_sorted (struct t_gui_key **keys, struct t_gui_key **last_key */ struct t_gui_key * -gui_keyboard_new (struct t_gui_buffer *buffer, - char *key, char *command, t_gui_key_func *function, - char *args) +gui_keyboard_new (struct t_gui_buffer *buffer, char *key, char *command) { struct t_gui_key *new_key; char *internal_code; - int length; if ((new_key = malloc (sizeof (*new_key)))) { @@ -371,23 +291,7 @@ gui_keyboard_new (struct t_gui_buffer *buffer, if (internal_code) free (internal_code); new_key->command = (command) ? strdup (command) : NULL; - new_key->function = function; - if (args) - { - if (args[0] == '"') - { - length = strlen (args); - if ((length > 1) && (args[length - 1] == '"')) - new_key->args = string_strndup (args + 1, length - 2); - else - new_key->args = strdup (args); - } - else - new_key->args = strdup (args); - } - else - new_key->args = NULL; - + if (buffer) gui_keyboard_insert_sorted (&buffer->keys, &buffer->last_key, new_key); else @@ -457,48 +361,6 @@ gui_keyboard_search_part (struct t_gui_buffer *buffer, char *key) return NULL; } -/* - * gui_keyboard_function_search_by_name: search a function by name - */ - -t_gui_key_func * -gui_keyboard_function_search_by_name (char *name) -{ - int i; - - i = 0; - while (gui_key_functions[i].function_name) - { - if (string_strcasecmp (gui_key_functions[i].function_name, name) == 0) - return gui_key_functions[i].function; - i++; - } - - /* function not found */ - return NULL; -} - -/* - * gui_keyboard_function_search_by_ptr: search a function by pointer - */ - -char * -gui_keyboard_function_search_by_ptr (t_gui_key_func *function) -{ - int i; - - i = 0; - while (gui_key_functions[i].function_name) - { - if (gui_key_functions[i].function == function) - return gui_key_functions[i].function_name; - i++; - } - - /* function not found */ - return NULL; -} - /* * gui_keyboard_bind: bind a key to a function (command or special function) * if buffer is not null, then key is specific to buffer @@ -508,9 +370,7 @@ gui_keyboard_function_search_by_ptr (t_gui_key_func *function) struct t_gui_key * gui_keyboard_bind (struct t_gui_buffer *buffer, char *key, char *command) { - t_gui_key_func *ptr_function; struct t_gui_key *new_key; - char *command2, *ptr_args; if (!key || !command) { @@ -518,43 +378,9 @@ gui_keyboard_bind (struct t_gui_buffer *buffer, char *key, char *command) return NULL; } - ptr_function = NULL; - ptr_args = NULL; - - if (command[0] != '/') - { - ptr_args = strchr (command, ' '); - if (ptr_args) - command2 = string_strndup (command, ptr_args - command); - else - command2 = strdup (command); - if (command2) - { - ptr_function = gui_keyboard_function_search_by_name (command2); - if (ptr_args) - { - ptr_args++; - while (ptr_args[0] == ' ') - ptr_args++; - } - free (command2); - } - if (!ptr_function) - { - log_printf (_("Error: unable to bind key \"%s\" " - "(invalid function name: \"%s\")"), - key, command); - return NULL; - } - } - gui_keyboard_unbind (buffer, key); - new_key = gui_keyboard_new (buffer, - key, - (ptr_function) ? NULL : command, - ptr_function, - ptr_args); + new_key = gui_keyboard_new (buffer, key, command); if (!new_key) { log_printf (_("Error: not enough memory for key binding")); @@ -646,8 +472,6 @@ gui_keyboard_pressed (char *key_str) string_free_splitted_command (commands); } } - else - (void)(ptr_key->function)(ptr_key->args); if (gui_current_window->buffer->text_search == GUI_TEXT_SEARCH_DISABLED) { @@ -685,8 +509,6 @@ gui_keyboard_free (struct t_gui_key **keys, struct t_gui_key **last_key, free (key->key); if (key->command) free (key->command); - if (key->args) - free (key->args); /* remove key from keys list */ if (key->prev_key) @@ -859,8 +681,6 @@ gui_keyboard_print_log (struct t_gui_buffer *buffer) log_printf ("%s[key (addr:0x%x)]", prefix, ptr_key); log_printf ("%skey. . . . . . . . . : '%s'", prefix, ptr_key->key); log_printf ("%scommand. . . . . . . : '%s'", prefix, ptr_key->command); - log_printf ("%sfunction . . . . . . : 0x%x", prefix, ptr_key->function); - log_printf ("%sargs . . . . . . . . : '%s'", prefix, ptr_key->args); log_printf ("%sprev_key . . . . . . : 0x%x", prefix, ptr_key->prev_key); log_printf ("%snext_key . . . . . . : 0x%x", prefix, ptr_key->next_key); } diff --git a/src/gui/gui-keyboard.h b/src/gui/gui-keyboard.h index 515b755c1..5e88f97e6 100644 --- a/src/gui/gui-keyboard.h +++ b/src/gui/gui-keyboard.h @@ -24,30 +24,18 @@ /* keyboard structures */ -typedef void (t_gui_key_func)(char *args); - struct t_gui_key { char *key; /* key combo (ex: a, ^W, ^W^C, meta-a) */ char *command; /* associated command (may be NULL) */ - t_gui_key_func *function; /* associated function (if cmd is NULL) */ - char *args; /* args for function (if cmd is NULL) */ struct t_gui_key *prev_key; /* link to previous key */ struct t_gui_key *next_key; /* link to next key */ }; -struct t_gui_key_function -{ - char *function_name; /* name of function */ - t_gui_key_func *function; /* associated function */ - char *description; /* description of function */ -}; - /* keyboard variables */ extern struct t_gui_key *gui_keys; extern struct t_gui_key *last_gui_key; -extern struct t_gui_key_function gui_key_functions[]; extern char gui_key_combo_buffer[]; extern int gui_key_grab; extern int gui_key_grab_count; @@ -65,8 +53,6 @@ extern char *gui_keyboard_get_internal_code (char *key); extern char *gui_keyboard_get_expanded_name (char *key); extern struct t_gui_key *gui_keyboard_search (struct t_gui_buffer *buffer, char *key); -extern t_gui_key_func *gui_keyboard_function_search_by_name (char *name); -extern char *gui_keyboard_function_search_by_ptr (t_gui_key_func *function); extern struct t_gui_key *gui_keyboard_bind (struct t_gui_buffer *buffer, char *key, char *command); extern int gui_keyboard_unbind (struct t_gui_buffer *buffer, char *key);