summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2011-04-22 21:56:54 +0200
committerSebastien Helleu <flashcode@flashtux.org>2011-04-22 21:56:54 +0200
commit634478dd54b3043f44922bea6c1de0220aaf4e30 (patch)
treedcd8b81a4e46763053125a18dcb70aaf4223b947
parentb7853444d80d5be64531b7eefbfa2bb2b07abe42 (diff)
downloadweechat-634478dd54b3043f44922bea6c1de0220aaf4e30.zip
core: add option "swap" for command /window (key: alt+"w" + alt+"s") (task #11001)
-rw-r--r--ChangeLog4
-rw-r--r--doc/de/autogen/user/weechat_commands.txt62
-rw-r--r--doc/de/weechat_user.de.txt2
-rw-r--r--doc/en/autogen/user/weechat_commands.txt2
-rw-r--r--doc/en/weechat_user.en.txt1
-rw-r--r--doc/fr/autogen/user/weechat_commands.txt2
-rw-r--r--doc/fr/weechat_user.fr.txt1
-rw-r--r--doc/it/autogen/user/weechat_commands.txt66
-rw-r--r--doc/it/weechat_user.it.txt2
-rw-r--r--po/cs.po7
-rw-r--r--po/de.po8
-rw-r--r--po/es.po7
-rw-r--r--po/fr.po12
-rw-r--r--po/hu.po6
-rw-r--r--po/it.po8
-rw-r--r--po/pl.po7
-rw-r--r--po/pt_BR.po7
-rw-r--r--po/ru.po6
-rw-r--r--po/weechat.pot6
-rw-r--r--src/core/wee-command.c46
-rw-r--r--src/gui/curses/gui-curses-keyboard.c1
-rw-r--r--src/gui/curses/gui-curses-window.c57
-rw-r--r--src/gui/gtk/gui-gtk-window.c18
-rw-r--r--src/gui/gui-window.h1
24 files changed, 248 insertions, 91 deletions
diff --git a/ChangeLog b/ChangeLog
index 179e51e25..f9f402ce5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,14 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
-v0.3.5-rc1, 2011-04-21
+v0.3.5-rc1, 2011-04-22
Version 0.3.5 (under dev!)
--------------------------
+* core: add option "swap" for command /window (key: alt+"w" + alt+"s")
+ (task #11001)
* core: apply new value of option weechat.look.buffer_notify_default to all
opened buffers
* core: prohibit names beginning with "#" for bars, proxies, filters and IRC
diff --git a/doc/de/autogen/user/weechat_commands.txt b/doc/de/autogen/user/weechat_commands.txt
index d11f0cb3b..7f10bcb81 100644
--- a/doc/de/autogen/user/weechat_commands.txt
+++ b/doc/de/autogen/user/weechat_commands.txt
@@ -524,42 +524,44 @@ Beispiele:
page_up|page_down
refresh
scroll|scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|scroll_next_highlight
+ swap [up|down|left|right]
zoom
- list: listet die geöffneten Fenster (ohne Angabe von Parametern wird diese Funktion aufgerufen)
- -1: springt zum vorherigen Fenster
- +1: springt zum nächsten Fenster
- b#: springt zum nächsten Fenster, welches die Buffer Nummer # besitzt
- up: wechselt zum Fenster über dem aktuellen
- down: wechselt zum Fenster unter dem aktuellen
- left: wechselt zum linken Fenster
- right: wechselt zum rechten Fenster
- splith: teilt das aktuelle Fenster horizontal
- splitv: teilt das aktuelle Fenster vertikal
- resize: verändert die Größe des aktuellen Fensters. Die neue Größe des Fensters ist prozentual <pct> zum Stammfensters groß
- merge: vereinigt Fenster miteinander (all = alle Fenster vereinigen)
- page_up: Scrollt eine Seite nach oben
- page_down: Scrollt eine Seite nach unten
- refresh: Seite wird neu aufgebaut
- scroll: Scrollt eine Anzahl an Zeilen (+/-N) oder zu einer gewissen Zeit: s=Sekunden, m=Minuten, h=Stunden, d=Tage, M=Monate, y=Jahre
- scroll_up: Scrollt ein paar Zeilen nach oben
- scroll_down: Scrollt ein paar Zeilen nach unten
- scroll_top: Scrollt zum Anfang des Buffers
-scroll_bottom: Scrollt zum Ende des Buffers
-scroll_previous_highlight: Scrollt zum vorherigen Hightlight
-scroll_next_highlight: Scrollt zum nächsten Highlight
- zoom: vergrößert auf Fenster
-
-Bei splith und splitv gibt "pct" die neue Größe des Fensters im Verhältnis zur aktuellen Größe an. Zum Beispiel würde der Wert 25 bedeuten, dass das neue Fenster nur noch ein Viertel der Größe des alten Fensters hat.
+ list: list opened windows (without argument, this list is displayed)
+ -1: jump to previous window
+ +1: jump to next window
+ b#: jump to next window displaying buffer number #
+ up: switch to window above current one
+ down: switch to window below current one
+ left: switch to window on the left
+ right: switch to window on the right
+ splith: split current window horizontally
+ splitv: split current window vertically
+ resize: resize window size, new size is <pct> percentage of parent window
+ merge: merge window with another (all = keep only one window)
+ page_up: scroll one page up
+ page_down: scroll one page down
+ refresh: refresh screen
+ scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years
+ scroll_up: scroll a few lines up
+ scroll_down: scroll a few lines down
+ scroll_top: scroll to top of buffer
+scroll_bottom: scroll to bottom of buffer
+scroll_previous_highlight: scroll to previous highlight
+scroll_next_highlight: scroll to next highlight
+ swap: swap buffers of two windows (with optional direction for target window)
+ zoom: zoom on window
+
+For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
-Beispiele:
- Springt zum Fenster mit dem Buffer #1:
+Examples:
+ jump to window displaying buffer #1:
/window b1
- Scrollt zwei Zeilen hoch:
+ scroll 2 lines up:
/window scroll -2
- Scrollt zwei Tage hoch: /window scroll -2d
+ scroll 2 days up:
/window scroll -2d
- Scrollt zum Beginn des aktuellen Tages:
+ scroll to beginning of current day:
/window scroll -d
........................................
diff --git a/doc/de/weechat_user.de.txt b/doc/de/weechat_user.de.txt
index 6761d5088..90fdb2150 100644
--- a/doc/de/weechat_user.de.txt
+++ b/doc/de/weechat_user.de.txt
@@ -501,6 +501,8 @@ Tastenbefehle für Buffer / Fenster
| @k(A-)@k(w) , @k(A-)@k(↓) | wechselt zum unteren Fenster | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | wechselt zum linken Fenster | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | wechselt zum rechten Fenster | /window right
+// TRANSLATION MISSING
+| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Zoom für aktuelles Fenster (nochmals @k(A-)@k(z): stellt die vorherigen Einstellungen wieder her) | /window zoom
| @k(A-)@k(<) | springt zum letzten besuchten Buffer | /input jump_previously_visited_buffer
| @k(A-)@k(>) | springt zum nächsten besuchten Buffer | /input jump_next_visited_buffer
diff --git a/doc/en/autogen/user/weechat_commands.txt b/doc/en/autogen/user/weechat_commands.txt
index 36cf2edc4..20f87453e 100644
--- a/doc/en/autogen/user/weechat_commands.txt
+++ b/doc/en/autogen/user/weechat_commands.txt
@@ -524,6 +524,7 @@ Examples:
page_up|page_down
refresh
scroll|scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|scroll_next_highlight
+ swap [up|down|left|right]
zoom
list: list opened windows (without argument, this list is displayed)
@@ -548,6 +549,7 @@ Examples:
scroll_bottom: scroll to bottom of buffer
scroll_previous_highlight: scroll to previous highlight
scroll_next_highlight: scroll to next highlight
+ swap: swap buffers of two windows (with optional direction for target window)
zoom: zoom on window
For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
diff --git a/doc/en/weechat_user.en.txt b/doc/en/weechat_user.en.txt
index 18b3dfe9a..b2e144ed9 100644
--- a/doc/en/weechat_user.en.txt
+++ b/doc/en/weechat_user.en.txt
@@ -503,6 +503,7 @@ Keys for buffers / windows
| @k(A-)@k(w) , @k(A-)@k(↓) | Switch to window below | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | Switch to window on the left | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Switch to window on the right | /window right
+| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Zoom on current window (@k(A-)@k(z) again: restore initial windows state, before zoom) | /window zoom
| @k(A-)@k(<) | Switch to previous buffer in list of visited buffers | /input jump_previously_visited_buffer
| @k(A-)@k(>) | Switch to next buffer in list of visited buffers | /input jump_next_visited_buffer
diff --git a/doc/fr/autogen/user/weechat_commands.txt b/doc/fr/autogen/user/weechat_commands.txt
index 80d6a3a19..1f528f287 100644
--- a/doc/fr/autogen/user/weechat_commands.txt
+++ b/doc/fr/autogen/user/weechat_commands.txt
@@ -524,6 +524,7 @@ Exemples:
page_up|page_down
refresh
scroll|scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|scroll_next_highlight
+ swap [up|down|left|right]
zoom
list: lister les fenêtres ouvertes (sans paramètre, cette liste est affichée)
@@ -548,6 +549,7 @@ Exemples:
scroll_bottom: faire défiler jusqu'en bas du tampon
scroll_previous_highlight: faire défiler jusqu'au highlight précédent
scroll_next_highlight: faire défiler jusqu'au highlight suivant
+ swap: échanger les tampons de deux fenêtres (avec une direction facultative pour la fenêtre cible)
zoom: zoomer sur la fenêtre
Pour splith et splitv, pct est un pourcentage qui représente la taille de la nouvelle fenêtre, calculée par rapport à la taille de la fenêtre courante. Par exemple 25 signifie créer une fenêtre qui a pour taille: taille_courante / 4
diff --git a/doc/fr/weechat_user.fr.txt b/doc/fr/weechat_user.fr.txt
index 378bbc5ff..618dab190 100644
--- a/doc/fr/weechat_user.fr.txt
+++ b/doc/fr/weechat_user.fr.txt
@@ -511,6 +511,7 @@ Touches pour les tampons / fenêtres
| @k(A-)@k(w) , @k(A-)@k(↓) | Sauter à la fenêtre en dessous | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | Sauter à la fenêtre de gauche | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Sauter à la fenêtre de droite | /window right
+| @k(A-)@k(w) , @k(A-)@k(s) | Echanger les tampons de deux fenêtres | /window swap
| @k(A-)@k(z) | Zoom sur la fenêtre courante (@k(A-)@k(z) de nouveau : restaurer l'état initial des fenêtres, avant le zoom) | /window zoom
| @k(A-)@k(<) | Sauter au tampon précédent dans la liste des tampons visités | /input jump_previously_visited_buffer
| @k(A-)@k(>) | Sauter au tampon suivant dans la liste des tampons visités | /input jump_next_visited_buffer
diff --git a/doc/it/autogen/user/weechat_commands.txt b/doc/it/autogen/user/weechat_commands.txt
index b5093379e..7fdbf4c77 100644
--- a/doc/it/autogen/user/weechat_commands.txt
+++ b/doc/it/autogen/user/weechat_commands.txt
@@ -519,47 +519,49 @@ Esempi:
/window list
-1|+1|b#|up|down|left|right
splith|splitv [<pct>]
- resize [+/-] <pct>
+ resize [+/-]<pct>
merge [all]
page_up|page_down
refresh
scroll|scroll_up|scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|scroll_next_highlight
+ swap [up|down|left|right]
zoom
- list: elenca le finestre aperte (senza argomento, questa lista viene visualizzata)
- -1: salta alla finestra precedente
- +1: salta alla finestra successiva
- b#: salta alla finestra successiva che visualizza il buffer numero #
- up: passa alla finestra superiore a quella corrente
- down: passa alla finestra inferiore a quella attiva
- left: passa alla finestra a sinistra
- right: passa alla finestra a destra
- splith: divide la finestra attiva orizzontalmente
- splitv: divide la finestra attiva verticalmente
- resize: ridimensiona finestra, la nuova dimensione è <pct> percentuale della finestra genitore
- merge: unisce la finestra con un'altra (all = mantiente una sola finestra)
- page_up: scorre di una pagina in alto
- page_down: scorre di una pagina in basso
- refresh: aggiorna lo schermo
- scroll: scorre di un numero di righe (+/-N) o in base al tempo: s=secondi, m=minuti, h=ore, d=giorni, M=mesi, y=anni
- scroll_up: scorre di alcune righe in alto
- scroll_down: scorre di alcune righe in basso
- scroll_top: scorre fino all'inizio del buffer
-scroll_bottom: scorre fino alla fine del buffer buffer
-scroll_previous_highlight: passa all'evento precedente
- scroll_next_highlight: passa all'evento successivo
- zoom: ingrandimento sulla finestra
-
-Per splith e splitv, pct è una percentuale che rappresenta la dimensione della nuova finestra, calcolata con la finestra attiva come riferimento per la dimensione. Per esempio 25 vuol dire creare una finestra di dimensione = dimensione_attuale / 4
+ list: list opened windows (without argument, this list is displayed)
+ -1: jump to previous window
+ +1: jump to next window
+ b#: jump to next window displaying buffer number #
+ up: switch to window above current one
+ down: switch to window below current one
+ left: switch to window on the left
+ right: switch to window on the right
+ splith: split current window horizontally
+ splitv: split current window vertically
+ resize: resize window size, new size is <pct> percentage of parent window
+ merge: merge window with another (all = keep only one window)
+ page_up: scroll one page up
+ page_down: scroll one page down
+ refresh: refresh screen
+ scroll: scroll number of lines (+/-N) or with time: s=seconds, m=minutes, h=hours, d=days, M=months, y=years
+ scroll_up: scroll a few lines up
+ scroll_down: scroll a few lines down
+ scroll_top: scroll to top of buffer
+scroll_bottom: scroll to bottom of buffer
+scroll_previous_highlight: scroll to previous highlight
+scroll_next_highlight: scroll to next highlight
+ swap: swap buffers of two windows (with optional direction for target window)
+ zoom: zoom on window
+
+For splith and splitv, pct is a percentage which represents size of new window, computed with current window as size reference. For example 25 means create a new window with size = current_size / 4
-Esempi:
- salta alla finestra che visualizza il buffer #1:
+Examples:
+ jump to window displaying buffer #1:
/window b1
- scorre di due righe in alto:
+ scroll 2 lines up:
/window scroll -2
- scorre all'indietro di due giorni:
+ scroll 2 days up:
/window scroll -2d
- scorre all'inizio del giorno attuale:
- /window scroll -d
+ scroll to beginning of current day:
+ /window scroll -d
........................................
diff --git a/doc/it/weechat_user.it.txt b/doc/it/weechat_user.it.txt
index daa286f32..81b0c5815 100644
--- a/doc/it/weechat_user.it.txt
+++ b/doc/it/weechat_user.it.txt
@@ -512,6 +512,8 @@ Tasti per buffer / finestre
| @k(A-)@k(w) , @k(A-)@k(↓) | Passa alla finestra in basso | /window down
| @k(A-)@k(w) , @k(A-)@k(←) | Passa alla finestra sulla sinistra | /window left
| @k(A-)@k(w) , @k(A-)@k(→) | Passa alla finestrs sulla destra | /window right
+// TRANSLATION MISSING
+| @k(A-)@k(w) , @k(A-)@k(s) | Swap buffers of two windows | /window swap
| @k(A-)@k(z) | Ingrandimento sulla finestra attiva (@k(A-)@k(z) di nuovo: ripristina lo stato iniziale della finestra, prima dell'ingrandimento) | /window zoom
| @k(A-)@k(<) | Passa al buffer precedente nella lista dei buffer visitati | /input jump_previously_visited_buffer
| @k(A-)@k(>) | Passa al buffer successivo nella lista dei buffer visitati | /input jump_next_visited_buffer
diff --git a/po/cs.po b/po/cs.po
index 54388d984..c8813dace 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 17:32+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1723,13 +1723,14 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
"scroll_up | scroll_down | scroll_top | scroll_bottom | "
"scroll_previous_highlight | scroll_next_highlight | zoom]"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1756,6 +1757,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/de.po b/po/de.po
index 6c68b6137..3fea2e188 100644
--- a/po/de.po
+++ b/po/de.po
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-15 21:04+0100\n"
"Last-Translator: Nils G.\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1861,17 +1861,19 @@ msgstr ""
msgid "manage windows"
msgstr "Fenster verwalten"
+#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || zoom"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1898,6 +1900,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/es.po b/po/es.po
index aaa43c686..7a935fef2 100644
--- a/po/es.po
+++ b/po/es.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 17:31+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1762,13 +1762,14 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
"scroll_up | scroll_down | scroll_top | scroll_bottom | "
"scroll_previous_highlight | scroll_next_highlight | zoom]"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1795,6 +1796,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/fr.po b/po/fr.po
index c807b7f56..f0fd9905d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
-"PO-Revision-Date: 2011-04-19 20:10+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
+"PO-Revision-Date: 2011-04-22 17:52+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -1820,12 +1820,12 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgid ""
" list: list opened windows (without argument, this list is "
@@ -1853,6 +1853,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
@@ -1894,6 +1896,8 @@ msgstr ""
"scroll_bottom: faire défiler jusqu'en bas du tampon\n"
"scroll_previous_highlight: faire défiler jusqu'au highlight précédent\n"
"scroll_next_highlight: faire défiler jusqu'au highlight suivant\n"
+" swap: échanger les tampons de deux fenêtres (avec une direction "
+"facultative pour la fenêtre cible)\n"
" zoom: zoomer sur la fenêtre\n"
"\n"
"Pour splith et splitv, pct est un pourcentage qui représente la taille de la "
diff --git a/po/hu.po b/po/hu.po
index 85e39460a..8290e48be 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 11:21+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1523,7 +1523,7 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1555,6 +1555,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/it.po b/po/it.po
index 4b5d874a7..0aff7445c 100644
--- a/po/it.po
+++ b/po/it.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 17:33+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1808,17 +1808,19 @@ msgstr ""
msgid "manage windows"
msgstr "gestione finestre"
+#, fuzzy
msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-] "
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight || zoom"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1845,6 +1847,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/pl.po b/po/pl.po
index 8efaa9894..2a751b2fb 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 17:32+0200\n"
"Last-Translator: Krzysztof Koroscik <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1768,13 +1768,14 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
"scroll_up | scroll_down | scroll_top | scroll_bottom | "
"scroll_previous_highlight | scroll_next_highlight | zoom]"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1801,6 +1802,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/pt_BR.po b/po/pt_BR.po
index ba88ca9bf..e749dc957 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 11:22+0200\n"
"Last-Translator: Ivan Sichmann Freitas <ivansichfreitas@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1752,13 +1752,14 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all] | page_up | page_down | refresh | scroll | "
"scroll_up | scroll_down | scroll_top | scroll_bottom | "
"scroll_previous_highlight | scroll_next_highlight | zoom]"
+#, fuzzy
msgid ""
" list: list opened windows (without argument, this list is "
"displayed)\n"
@@ -1785,6 +1786,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/ru.po b/po/ru.po
index 0dafe9a41..993f7535d 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.5-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
-"POT-Creation-Date: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: 2011-04-10 17:33+0200\n"
"Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1532,7 +1532,7 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
"[list | -1 | +1 | b# | up | down | left | right | splith [pct] | splitv "
"[pct] | resize pct | merge [all]]"
@@ -1564,6 +1564,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/po/weechat.pot b/po/weechat.pot
index 77e952ee2..761786c7e 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: 2011-04-19 20:09+0200\n"
+"POT-Creation-Date: 2011-04-22 21:56+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1334,7 +1334,7 @@ msgid ""
"list || -1|+1|b#|up|down|left|right || splith|splitv [<pct>] || resize [+/-]"
"<pct> || merge [all] || page_up|page_down || refresh || scroll|scroll_up|"
"scroll_down|scroll_top|scroll_bottom|scroll_previous_highlight|"
-"scroll_next_highlight || zoom"
+"scroll_next_highlight || swap [up|down|left|right] || zoom"
msgstr ""
msgid ""
@@ -1363,6 +1363,8 @@ msgid ""
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+" swap: swap buffers of two windows (with optional direction for "
+"target window)\n"
" zoom: zoom on window\n"
"\n"
"For splith and splitv, pct is a percentage which represents size of new "
diff --git a/src/core/wee-command.c b/src/core/wee-command.c
index 9b901db07..a48a50643 100644
--- a/src/core/wee-command.c
+++ b/src/core/wee-command.c
@@ -4568,7 +4568,37 @@ COMMAND_CALLBACK(window)
gui_window_scroll (gui_current_window, argv[2]);
return WEECHAT_RC_OK;
}
-
+
+ /* swap windows */
+ if (string_strcasecmp (argv[1], "swap") == 0)
+ {
+ if (argc > 2)
+ {
+ if (string_strcasecmp (argv[2], "up") == 0)
+ gui_window_swap (gui_current_window, 1);
+ else if (string_strcasecmp (argv[2], "down") == 0)
+ gui_window_swap (gui_current_window, 3);
+ else if (string_strcasecmp (argv[2], "left") == 0)
+ gui_window_swap (gui_current_window, 4);
+ else if (string_strcasecmp (argv[2], "right") == 0)
+ gui_window_swap (gui_current_window, 2);
+ else
+ {
+ gui_chat_printf (NULL,
+ _("%sError: unknown option for \"%s\" "
+ "command"),
+ gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
+ "window swap");
+ return WEECHAT_RC_OK;
+ }
+ }
+ else
+ {
+ gui_window_swap (gui_current_window, 0);
+ }
+ return WEECHAT_RC_OK;
+ }
+
/* zoom window */
if (string_strcasecmp (argv[1], "zoom") == 0)
{
@@ -5231,6 +5261,7 @@ command_init ()
" || scroll|scroll_up|scroll_down|scroll_top|"
"scroll_bottom|scroll_previous_highlight|"
"scroll_next_highlight"
+ " || swap [up|down|left|right]"
" || zoom"),
N_(" list: list opened windows (without argument, "
"this list is displayed)\n"
@@ -5258,6 +5289,8 @@ command_init ()
"scroll_bottom: scroll to bottom of buffer\n"
"scroll_previous_highlight: scroll to previous highlight\n"
"scroll_next_highlight: scroll to next highlight\n"
+ " swap: swap buffers of two windows (with optional "
+ "direction for target window)\n"
" zoom: zoom on window\n\n"
"For splith and splitv, pct is a percentage which "
"represents size of new window, computed with current "
@@ -5272,11 +5305,12 @@ command_init ()
" /window scroll -2d\n"
" scroll to beginning of current day:\n"
" /window scroll -d"),
- "list|-1|+1|up|down|left|right|splith|splitv|resize|page_up|"
- "page_down|refresh|scroll_up|scroll|scroll_down|scroll_top|"
- "scroll_bottom|scroll_previous_highlight|"
- "scroll_next_highlight|zoom"
- " || merge all",
+ "list || -1 || +1 || up || down || left || right"
+ " || splith || splitv || resize || page_up || page_down"
+ " || refresh || scroll || scroll_up || scroll_down"
+ " || scroll_top || scroll_bottom"
+ " || scroll_previous_highlight || scroll_next_highlight"
+ " || swap up|down|left|right || zoom || merge all",
&command_window, NULL);
}
diff --git a/src/gui/curses/gui-curses-keyboard.c b/src/gui/curses/gui-curses-keyboard.c
index c0e782e97..f7467937c 100644
--- a/src/gui/curses/gui-curses-keyboard.c
+++ b/src/gui/curses/gui-curses-keyboard.c
@@ -185,6 +185,7 @@ gui_keyboard_default_bindings ()
BIND(/* m-w,m-right */ "meta-wmeta2-1;3C", "/window right");
BIND(/* m-w,m-left */ "meta-wmeta-meta2-D", "/window left");
BIND(/* m-w,m-left */ "meta-wmeta2-1;3D", "/window left");
+ BIND(/* m-w,m-s */ "meta-wmeta-s", "/window swap");
BIND(/* m-z */ "meta-z", "/window zoom");
BIND(/* m-= */ "meta-=", "/filter toggle");
BIND(/* m-0 */ "meta-0", "/buffer *10");
diff --git a/src/gui/curses/gui-curses-window.c b/src/gui/curses/gui-curses-window.c
index 6566709c1..2fc3208ab 100644
--- a/src/gui/curses/gui-curses-window.c
+++ b/src/gui/curses/gui-curses-window.c
@@ -1955,6 +1955,63 @@ gui_window_switch_right (struct t_gui_window *window)
}
/*
+ * gui_window_swap: swap buffers of two windows
+ * direction can be: 0 = auto (swap with sister)
+ * 1 = window above
+ * 2 = window on the right
+ * 3 = window below
+ * 4 = window on the left
+ */
+
+void
+gui_window_swap (struct t_gui_window *window, int direction)
+{
+ struct t_gui_window_tree *parent, *sister;
+ struct t_gui_window *window2, *ptr_win;
+ struct t_gui_buffer *buffer1;
+
+ if (!window || !gui_ok)
+ return;
+
+ window2 = NULL;
+
+ if (direction == 0)
+ {
+ /* search sister window */
+ parent = window->ptr_tree->parent_node;
+ if (parent)
+ {
+ sister = (parent->child1->window == window) ?
+ parent->child2 : parent->child1;
+ if (sister->window)
+ window2 = sister->window;
+ }
+ }
+ else
+ {
+ /* search window using direction */
+ for (ptr_win = gui_windows; ptr_win;
+ ptr_win = ptr_win->next_window)
+ {
+ if ((ptr_win != window) &&
+ (gui_window_side_by_side (window, ptr_win) == direction))
+ {
+ window2 = ptr_win;
+ break;
+ }
+ }
+ }
+
+ /* let's swap! */
+ if (window2 && (window->buffer != window2->buffer))
+ {
+ buffer1 = window->buffer;
+ gui_window_switch_to_buffer (window, window2->buffer, 0);
+ gui_window_switch_to_buffer (window2, buffer1, 0);
+ }
+}
+
+/*
* gui_window_refresh_screen: called when term size is modified
* full_refresh == 1 when Ctrl+L is pressed,
* or if terminal is resized
diff --git a/src/gui/gtk/gui-gtk-window.c b/src/gui/gtk/gui-gtk-window.c
index 1603f286e..ba64b7d38 100644
--- a/src/gui/gtk/gui-gtk-window.c
+++ b/src/gui/gtk/gui-gtk-window.c
@@ -792,6 +792,24 @@ gui_window_switch_right (struct t_gui_window *window)
}
/*
+ * gui_window_swap: swap buffer of two windows
+ * direction can be: 0 = auto (swap with sister)
+ * 1 = window above
+ * 2 = window on the right
+ * 3 = window below
+ * 4 = window on the left
+ */
+
+void
+gui_window_swap (struct t_gui_window *window, int direction)
+{
+ (void) window;
+ (void) direction;
+
+ /* TODO: write this function for Gtk */
+}
+
+/*
* gui_window_refresh_screen: called when term size is modified
*/
diff --git a/src/gui/gui-window.h b/src/gui/gui-window.h
index 6aabcb57e..06acca662 100644
--- a/src/gui/gui-window.h
+++ b/src/gui/gui-window.h
@@ -187,6 +187,7 @@ extern void gui_window_switch_up (struct t_gui_window *window);
extern void gui_window_switch_down (struct t_gui_window *window);
extern void gui_window_switch_left (struct t_gui_window *window);
extern void gui_window_switch_right (struct t_gui_window *window);
+extern void gui_window_swap (struct t_gui_window *window, int direction);
extern void gui_window_refresh_screen (int full_refresh);
extern void gui_window_set_title (const char *title);
extern void gui_window_term_display_infos ();