1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-28 05:46:38 +02:00

Improved window management: new window may have different size (% of current

window size), window sizes are automatically recomputed when term window is
resized
This commit is contained in:
Sebastien Helleu
2005-11-13 15:51:00 +00:00
parent 3a2fdde999
commit e63da66644
20 changed files with 2480 additions and 1986 deletions
+2 -1
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-11-11
WeeChat known bugs, 2005-11-13
- some refresh bugs with splited windows
- ./configure does not check that Ruby libraries are installed
@@ -11,3 +11,4 @@ WeeChat known bugs, 2005-11-11
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- WeeChat may crash if too much nicks in nicklist when position is top or bottom
- crash when using non colored term
+190 -177
View File
File diff suppressed because it is too large Load Diff
+240 -233
View File
File diff suppressed because it is too large Load Diff
+198 -179
View File
File diff suppressed because it is too large Load Diff
+182 -172
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2005-11-11 10:15+0100\n"
"POT-Creation-Date: 2005-11-13 16:40+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1289,7 +1289,7 @@ msgstr ""
msgid "%s: using local hostname \"%s\"\n"
msgstr ""
#: src/irc/irc-send.c:175 src/common/command.c:783
#: src/irc/irc-send.c:175 src/common/command.c:787
#, c-format
msgid "%s cannot find nick for sending message\n"
msgstr ""
@@ -1305,8 +1305,8 @@ msgstr ""
#: src/irc/irc-send.c:472 src/irc/irc-send.c:484 src/irc/irc-send.c:502
#: src/irc/irc-send.c:1166 src/irc/irc-send.c:1264 src/irc/irc-send.c:1796
#: src/common/command.c:1310 src/common/command.c:1749
#: src/common/command.c:1885
#: src/common/command.c:1353 src/common/command.c:1798
#: src/common/command.c:1934
#, c-format
msgid "%s wrong argument count for \"%s\" command\n"
msgstr ""
@@ -1644,11 +1644,11 @@ msgstr ""
msgid "%s[%s%s%s]%s idle: "
msgstr ""
#: src/irc/irc-recv.c:3134 src/common/command.c:2677 src/common/command.c:2698
#: src/irc/irc-recv.c:3134 src/common/command.c:2731 src/common/command.c:2752
msgid "days"
msgstr ""
#: src/irc/irc-recv.c:3134 src/common/command.c:2677 src/common/command.c:2698
#: src/irc/irc-recv.c:3134 src/common/command.c:2731 src/common/command.c:2752
msgid "day"
msgstr ""
@@ -2117,64 +2117,64 @@ msgstr ""
msgid "%s lag is high, disconnecting from server...\n"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "bytes"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Kb"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Mb"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Gb"
msgstr ""
#: src/gui/curses/gui-display.c:1921
#: src/gui/curses/gui-display.c:1926
msgid "<servers>"
msgstr ""
#: src/gui/curses/gui-display.c:1933
#: src/gui/curses/gui-display.c:1938
msgid "(away)"
msgstr ""
#: src/gui/curses/gui-display.c:2067
#: src/gui/curses/gui-display.c:2072
msgid "[not connected] "
msgstr ""
#: src/gui/curses/gui-display.c:2077
#: src/gui/curses/gui-display.c:2082
msgid "Act: "
msgstr ""
#: src/gui/curses/gui-display.c:2165
#: src/gui/curses/gui-display.c:2170
#, c-format
msgid "Lag: %.1f"
msgstr ""
#: src/gui/curses/gui-display.c:2181
#: src/gui/curses/gui-display.c:2186
msgid "-MORE-"
msgstr ""
#: src/gui/curses/gui-display.c:2359
#: src/gui/curses/gui-display.c:2364
msgid " [A] Accept"
msgstr ""
#: src/gui/curses/gui-display.c:2360 src/gui/curses/gui-display.c:2364
#: src/gui/curses/gui-display.c:2365 src/gui/curses/gui-display.c:2369
msgid " [C] Cancel"
msgstr ""
#: src/gui/curses/gui-display.c:2369
#: src/gui/curses/gui-display.c:2374
msgid " [R] Remove"
msgstr ""
#: src/gui/curses/gui-display.c:2373
#: src/gui/curses/gui-display.c:2378
msgid " [P] Purge old DCC"
msgstr ""
#: src/gui/curses/gui-display.c:2374
#: src/gui/curses/gui-display.c:2379
msgid " [Q] Close DCC view"
msgstr ""
@@ -2182,11 +2182,11 @@ msgstr ""
msgid "server"
msgstr ""
#: src/gui/gui-common.c:509
#: src/gui/gui-common.c:637
msgid "Not enough memory for new line\n"
msgstr ""
#: src/gui/gui-common.c:854
#: src/gui/gui-common.c:982
msgid "Not enough memory for infobar message\n"
msgstr ""
@@ -2338,7 +2338,7 @@ msgstr ""
msgid "grab a key"
msgstr ""
#: src/gui/gui-keyboard.c:428 src/common/command.c:1764
#: src/gui/gui-keyboard.c:428 src/common/command.c:1813
#, c-format
msgid "%s unable to bind key \"%s\"\n"
msgstr ""
@@ -2424,36 +2424,37 @@ msgid "print debug messages"
msgstr ""
#: src/common/command.c:69
msgid "dump"
msgid "dump | windows"
msgstr ""
#: src/common/command.c:70
msgid ""
"dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)"
"WeeChat crashes)\n"
"windows: display windows tree"
msgstr ""
#: src/common/command.c:72
#: src/common/command.c:73
msgid "display help about commands"
msgstr ""
#: src/common/command.c:73
#: src/common/command.c:74
msgid "[command]"
msgstr ""
#: src/common/command.c:73
#: src/common/command.c:74
msgid "command: name of a WeeChat or IRC command"
msgstr ""
#: src/common/command.c:75
#: src/common/command.c:76
msgid "ignore IRC messages and/or hosts"
msgstr ""
#: src/common/command.c:76
#: src/common/command.c:77
msgid "[mask [[type | command] [channel [server]]]]"
msgstr ""
#: src/common/command.c:77
#: src/common/command.c:78
msgid ""
" mask: nick or host mask to ignore\n"
" type: type of message to ignore (action, ctcp, dcc, pv)\n"
@@ -2465,15 +2466,15 @@ msgid ""
"Without argument, /ignore command lists all defined ignore."
msgstr ""
#: src/common/command.c:85
#: src/common/command.c:86
msgid "bind/unbind keys"
msgstr ""
#: src/common/command.c:86
#: src/common/command.c:87
msgid "[key function/command] [unbind key] [functions] [reset -yes]"
msgstr ""
#: src/common/command.c:87
#: src/common/command.c:88
msgid ""
"key: bind this key to an internal function or a command (beginning by \"/"
"\")\n"
@@ -2483,26 +2484,26 @@ msgid ""
"binding (use carefully!)"
msgstr ""
#: src/common/command.c:92
#: src/common/command.c:93
msgid "list/load/unload plugins"
msgstr ""
#: src/common/command.c:93
#: src/common/command.c:94
msgid "[load filename] | [autoload] | [reload] | [unload]"
msgstr ""
#: src/common/command.c:94
#: src/common/command.c:95
msgid ""
"filename: WeeChat plugin (file) to load\n"
"\n"
"Without argument, /plugin command lists all loaded plugins."
msgstr ""
#: src/common/command.c:97
#: src/common/command.c:98
msgid "list, add or remove servers"
msgstr ""
#: src/common/command.c:98
#: src/common/command.c:99
msgid ""
"[servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-"
"pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname "
@@ -2510,7 +2511,7 @@ msgid ""
"servername]"
msgstr ""
#: src/common/command.c:103
#: src/common/command.c:104
msgid ""
"servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
@@ -2525,54 +2526,54 @@ msgid ""
"realname: real name of user"
msgstr ""
#: src/common/command.c:115
#: src/common/command.c:116
msgid "save config to disk"
msgstr ""
#: src/common/command.c:116
#: src/common/command.c:117
msgid "[file]"
msgstr ""
#: src/common/command.c:116
#: src/common/command.c:117
msgid "file: filename for writing config"
msgstr ""
#: src/common/command.c:118
#: src/common/command.c:119
msgid "set config parameters"
msgstr ""
#: src/common/command.c:119
#: src/common/command.c:120
msgid "[option [ = value]]"
msgstr ""
#: src/common/command.c:120
#: src/common/command.c:121
msgid ""
"option: name of an option (if name is full and no value is given, then help "
"is displayed on option)\n"
"value: value for option"
msgstr ""
#: src/common/command.c:124
#: src/common/command.c:125
msgid "remove an alias"
msgstr ""
#: src/common/command.c:125
#: src/common/command.c:126
msgid "alias_name"
msgstr ""
#: src/common/command.c:125
#: src/common/command.c:126
msgid "alias_name: name of alias to remove"
msgstr ""
#: src/common/command.c:127
#: src/common/command.c:128
msgid "unignore IRC messages and/or hosts"
msgstr ""
#: src/common/command.c:128
#: src/common/command.c:129
msgid "[number | [mask [[type | command] [channel [server]]]]]"
msgstr ""
#: src/common/command.c:129
#: src/common/command.c:130
msgid ""
" number: # of ignore to unignore (number is displayed by list of ignore)\n"
" mask: nick or host mask to unignore\n"
@@ -2585,29 +2586,27 @@ msgid ""
"Without argument, /unignore command lists all defined ignore."
msgstr ""
#: src/common/command.c:138
#: src/common/command.c:139
msgid "show WeeChat uptime"
msgstr ""
#: src/common/command.c:139
#: src/common/command.c:140
msgid "-o"
msgstr ""
#: src/common/command.c:140
#: src/common/command.c:141
msgid "-o: send uptime on current channel as an IRC message"
msgstr ""
#: src/common/command.c:142
#: src/common/command.c:143
msgid "manage windows"
msgstr ""
#: src/common/command.c:143
msgid ""
"[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | "
"all]]]"
#: src/common/command.c:144
msgid "[list | -1 | +1 | b# | splith [pct] | splitv [pct] | [merge [all]]]"
msgstr ""
#: src/common/command.c:144
#: src/common/command.c:145
msgid ""
"list: list opened windows (no parameter implies this list)\n"
"-1: jump to previous window\n"
@@ -2615,517 +2614,528 @@ msgid ""
"b#: jump to next window displaying buffer number #\n"
"splith: split current window horizontally\n"
"splitv: split current window vertically\n"
"merge: merge window with another"
"merge: merge window with another (all = keep only one window)\n"
"\n"
"For splith and splitv, pct is a pourcentage 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"
msgstr ""
#: src/common/command.c:293
#: src/common/command.c:297
#, c-format
msgid "%s alias or command \"%s\" already exists!\n"
msgstr ""
#: src/common/command.c:303
#: src/common/command.c:307
#, c-format
msgid "%s alias cannot run another alias!\n"
msgstr ""
#: src/common/command.c:310
#: src/common/command.c:314
#, c-format
msgid "%s target command \"/%s\" does not exist!\n"
msgstr ""
#: src/common/command.c:548
#: src/common/command.c:552
#, c-format
msgid "%s wrong argument count for %s command \"%s\" (expected: %d arg%s)\n"
msgstr ""
#: src/common/command.c:560
#: src/common/command.c:564
#, c-format
msgid ""
"%s wrong argument count for %s command \"%s\" (expected: between %d and %d "
"arg%s)\n"
msgstr ""
#: src/common/command.c:582 src/common/command.c:651
#: src/common/command.c:586 src/common/command.c:655
#, c-format
msgid "%s command \"%s\" failed\n"
msgstr ""
#: src/common/command.c:607
#: src/common/command.c:611
#, c-format
msgid "%s wrong argument count for IRC command \"%s\" (expected: %d arg%s)\n"
msgstr ""
#: src/common/command.c:619
#: src/common/command.c:623
#, c-format
msgid ""
"%s wrong argument count for IRC command \"%s\" (expected: between %d and %d "
"arg%s)\n"
msgstr ""
#: src/common/command.c:634
#: src/common/command.c:638
#, c-format
msgid "%s command \"%s\" needs a server connection!\n"
msgstr ""
#: src/common/command.c:694
#: src/common/command.c:698
#, c-format
msgid "%s unknown command \"%s\" (type /help for help)\n"
msgstr ""
#: src/common/command.c:828
#: src/common/command.c:832
msgid "This window is not a channel!\n"
msgstr ""
#: src/common/command.c:856 src/common/command.c:887 src/common/command.c:995
#: src/common/command.c:860 src/common/command.c:891 src/common/command.c:999
#, c-format
msgid "%s missing arguments for \"%s\" command\n"
msgstr ""
#: src/common/command.c:863
#: src/common/command.c:867
#, c-format
msgid "%s alias can not start with \"/\"\n"
msgstr ""
#: src/common/command.c:872
#: src/common/command.c:876
#, c-format
msgid "Alias \"%s\" => \"%s\" created\n"
msgstr ""
#: src/common/command.c:878
#: src/common/command.c:882
#, c-format
msgid "Failed to create alias \"%s\" => \"%s\" (not enough memory)\n"
msgstr ""
#: src/common/command.c:898
#: src/common/command.c:902
msgid "List of aliases:\n"
msgstr ""
#: src/common/command.c:912
#: src/common/command.c:916
msgid "No alias defined.\n"
msgstr ""
#: src/common/command.c:929
#: src/common/command.c:933
#, c-format
msgid "%sServer: %s%s\n"
msgstr ""
#: src/common/command.c:934
#: src/common/command.c:938
#, c-format
msgid "%sChannel: %s%s %s(server: %s%s%s)\n"
msgstr ""
#: src/common/command.c:943
#: src/common/command.c:947
#, c-format
msgid "%sPrivate with: %s%s %s(server: %s%s%s)\n"
msgstr ""
#: src/common/command.c:952
#: src/common/command.c:956
msgid "not connected\n"
msgstr ""
#: src/common/command.c:974
#: src/common/command.c:978
msgid "Opened buffers:\n"
msgstr ""
#: src/common/command.c:1018
#: src/common/command.c:1022
#, c-format
msgid "%s incorrect buffer number\n"
msgstr ""
#: src/common/command.c:1034
#: src/common/command.c:1038
#, c-format
msgid "%s can not close the single buffer\n"
msgstr ""
#: src/common/command.c:1044
#: src/common/command.c:1048
#, c-format
msgid "%s can not close server buffer while channels are opened\n"
msgstr ""
#: src/common/command.c:1093
#: src/common/command.c:1097
msgid "Notify levels: "
msgstr ""
#: src/common/command.c:1122 src/common/command.c:1170
#: src/common/command.c:1126 src/common/command.c:1174
#, c-format
msgid "%s incorrect notify level (must be between %d and %d)\n"
msgstr ""
#: src/common/command.c:1131
#: src/common/command.c:1135
#, c-format
msgid "%s incorrect buffer for notify (must be channel or private)\n"
msgstr ""
#: src/common/command.c:1140
#: src/common/command.c:1144
#, c-format
msgid "New notify level for %s%s%s: %s%d %s"
msgstr ""
#: src/common/command.c:1150
#: src/common/command.c:1154
msgid "(hotlist: never)\n"
msgstr ""
#: src/common/command.c:1153
#: src/common/command.c:1157
msgid "(hotlist: highlights)\n"
msgstr ""
#: src/common/command.c:1156
#: src/common/command.c:1160
msgid "(hotlist: highlights + messages)\n"
msgstr ""
#: src/common/command.c:1159
#: src/common/command.c:1163
msgid "(hotlist: highlights + messages + join/part (all))\n"
msgstr ""
#: src/common/command.c:1237
#: src/common/command.c:1241
#, c-format
msgid "unknown parameter \"%s\" for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1267
#: src/common/command.c:1271
#, c-format
msgid "%s already connected to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1275
#: src/common/command.c:1279
#, c-format
msgid "%s currently connecting to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1293 src/common/command.c:1368
#: src/common/command.c:1297 src/common/command.c:1417
#, c-format
msgid "%s server not found\n"
msgstr ""
#: src/common/command.c:1323 src/common/command.c:1878
#: src/common/command.c:2786 src/common/command.c:2810
#: src/common/command.c:1372 src/common/command.c:1927
#: src/common/command.c:2850 src/common/command.c:2885
#, c-format
msgid "%s unknown option for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1352
#: src/common/command.c:1401
#, c-format
msgid "%s not connected to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1360
#: src/common/command.c:1409
msgid "Auto-reconnection is cancelled\n"
msgstr ""
#: src/common/command.c:1391 src/common/weechat.c:365
#: src/common/command.c:1440 src/common/weechat.c:365
#, c-format
msgid "%s internal commands:\n"
msgstr ""
#: src/common/command.c:1401 src/common/weechat.c:385
#: src/common/command.c:1450 src/common/weechat.c:385
#, c-format
msgid "IRC commands:\n"
msgstr ""
#: src/common/command.c:1415
#: src/common/command.c:1464
msgid "Plugin commands:\n"
msgstr ""
#: src/common/command.c:1531
#: src/common/command.c:1580
#, c-format
msgid "No help available, \"%s\" is an unknown command\n"
msgstr ""
#: src/common/command.c:1550
#: src/common/command.c:1599
#, c-format
msgid "%son %s%s%s/%s%s%s:%s ignoring %s%s%s from %s%s\n"
msgstr ""
#: src/common/command.c:1584
#: src/common/command.c:1633
msgid "List of ignore:\n"
msgstr ""
#: src/common/command.c:1601
#: src/common/command.c:1650
msgid "No ignore defined.\n"
msgstr ""
#: src/common/command.c:1627
#: src/common/command.c:1676
msgid "New ignore:"
msgstr ""
#: src/common/command.c:1647
#: src/common/command.c:1696
#, c-format
msgid "New key binding: %s"
msgstr ""
#: src/common/command.c:1681
#: src/common/command.c:1730
msgid "Key bindings:\n"
msgstr ""
#: src/common/command.c:1695
#: src/common/command.c:1744
#, c-format
msgid "Key \"%s\" unbinded\n"
msgstr ""
#: src/common/command.c:1701
#: src/common/command.c:1750
#, c-format
msgid "%s unable to unbind key \"%s\"\n"
msgstr ""
#: src/common/command.c:1709 src/common/weechat.c:416
#: src/common/command.c:1758 src/common/weechat.c:416
#, c-format
msgid "Internal key functions:\n"
msgstr ""
#: src/common/command.c:1729
#: src/common/command.c:1778
msgid "Default key bindings restored\n"
msgstr ""
#: src/common/command.c:1735
#: src/common/command.c:1784
#, c-format
msgid "%s \"-yes\" argument is required for keys reset (securuty reason)\n"
msgstr ""
#: src/common/command.c:1791
#: src/common/command.c:1840
msgid "Plugins loaded:\n"
msgstr ""
#: src/common/command.c:1807
#: src/common/command.c:1856
msgid " message handlers:\n"
msgstr ""
#: src/common/command.c:1816
#: src/common/command.c:1865
#, c-format
msgid " IRC(%s)\n"
msgstr ""
#: src/common/command.c:1823
#: src/common/command.c:1872
msgid " (no message handler)\n"
msgstr ""
#: src/common/command.c:1828
#: src/common/command.c:1877
msgid " command handlers:\n"
msgstr ""
#: src/common/command.c:1849
#: src/common/command.c:1898
msgid " (no command handler)\n"
msgstr ""
#: src/common/command.c:1855
#: src/common/command.c:1904
msgid " (no plugin)\n"
msgstr ""
#: src/common/command.c:1891
#: src/common/command.c:1940
msgid ""
"Command \"plugin\" is not available, WeeChat was built without plugins "
"support.\n"
msgstr ""
#: src/common/command.c:1938
#: src/common/command.c:1988
msgid "No server.\n"
msgstr ""
#: src/common/command.c:1949
#: src/common/command.c:1999
#, c-format
msgid "Server '%s' not found.\n"
msgstr ""
#: src/common/command.c:1961
#: src/common/command.c:2011
#, c-format
msgid "%s missing servername for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1969
#: src/common/command.c:2019
#, c-format
msgid "%s too much arguments for \"%s\" command, ignoring arguments\n"
msgstr ""
#: src/common/command.c:1988
#: src/common/command.c:2038
#, c-format
msgid "%s server \"%s\" not found for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1996
#: src/common/command.c:2046
#, c-format
msgid ""
"%s you can not delete server \"%s\" because you are connected to. Try /"
"disconnect %s before.\n"
msgstr ""
#: src/common/command.c:2014
#: src/common/command.c:2066
#, c-format
msgid "Server %s%s%s has been deleted\n"
msgstr ""
#: src/common/command.c:2031
#: src/common/command.c:2085
#, c-format
msgid "%s missing parameters for \"%s\" command\n"
msgstr ""
#: src/common/command.c:2041
#: src/common/command.c:2095
#, c-format
msgid "%s server \"%s\" already exists, can't create it!\n"
msgstr ""
#: src/common/command.c:2070 src/common/command.c:2098
#: src/common/command.c:2111 src/common/command.c:2137
#: src/common/command.c:2124 src/common/command.c:2152
#: src/common/command.c:2165 src/common/command.c:2191
#, c-format
msgid "%s missing password for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2083
#: src/common/command.c:2137
#, c-format
msgid "%s missing nick(s) for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2124
#: src/common/command.c:2178
#, c-format
msgid "%s missing command for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2159
#: src/common/command.c:2213
#, c-format
msgid "Server %s%s%s created\n"
msgstr ""
#: src/common/command.c:2168
#: src/common/command.c:2222
#, c-format
msgid "%s unable to create server\n"
msgstr ""
#: src/common/command.c:2227
#: src/common/command.c:2281
msgid "(unknown)"
msgstr ""
#: src/common/command.c:2250
#: src/common/command.c:2304
#, c-format
msgid "%s(password hidden) "
msgstr ""
#: src/common/command.c:2317
#: src/common/command.c:2371
#, c-format
msgid "%s server \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2350 src/common/command.c:2398
#: src/common/command.c:2404 src/common/command.c:2452
#, c-format
msgid "%s config option \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2355 src/common/command.c:2390
#: src/common/command.c:2409 src/common/command.c:2444
#, c-format
msgid "%s incorrect value for option \"%s\"\n"
msgstr ""
#: src/common/command.c:2371
#: src/common/command.c:2425
#, c-format
msgid "%s option \"%s\" can not be changed while WeeChat is running\n"
msgstr ""
#: src/common/command.c:2481
#: src/common/command.c:2535
#, c-format
msgid "No config option found with \"%s\"\n"
msgstr ""
#: src/common/command.c:2484
#: src/common/command.c:2538
msgid "No config option found\n"
msgstr ""
#: src/common/command.c:2491
#: src/common/command.c:2545
#, c-format
msgid "%sDetail:\n"
msgstr ""
#: src/common/command.c:2496 src/common/weechat.c:302
#: src/common/command.c:2550 src/common/weechat.c:302
#, c-format
msgid " . type boolean (values: 'on' or 'off')\n"
msgstr ""
#: src/common/command.c:2497 src/common/command.c:2520
#: src/common/command.c:2526 src/common/command.c:2532
#: src/common/command.c:2551 src/common/command.c:2574
#: src/common/command.c:2580 src/common/command.c:2586
#: src/common/weechat.c:303 src/common/weechat.c:326 src/common/weechat.c:332
#: src/common/weechat.c:338
#, c-format
msgid " . default value: '%s'\n"
msgstr ""
#: src/common/command.c:2502 src/common/weechat.c:308
#: src/common/command.c:2556 src/common/weechat.c:308
#, c-format
msgid " . type integer (values: between %d and %d)\n"
msgstr ""
#: src/common/command.c:2505 src/common/weechat.c:311
#: src/common/command.c:2559 src/common/weechat.c:311
#, c-format
msgid " . default value: %d\n"
msgstr ""
#: src/common/command.c:2509 src/common/weechat.c:315
#: src/common/command.c:2563 src/common/weechat.c:315
#, c-format
msgid " . type string (values: "
msgstr ""
#: src/common/command.c:2522 src/common/command.c:2528
#: src/common/command.c:2534 src/common/weechat.c:328 src/common/weechat.c:334
#: src/common/command.c:2576 src/common/command.c:2582
#: src/common/command.c:2588 src/common/weechat.c:328 src/common/weechat.c:334
#: src/common/weechat.c:340
msgid "empty"
msgstr ""
#: src/common/command.c:2525 src/common/weechat.c:331
#: src/common/command.c:2579 src/common/weechat.c:331
#, c-format
msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n"
msgstr ""
#: src/common/command.c:2531 src/common/weechat.c:337
#: src/common/command.c:2585 src/common/weechat.c:337
#, c-format
msgid " . type string (any string)\n"
msgstr ""
#: src/common/command.c:2537 src/common/weechat.c:343
#: src/common/command.c:2591 src/common/weechat.c:343
#, c-format
msgid " . description: %s\n"
msgstr ""
#: src/common/command.c:2548
#: src/common/command.c:2602
#, c-format
msgid "config option(s) found with \"%s\"\n"
msgstr ""
#: src/common/command.c:2551
#: src/common/command.c:2605
msgid "config option(s) found\n"
msgstr ""
#: src/common/command.c:2572
#: src/common/command.c:2626
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2582
#: src/common/command.c:2636
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr ""
#: src/common/command.c:2638
#: src/common/command.c:2692
msgid "ignore were removed.\n"
msgstr ""
#: src/common/command.c:2640
#: src/common/command.c:2694
msgid "ignore was removed.\n"
msgstr ""
#: src/common/command.c:2645
#: src/common/command.c:2699
#, c-format
msgid "%s no ignore found\n"
msgstr ""
#: src/common/command.c:2675
#: src/common/command.c:2729
#, c-format
msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s"
msgstr ""
#: src/common/command.c:2692
#: src/common/command.c:2746
#, c-format
msgid "WeeChat uptime: %s%d %s%s %s%02d%s:%s%02d%s:%s%02d%s, started on %s%s"
msgstr ""
#: src/common/command.c:2732
#: src/common/command.c:2786
msgid "Opened windows:\n"
msgstr ""
#: src/common/command.c:2861
#, c-format
msgid ""
"%s can not merge windows, there's no other window with same size near "
"current one.\n"
msgstr ""
#: src/common/fifo.c:71 src/common/fifo.c:73
#, c-format
msgid "%s unable to create FIFO pipe for remote control (%s)\n"
+92 -17
View File
@@ -66,8 +66,9 @@ t_weechat_command weechat_commands[] =
N_("servername: server name to disconnect"),
0, 1, weechat_cmd_disconnect, NULL },
{ "debug", N_("print debug messages"),
N_("dump"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)"),
N_("dump | windows"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)\n"
"windows: display windows tree"),
1, 1, weechat_cmd_debug, NULL },
{ "help", N_("display help about commands"),
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
@@ -140,14 +141,17 @@ t_weechat_command weechat_commands[] =
N_("-o: send uptime on current channel as an IRC message"),
0, 1, weechat_cmd_uptime, NULL },
{ "window", N_("manage windows"),
N_("[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | all]]]"),
N_("[list | -1 | +1 | b# | splith [pct] | splitv [pct] | [merge [all]]]"),
N_("list: list opened windows (no parameter implies this list)\n"
"-1: jump to previous window\n"
"+1: jump to next window\n"
"b#: jump to next window displaying buffer number #\n"
"splith: split current window horizontally\n"
"splitv: split current window vertically\n"
"merge: merge window with another"),
"merge: merge window with another (all = keep only one window)\n\n"
"For splith and splitv, pct is a pourcentage 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"),
0, 2, weechat_cmd_window, NULL },
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
};
@@ -1296,6 +1300,45 @@ weechat_cmd_connect (int argc, char **argv)
return 0;
}
/*
* weechat_cmd_debug_display_windows: display tree of windows
*/
void
weechat_cmd_debug_display_windows (t_gui_window_tree *tree, int indent)
{
int i;
if (tree)
{
for (i = 0; i < indent; i++)
gui_printf_nolog (NULL, " ");
if (tree->window)
{
/* leaf */
gui_printf_nolog (NULL, "leaf: %X (parent:%X), win=%X, child1=%X, child2=%X, %d,%d %dx%d, %d%%x%d%%\n",
tree, tree->parent_node, tree->window,
tree->child1, tree->child2,
tree->window->win_x, tree->window->win_y,
tree->window->win_width, tree->window->win_height,
tree->window->win_width_pct, tree->window->win_height_pct);
}
else
{
/* node */
gui_printf_nolog (NULL, "node: %X (parent:%X), win=%X, child1=%X, child2=%X)\n",
tree, tree->parent_node, tree->window,
tree->child1, tree->child2);
}
if (tree->child1)
weechat_cmd_debug_display_windows (tree->child1, indent + 1);
if (tree->child2)
weechat_cmd_debug_display_windows (tree->child2, indent + 1);
}
}
/*
* weechat_cmd_debug: print debug messages
*/
@@ -1316,6 +1359,12 @@ weechat_cmd_debug (int argc, char **argv)
{
wee_dump (0);
}
else if (ascii_strcasecmp (argv[0], "windows") == 0)
{
gui_printf_nolog (NULL, "\n");
gui_printf_nolog (NULL, "DEBUG: windows tree:\n");
weechat_cmd_debug_display_windows (gui_windows_tree, 1);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -1918,6 +1967,7 @@ weechat_cmd_server (int argc, char **argv)
int i;
t_irc_server server, *ptr_server, *server_found, *new_server;
t_gui_buffer *ptr_buffer;
char *server_name;
if ((argc == 0) || (argc == 1))
{
@@ -2008,13 +2058,17 @@ weechat_cmd_server (int argc, char **argv)
}
}
server_name = strdup (server_found->name);
server_free (server_found);
irc_display_prefix (NULL, NULL, PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s has been deleted\n"),
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
server_found->name,
server_name,
GUI_COLOR(COLOR_WIN_CHAT));
if (server_name)
free (server_name);
gui_redraw_buffer (gui_current_window->buffer);
@@ -2758,26 +2812,36 @@ weechat_cmd_window (int argc, char **argv)
if (ascii_strcasecmp (argv[0], "splith") == 0)
{
/* split window horizontally */
gui_window_split_horiz (gui_current_window);
if (argc > 1)
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0')
&& (number > 0) && (number < 100))
gui_window_split_horiz (gui_current_window, number);
}
else
gui_window_split_horiz (gui_current_window, 50);
}
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
{
/* split window vertically */
gui_window_split_vertic (gui_current_window);
if (argc > 1)
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0')
&& (number > 0) && (number < 100))
gui_window_split_vertic (gui_current_window, number);
}
else
gui_window_split_vertic (gui_current_window, 50);
}
else if (ascii_strcasecmp (argv[0], "merge") == 0)
{
if (argc >= 2)
{
if (ascii_strcasecmp (argv[1], "down") == 0)
gui_window_merge_down (gui_current_window);
else if (ascii_strcasecmp (argv[1], "up") == 0)
gui_window_merge_up (gui_current_window);
else if (ascii_strcasecmp (argv[1], "left") == 0)
gui_window_merge_left (gui_current_window);
else if (ascii_strcasecmp (argv[1], "right") == 0)
gui_window_merge_right (gui_current_window);
else if (ascii_strcasecmp (argv[1], "all") == 0)
if (ascii_strcasecmp (argv[1], "all") == 0)
gui_window_merge_all (gui_current_window);
else
{
@@ -2789,7 +2853,18 @@ weechat_cmd_window (int argc, char **argv)
}
}
else
gui_window_merge_auto (gui_current_window);
{
if (!gui_window_merge (gui_current_window))
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s can not merge windows, "
"there's no other window with same size "
"near current one.\n"),
WEECHAT_ERROR);
return -1;
}
}
}
else if (ascii_strncasecmp (argv[0], "b", 1) == 0)
{
+5
View File
@@ -186,9 +186,14 @@ completion_build_list (t_completion *completion, void *channel)
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
{
if (completion->base_command_arg == 1)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"dump");
weelist_add (&completion->completion_list,
&completion->last_completion,
"windows");
}
else
completion_stop (completion);
return;
+167 -205
View File
@@ -2800,7 +2800,7 @@ gui_window_init_subwindows (t_gui_window *window)
*/
void
gui_window_split_horiz (t_gui_window *window)
gui_window_split_horiz (t_gui_window *window, int pourcentage)
{
t_gui_window *new_window;
int height1, height2;
@@ -2808,24 +2808,32 @@ gui_window_split_horiz (t_gui_window *window)
if (!gui_ok)
return;
height1 = window->win_height / 2;
height1 = (window->win_height * pourcentage) / 100;
height2 = window->win_height - height1;
if ((new_window = gui_window_new (window->win_x, window->win_y,
window->win_width, height1)))
if ((height1 >= WINDOW_MIN_HEIGHT) && (height2 >= WINDOW_MIN_HEIGHT)
&& (pourcentage > 0) && (pourcentage <= 100))
{
/* reduce old window height (bottom window) */
window->win_y = new_window->win_y + new_window->win_height;
window->win_height = height2;
/* assign same buffer for new window (top window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if ((new_window = gui_window_new (window,
window->win_x, window->win_y,
window->win_width, height1,
100, pourcentage)))
{
/* reduce old window height (bottom window) */
window->win_y = new_window->win_y + new_window->win_height;
window->win_height = height2;
window->win_height_pct = 100 - pourcentage;
/* assign same buffer for new window (top window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
}
@@ -2834,7 +2842,7 @@ gui_window_split_horiz (t_gui_window *window)
*/
void
gui_window_split_vertic (t_gui_window *window)
gui_window_split_vertic (t_gui_window *window, int pourcentage)
{
t_gui_window *new_window;
int width1, width2;
@@ -2842,170 +2850,84 @@ gui_window_split_vertic (t_gui_window *window)
if (!gui_ok)
return;
width1 = window->win_width / 2;
width1 = (window->win_width * pourcentage) / 100;
width2 = window->win_width - width1 - 1;
if ((new_window = gui_window_new (window->win_x + width1 + 1, window->win_y,
width2, window->win_height)))
if ((width1 >= WINDOW_MIN_WIDTH) && (width2 >= WINDOW_MIN_WIDTH)
&& (pourcentage > 0) && (pourcentage <= 100))
{
/* reduce old window height (left window) */
window->win_width = width1;
if ((new_window = gui_window_new (window,
window->win_x + width1 + 1, window->win_y,
width2, window->win_height,
pourcentage, 100)))
{
/* reduce old window height (left window) */
window->win_width = width1;
window->win_width_pct = 100 - pourcentage;
/* assign same buffer for new window (right window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
/* create & draw separator */
gui_draw_window_separator (gui_current_window);
}
}
}
/*
* gui_window_merge: merge window with its sister
*/
int
gui_window_merge (t_gui_window *window)
{
t_gui_window_tree *parent, *sister;
parent = window->ptr_tree->parent_node;
if (parent)
{
sister = (parent->child1->window == window) ?
parent->child2 : parent->child1;
/* assign same buffer for new window (right window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
if (!(sister->window))
return 0;
if (window->win_y == sister->window->win_y)
{
/* horizontal merge */
window->win_width += sister->window->win_width + 1;
window->win_width_pct += sister->window->win_width_pct;
}
else
{
/* vertical merge */
window->win_height += sister->window->win_height;
window->win_height_pct += sister->window->win_height_pct;
}
if (sister->window->win_x < window->win_x)
window->win_x = sister->window->win_x;
if (sister->window->win_y < window->win_y)
window->win_y = sister->window->win_y;
gui_window_free (sister->window);
gui_window_tree_node_to_leaf (parent, window);
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
/* create & draw separator */
gui_draw_window_separator (gui_current_window);
gui_redraw_buffer (window->buffer);
return 1;
}
return 0;
}
/*
* gui_window_merge_down: merge window, direction down
*/
int
gui_window_merge_down (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_y == window->win_y + window->win_height)
&& (ptr_win->win_x == window->win_x)
&& (ptr_win->win_width == window->win_width))
{
window->win_height += ptr_win->win_height;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found below current window */
return -1;
}
/*
* gui_window_merge_up: merge window, direction up
*/
int
gui_window_merge_up (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_y + ptr_win->win_height == window->win_y)
&& (ptr_win->win_x == window->win_x)
&& (ptr_win->win_width == window->win_width))
{
window->win_height += ptr_win->win_height;
window->win_y -= ptr_win->win_height;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found above current window */
return -1;
}
/*
* gui_window_merge_left: merge window, direction left
*/
int
gui_window_merge_left (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_x + ptr_win->win_width + 1 == window->win_x)
&& (ptr_win->win_y == window->win_y)
&& (ptr_win->win_height == window->win_height))
{
window->win_width += ptr_win->win_width + 1;
window->win_x -= ptr_win->win_width + 1;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found on the left of current window */
return -1;
}
/*
* gui_window_merge_right: merge window, direction right
*/
int
gui_window_merge_right (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_x == window->win_x + window->win_width + 1)
&& (ptr_win->win_y == window->win_y)
&& (ptr_win->win_height == window->win_height))
{
window->win_width += ptr_win->win_width + 1;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found on the right of current window */
return -1;
}
/*
* gui_window_merge: merge a window, direction auto
*/
void
gui_window_merge_auto (t_gui_window *window)
{
if (gui_window_merge_down (window) == 0)
return;
if (gui_window_merge_up (window) == 0)
return;
if (gui_window_merge_left (window) == 0)
return;
if (gui_window_merge_right (window) == 0)
return;
}
/*
* gui_window_merge_all: merge all windows
* gui_window_merge_all: merge all windows into only one
*/
void
@@ -3015,14 +2937,61 @@ gui_window_merge_all (t_gui_window *window)
{
gui_window_free ((gui_windows == window) ? gui_windows->next_window : gui_windows);
}
gui_window_tree_free (&gui_windows_tree);
gui_window_tree_init (window);
window->ptr_tree = gui_windows_tree;
window->win_x = 0;
window->win_y = 0;
window->win_width = COLS;
window->win_height = LINES;
window->win_width_pct = 100;
window->win_height_pct = 100;
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
}
/*
* gui_window_auto_resize: auto-resize all windows, according to % of global size
* This function is called after a terminal resize.
* Returns 0 if ok, -1 if all window should be merged
* (not enough space according to windows %)
*/
void
gui_window_auto_resize (t_gui_window_tree *tree,
int x, int y, int width, int height)
{
int size1, size2;
if (tree)
{
if (tree->window)
{
tree->window->win_x = x;
tree->window->win_y = y;
tree->window->win_width = width;
tree->window->win_height = height;
}
else
{
if (tree->split_horiz)
{
size1 = (height * tree->split_pct) / 100;
size2 = height - size1;
gui_window_auto_resize (tree->child1, x, y + size1, width, size2);
gui_window_auto_resize (tree->child2, x, y, width, size1);
}
else
{
size1 = (width * tree->split_pct) / 100;
size2 = width - size1 - 1;
gui_window_auto_resize (tree->child1, x, y, size1, height);
gui_window_auto_resize (tree->child2, x + size1 + 1, y, size2, height);
}
}
}
}
/*
* gui_refresh_screen: called when term size is modified
*/
@@ -3033,7 +3002,7 @@ gui_refresh_screen ()
t_gui_window *ptr_win, *old_current_window;
int old_width, old_height;
int new_width, new_height;
int merge_all_windows;
int merge_all;
getmaxyx (stdscr, old_height, old_width);
@@ -3044,44 +3013,36 @@ gui_refresh_screen ()
old_current_window = gui_current_window;
gui_ok = ((new_width > 5) && (new_height > 5));
gui_ok = ((new_width > WINDOW_MIN_WIDTH) && (new_height > WINDOW_MIN_HEIGHT));
merge_all_windows = 0;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
if (gui_ok)
{
ptr_win->dcc_first = NULL;
ptr_win->dcc_selected = NULL;
gui_window_auto_resize (gui_windows_tree, 0, 0, COLS, LINES);
if (!merge_all_windows)
merge_all = 0;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((ptr_win->win_x > new_width - 5)
|| (ptr_win->win_y > new_height - 5))
merge_all_windows = 1;
else
if ((ptr_win->win_width < WINDOW_MIN_WIDTH)
|| (ptr_win->win_height < WINDOW_MIN_HEIGHT))
{
if (ptr_win->win_x + ptr_win->win_width == old_width)
ptr_win->win_width = new_width - ptr_win->win_x;
if (ptr_win->win_y + ptr_win->win_height == old_height)
ptr_win->win_height = new_height - ptr_win->win_y;
if ((ptr_win->win_width < 5) || (ptr_win->win_height < 5))
merge_all_windows = 1;
merge_all = 1;
break;
}
}
if (merge_all)
gui_window_merge_all (gui_current_window);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_switch_to_buffer (ptr_win, ptr_win->buffer);
gui_redraw_buffer (ptr_win->buffer);
gui_draw_window_separator (ptr_win);
}
gui_current_window = old_current_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
if (merge_all_windows)
gui_window_merge_all (gui_current_window);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_switch_to_buffer (ptr_win, ptr_win->buffer);
gui_redraw_buffer (ptr_win->buffer);
gui_draw_window_separator (ptr_win);
}
gui_current_window = old_current_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -3265,7 +3226,7 @@ gui_init ()
gui_input_clipboard = NULL;
/* create new window/buffer */
if (gui_window_new (0, 0, COLS, LINES))
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
@@ -3316,6 +3277,7 @@ gui_end ()
/* delete all windows */
while (gui_windows)
gui_window_free (gui_windows);
gui_window_tree_free (&gui_windows_tree);
/* delete global history */
history_global_free ();
+131 -1
View File
@@ -54,6 +54,8 @@ t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
t_gui_window *gui_current_window = NULL; /* pointer to current window */
t_gui_window_tree *gui_windows_tree = NULL; /* pointer to windows tree */
t_gui_buffer *gui_buffers = NULL; /* pointer to first buffer */
t_gui_buffer *last_gui_buffer = NULL; /* pointer to last buffer */
t_gui_buffer *buffer_before_dcc = NULL; /* buffer before dcc switch */
@@ -61,25 +63,148 @@ t_gui_infobar *gui_infobar; /* pointer to infobar content */
char *gui_input_clipboard = NULL; /* clipboard content */
/*
* gui_window_tree_init: create first entry in windows tree
*/
int
gui_window_tree_init (t_gui_window *window)
{
gui_windows_tree = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!gui_windows_tree)
return 0;
gui_windows_tree->parent_node = NULL;
gui_windows_tree->split_horiz = 0;
gui_windows_tree->split_pct = 0;
gui_windows_tree->child1 = NULL;
gui_windows_tree->child2 = NULL;
gui_windows_tree->window = window;
return 1;
}
/*
* gui_window_tree_node_to_leaf: convert a node to a leaf (free any leafs)
* Called when 2 windows are merging into one
*/
void
gui_window_tree_node_to_leaf (t_gui_window_tree *node, t_gui_window *window)
{
node->split_horiz = 0;
node->split_pct = 0;
if (node->child1)
{
free (node->child1);
node->child1 = NULL;
}
if (node->child2)
{
free (node->child2);
node->child2 = NULL;
}
node->window = window;
window->ptr_tree = node;
}
/*
* gui_window_tree_free: delete entire windows tree
*/
void
gui_window_tree_free (t_gui_window_tree **tree)
{
if (*tree)
{
if ((*tree)->child1)
gui_window_tree_free (&((*tree)->child1));
if ((*tree)->child2)
gui_window_tree_free (&((*tree)->child2));
free (*tree);
*tree = NULL;
}
}
/*
* gui_window_new: create a new window
*/
t_gui_window *
gui_window_new (int x, int y, int width, int height)
gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
int width_pct, int height_pct)
{
t_gui_window *new_window;
t_gui_window_tree *ptr_tree, *child1, *child2, *ptr_leaf;
#ifdef DEBUG
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if (parent)
{
child1 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!child1)
return NULL;
child2 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!child2)
{
free (child1);
return NULL;
}
ptr_tree = parent->ptr_tree;
if (width_pct == 100)
{
ptr_tree->split_horiz = 1;
ptr_tree->split_pct = height_pct;
}
else
{
ptr_tree->split_horiz = 0;
ptr_tree->split_pct = width_pct;
}
/* parent window leaf becomes node and we add 2 leafs below
(#1 is parent win, #2 is new win) */
parent->ptr_tree = child1;
child1->parent_node = ptr_tree;
child1->child1 = NULL;
child1->child2 = NULL;
child1->window = ptr_tree->window;
child2->parent_node = ptr_tree;
child2->child1 = NULL;
child2->child2 = NULL;
child2->window = NULL; /* will be assigned by new window below */
ptr_tree->child1 = child1;
ptr_tree->child2 = child2;
ptr_tree->window = NULL; /* leaf becomes node */
ptr_leaf = child2;
}
else
{
if (!gui_window_tree_init (NULL))
return NULL;
ptr_leaf = gui_windows_tree;
}
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
{
new_window->win_x = x;
new_window->win_y = y;
new_window->win_width = width;
new_window->win_height = height;
new_window->win_width_pct = width_pct;
new_window->win_height_pct = height_pct;
new_window->new_x = -1;
new_window->new_y = -1;
new_window->new_width = -1;
new_window->new_height = -1;
new_window->win_chat_x = 0;
new_window->win_chat_y = 0;
@@ -120,6 +245,9 @@ gui_window_new (int x, int y, int width, int height)
new_window->start_line = NULL;
new_window->start_line_pos = 0;
new_window->ptr_tree = ptr_leaf;
ptr_leaf->window = new_window;
/* add window to windows queue */
new_window->prev_window = last_gui_window;
if (gui_windows)
@@ -1427,6 +1555,8 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_y . . . . . . . : %d\n", window->win_y);
wee_log_printf (" win_width . . . . . : %d\n", window->win_width);
wee_log_printf (" win_height. . . . . : %d\n", window->win_height);
wee_log_printf (" win_width_pct . . . : %d\n", window->win_width_pct);
wee_log_printf (" win_height_pct. . . : %d\n", window->win_height_pct);
wee_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x);
wee_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y);
wee_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width);
+33 -8
View File
@@ -164,6 +164,9 @@ enum t_weechat_color
#define gui_printf_nolog_notime(buffer, fmt, argz...) \
gui_printf_internal(buffer, 0, MSG_TYPE_NOLOG, fmt, ##argz)
#define WINDOW_MIN_WIDTH 10
#define WINDOW_MIN_HEIGHT 5
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
@@ -261,6 +264,7 @@ struct t_gui_buffer
t_gui_buffer *next_buffer; /* link to next buffer */
};
typedef struct t_gui_window_tree t_gui_window_tree;
typedef struct t_gui_window t_gui_window;
struct t_gui_window
@@ -268,6 +272,11 @@ struct t_gui_window
/* global position & size */
int win_x, win_y; /* position of window */
int win_width, win_height; /* window geometry */
int win_width_pct; /* % of width (compared to term size) */
int win_height_pct; /* % of height (compared to term size) */
int new_x, new_y; /* used for computing new position */
int new_width, new_height; /* used for computing new size */
/* chat window settings */
int win_chat_x, win_chat_y; /* chat window position */
@@ -320,10 +329,26 @@ struct t_gui_window
t_gui_line *start_line; /* pointer to line if scrolling */
int start_line_pos; /* position in first line displayed */
t_gui_window_tree *ptr_tree; /* pointer to leaf in windows tree */
t_gui_window *prev_window; /* link to previous window */
t_gui_window *next_window; /* link to next window */
};
struct t_gui_window_tree
{
t_gui_window_tree *parent_node; /* pointer to parent node */
/* node info */
int split_horiz; /* 1 if horizontal, 0 if vertical */
int split_pct; /* % of split size (represents child1) */
t_gui_window_tree *child1; /* first child, NULL if a leaf */
t_gui_window_tree *child2; /* second child, NULL if a leaf */
/* leaf info */
t_gui_window *window; /* pointer to window, NULL if a node */
};
typedef struct t_gui_key t_gui_key;
struct t_gui_key
@@ -353,6 +378,7 @@ extern int gui_add_hotlist;
extern t_gui_window *gui_windows;
extern t_gui_window *last_gui_window;
extern t_gui_window *gui_current_window;
extern t_gui_window_tree *gui_windows_tree;
extern t_gui_buffer *gui_buffers;
extern t_gui_buffer *last_gui_buffer;
extern t_gui_buffer *buffer_before_dcc;
@@ -369,7 +395,10 @@ extern t_gui_color *gui_color[NUM_COLORS];
/* GUI independent functions: windows & buffers */
extern t_gui_window *gui_window_new (int, int, int, int);
extern int gui_window_tree_init (t_gui_window *);
extern void gui_window_tree_node_to_leaf (t_gui_window_tree *, t_gui_window *);
extern void gui_window_tree_free (t_gui_window_tree **);
extern t_gui_window *gui_window_new (t_gui_window *, int, int, int, int, int, int);
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
extern void gui_buffer_clear (t_gui_buffer *);
extern void gui_buffer_clear_all ();
@@ -480,13 +509,9 @@ extern void gui_window_nick_end (t_gui_window *);
extern void gui_window_nick_page_up (t_gui_window *);
extern void gui_window_nick_page_down (t_gui_window *);
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
extern void gui_window_split_vertic (t_gui_window *);
extern int gui_window_merge_up (t_gui_window *);
extern int gui_window_merge_down (t_gui_window *);
extern int gui_window_merge_left (t_gui_window *);
extern int gui_window_merge_right (t_gui_window *);
extern void gui_window_merge_auto (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *, int);
extern void gui_window_split_vertic (t_gui_window *, int);
extern int gui_window_merge (t_gui_window *);
extern void gui_window_merge_all (t_gui_window *);
extern void gui_refresh_screen ();
extern void gui_pre_init (int *, char **[]);
+2 -1
View File
@@ -1,7 +1,7 @@
WeeChat - Wee Enhanced Environment for Chat
===========================================
WeeChat known bugs, 2005-11-11
WeeChat known bugs, 2005-11-13
- some refresh bugs with splited windows
- ./configure does not check that Ruby libraries are installed
@@ -11,3 +11,4 @@ WeeChat known bugs, 2005-11-11
- when many WeeChat are launched, log file is not properly written (cleared by
each WeeChat at startup)
- WeeChat may crash if too much nicks in nicklist when position is top or bottom
- crash when using non colored term
+190 -177
View File
File diff suppressed because it is too large Load Diff
+240 -233
View File
File diff suppressed because it is too large Load Diff
+198 -179
View File
File diff suppressed because it is too large Load Diff
+182 -172
View File
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2005-11-11 10:15+0100\n"
"POT-Creation-Date: 2005-11-13 16:40+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -1289,7 +1289,7 @@ msgstr ""
msgid "%s: using local hostname \"%s\"\n"
msgstr ""
#: src/irc/irc-send.c:175 src/common/command.c:783
#: src/irc/irc-send.c:175 src/common/command.c:787
#, c-format
msgid "%s cannot find nick for sending message\n"
msgstr ""
@@ -1305,8 +1305,8 @@ msgstr ""
#: src/irc/irc-send.c:472 src/irc/irc-send.c:484 src/irc/irc-send.c:502
#: src/irc/irc-send.c:1166 src/irc/irc-send.c:1264 src/irc/irc-send.c:1796
#: src/common/command.c:1310 src/common/command.c:1749
#: src/common/command.c:1885
#: src/common/command.c:1353 src/common/command.c:1798
#: src/common/command.c:1934
#, c-format
msgid "%s wrong argument count for \"%s\" command\n"
msgstr ""
@@ -1644,11 +1644,11 @@ msgstr ""
msgid "%s[%s%s%s]%s idle: "
msgstr ""
#: src/irc/irc-recv.c:3134 src/common/command.c:2677 src/common/command.c:2698
#: src/irc/irc-recv.c:3134 src/common/command.c:2731 src/common/command.c:2752
msgid "days"
msgstr ""
#: src/irc/irc-recv.c:3134 src/common/command.c:2677 src/common/command.c:2698
#: src/irc/irc-recv.c:3134 src/common/command.c:2731 src/common/command.c:2752
msgid "day"
msgstr ""
@@ -2117,64 +2117,64 @@ msgstr ""
msgid "%s lag is high, disconnecting from server...\n"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "bytes"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Kb"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Mb"
msgstr ""
#: src/gui/curses/gui-display.c:1468
#: src/gui/curses/gui-display.c:1473
msgid "Gb"
msgstr ""
#: src/gui/curses/gui-display.c:1921
#: src/gui/curses/gui-display.c:1926
msgid "<servers>"
msgstr ""
#: src/gui/curses/gui-display.c:1933
#: src/gui/curses/gui-display.c:1938
msgid "(away)"
msgstr ""
#: src/gui/curses/gui-display.c:2067
#: src/gui/curses/gui-display.c:2072
msgid "[not connected] "
msgstr ""
#: src/gui/curses/gui-display.c:2077
#: src/gui/curses/gui-display.c:2082
msgid "Act: "
msgstr ""
#: src/gui/curses/gui-display.c:2165
#: src/gui/curses/gui-display.c:2170
#, c-format
msgid "Lag: %.1f"
msgstr ""
#: src/gui/curses/gui-display.c:2181
#: src/gui/curses/gui-display.c:2186
msgid "-MORE-"
msgstr ""
#: src/gui/curses/gui-display.c:2359
#: src/gui/curses/gui-display.c:2364
msgid " [A] Accept"
msgstr ""
#: src/gui/curses/gui-display.c:2360 src/gui/curses/gui-display.c:2364
#: src/gui/curses/gui-display.c:2365 src/gui/curses/gui-display.c:2369
msgid " [C] Cancel"
msgstr ""
#: src/gui/curses/gui-display.c:2369
#: src/gui/curses/gui-display.c:2374
msgid " [R] Remove"
msgstr ""
#: src/gui/curses/gui-display.c:2373
#: src/gui/curses/gui-display.c:2378
msgid " [P] Purge old DCC"
msgstr ""
#: src/gui/curses/gui-display.c:2374
#: src/gui/curses/gui-display.c:2379
msgid " [Q] Close DCC view"
msgstr ""
@@ -2182,11 +2182,11 @@ msgstr ""
msgid "server"
msgstr ""
#: src/gui/gui-common.c:509
#: src/gui/gui-common.c:637
msgid "Not enough memory for new line\n"
msgstr ""
#: src/gui/gui-common.c:854
#: src/gui/gui-common.c:982
msgid "Not enough memory for infobar message\n"
msgstr ""
@@ -2338,7 +2338,7 @@ msgstr ""
msgid "grab a key"
msgstr ""
#: src/gui/gui-keyboard.c:428 src/common/command.c:1764
#: src/gui/gui-keyboard.c:428 src/common/command.c:1813
#, c-format
msgid "%s unable to bind key \"%s\"\n"
msgstr ""
@@ -2424,36 +2424,37 @@ msgid "print debug messages"
msgstr ""
#: src/common/command.c:69
msgid "dump"
msgid "dump | windows"
msgstr ""
#: src/common/command.c:70
msgid ""
"dump: save memory dump in WeeChat log file (same dump is written when "
"WeeChat crashes)"
"WeeChat crashes)\n"
"windows: display windows tree"
msgstr ""
#: src/common/command.c:72
#: src/common/command.c:73
msgid "display help about commands"
msgstr ""
#: src/common/command.c:73
#: src/common/command.c:74
msgid "[command]"
msgstr ""
#: src/common/command.c:73
#: src/common/command.c:74
msgid "command: name of a WeeChat or IRC command"
msgstr ""
#: src/common/command.c:75
#: src/common/command.c:76
msgid "ignore IRC messages and/or hosts"
msgstr ""
#: src/common/command.c:76
#: src/common/command.c:77
msgid "[mask [[type | command] [channel [server]]]]"
msgstr ""
#: src/common/command.c:77
#: src/common/command.c:78
msgid ""
" mask: nick or host mask to ignore\n"
" type: type of message to ignore (action, ctcp, dcc, pv)\n"
@@ -2465,15 +2466,15 @@ msgid ""
"Without argument, /ignore command lists all defined ignore."
msgstr ""
#: src/common/command.c:85
#: src/common/command.c:86
msgid "bind/unbind keys"
msgstr ""
#: src/common/command.c:86
#: src/common/command.c:87
msgid "[key function/command] [unbind key] [functions] [reset -yes]"
msgstr ""
#: src/common/command.c:87
#: src/common/command.c:88
msgid ""
"key: bind this key to an internal function or a command (beginning by \"/"
"\")\n"
@@ -2483,26 +2484,26 @@ msgid ""
"binding (use carefully!)"
msgstr ""
#: src/common/command.c:92
#: src/common/command.c:93
msgid "list/load/unload plugins"
msgstr ""
#: src/common/command.c:93
#: src/common/command.c:94
msgid "[load filename] | [autoload] | [reload] | [unload]"
msgstr ""
#: src/common/command.c:94
#: src/common/command.c:95
msgid ""
"filename: WeeChat plugin (file) to load\n"
"\n"
"Without argument, /plugin command lists all loaded plugins."
msgstr ""
#: src/common/command.c:97
#: src/common/command.c:98
msgid "list, add or remove servers"
msgstr ""
#: src/common/command.c:98
#: src/common/command.c:99
msgid ""
"[servername] | [servername hostname port [-auto | -noauto] [-ipv6] [-ssl] [-"
"pwd password] [-nicks nick1 nick2 nick3] [-username username] [-realname "
@@ -2510,7 +2511,7 @@ msgid ""
"servername]"
msgstr ""
#: src/common/command.c:103
#: src/common/command.c:104
msgid ""
"servername: server name, for internal & display use\n"
"hostname: name or IP address of server\n"
@@ -2525,54 +2526,54 @@ msgid ""
"realname: real name of user"
msgstr ""
#: src/common/command.c:115
#: src/common/command.c:116
msgid "save config to disk"
msgstr ""
#: src/common/command.c:116
#: src/common/command.c:117
msgid "[file]"
msgstr ""
#: src/common/command.c:116
#: src/common/command.c:117
msgid "file: filename for writing config"
msgstr ""
#: src/common/command.c:118
#: src/common/command.c:119
msgid "set config parameters"
msgstr ""
#: src/common/command.c:119
#: src/common/command.c:120
msgid "[option [ = value]]"
msgstr ""
#: src/common/command.c:120
#: src/common/command.c:121
msgid ""
"option: name of an option (if name is full and no value is given, then help "
"is displayed on option)\n"
"value: value for option"
msgstr ""
#: src/common/command.c:124
#: src/common/command.c:125
msgid "remove an alias"
msgstr ""
#: src/common/command.c:125
#: src/common/command.c:126
msgid "alias_name"
msgstr ""
#: src/common/command.c:125
#: src/common/command.c:126
msgid "alias_name: name of alias to remove"
msgstr ""
#: src/common/command.c:127
#: src/common/command.c:128
msgid "unignore IRC messages and/or hosts"
msgstr ""
#: src/common/command.c:128
#: src/common/command.c:129
msgid "[number | [mask [[type | command] [channel [server]]]]]"
msgstr ""
#: src/common/command.c:129
#: src/common/command.c:130
msgid ""
" number: # of ignore to unignore (number is displayed by list of ignore)\n"
" mask: nick or host mask to unignore\n"
@@ -2585,29 +2586,27 @@ msgid ""
"Without argument, /unignore command lists all defined ignore."
msgstr ""
#: src/common/command.c:138
#: src/common/command.c:139
msgid "show WeeChat uptime"
msgstr ""
#: src/common/command.c:139
#: src/common/command.c:140
msgid "-o"
msgstr ""
#: src/common/command.c:140
#: src/common/command.c:141
msgid "-o: send uptime on current channel as an IRC message"
msgstr ""
#: src/common/command.c:142
#: src/common/command.c:143
msgid "manage windows"
msgstr ""
#: src/common/command.c:143
msgid ""
"[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | "
"all]]]"
#: src/common/command.c:144
msgid "[list | -1 | +1 | b# | splith [pct] | splitv [pct] | [merge [all]]]"
msgstr ""
#: src/common/command.c:144
#: src/common/command.c:145
msgid ""
"list: list opened windows (no parameter implies this list)\n"
"-1: jump to previous window\n"
@@ -2615,517 +2614,528 @@ msgid ""
"b#: jump to next window displaying buffer number #\n"
"splith: split current window horizontally\n"
"splitv: split current window vertically\n"
"merge: merge window with another"
"merge: merge window with another (all = keep only one window)\n"
"\n"
"For splith and splitv, pct is a pourcentage 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"
msgstr ""
#: src/common/command.c:293
#: src/common/command.c:297
#, c-format
msgid "%s alias or command \"%s\" already exists!\n"
msgstr ""
#: src/common/command.c:303
#: src/common/command.c:307
#, c-format
msgid "%s alias cannot run another alias!\n"
msgstr ""
#: src/common/command.c:310
#: src/common/command.c:314
#, c-format
msgid "%s target command \"/%s\" does not exist!\n"
msgstr ""
#: src/common/command.c:548
#: src/common/command.c:552
#, c-format
msgid "%s wrong argument count for %s command \"%s\" (expected: %d arg%s)\n"
msgstr ""
#: src/common/command.c:560
#: src/common/command.c:564
#, c-format
msgid ""
"%s wrong argument count for %s command \"%s\" (expected: between %d and %d "
"arg%s)\n"
msgstr ""
#: src/common/command.c:582 src/common/command.c:651
#: src/common/command.c:586 src/common/command.c:655
#, c-format
msgid "%s command \"%s\" failed\n"
msgstr ""
#: src/common/command.c:607
#: src/common/command.c:611
#, c-format
msgid "%s wrong argument count for IRC command \"%s\" (expected: %d arg%s)\n"
msgstr ""
#: src/common/command.c:619
#: src/common/command.c:623
#, c-format
msgid ""
"%s wrong argument count for IRC command \"%s\" (expected: between %d and %d "
"arg%s)\n"
msgstr ""
#: src/common/command.c:634
#: src/common/command.c:638
#, c-format
msgid "%s command \"%s\" needs a server connection!\n"
msgstr ""
#: src/common/command.c:694
#: src/common/command.c:698
#, c-format
msgid "%s unknown command \"%s\" (type /help for help)\n"
msgstr ""
#: src/common/command.c:828
#: src/common/command.c:832
msgid "This window is not a channel!\n"
msgstr ""
#: src/common/command.c:856 src/common/command.c:887 src/common/command.c:995
#: src/common/command.c:860 src/common/command.c:891 src/common/command.c:999
#, c-format
msgid "%s missing arguments for \"%s\" command\n"
msgstr ""
#: src/common/command.c:863
#: src/common/command.c:867
#, c-format
msgid "%s alias can not start with \"/\"\n"
msgstr ""
#: src/common/command.c:872
#: src/common/command.c:876
#, c-format
msgid "Alias \"%s\" => \"%s\" created\n"
msgstr ""
#: src/common/command.c:878
#: src/common/command.c:882
#, c-format
msgid "Failed to create alias \"%s\" => \"%s\" (not enough memory)\n"
msgstr ""
#: src/common/command.c:898
#: src/common/command.c:902
msgid "List of aliases:\n"
msgstr ""
#: src/common/command.c:912
#: src/common/command.c:916
msgid "No alias defined.\n"
msgstr ""
#: src/common/command.c:929
#: src/common/command.c:933
#, c-format
msgid "%sServer: %s%s\n"
msgstr ""
#: src/common/command.c:934
#: src/common/command.c:938
#, c-format
msgid "%sChannel: %s%s %s(server: %s%s%s)\n"
msgstr ""
#: src/common/command.c:943
#: src/common/command.c:947
#, c-format
msgid "%sPrivate with: %s%s %s(server: %s%s%s)\n"
msgstr ""
#: src/common/command.c:952
#: src/common/command.c:956
msgid "not connected\n"
msgstr ""
#: src/common/command.c:974
#: src/common/command.c:978
msgid "Opened buffers:\n"
msgstr ""
#: src/common/command.c:1018
#: src/common/command.c:1022
#, c-format
msgid "%s incorrect buffer number\n"
msgstr ""
#: src/common/command.c:1034
#: src/common/command.c:1038
#, c-format
msgid "%s can not close the single buffer\n"
msgstr ""
#: src/common/command.c:1044
#: src/common/command.c:1048
#, c-format
msgid "%s can not close server buffer while channels are opened\n"
msgstr ""
#: src/common/command.c:1093
#: src/common/command.c:1097
msgid "Notify levels: "
msgstr ""
#: src/common/command.c:1122 src/common/command.c:1170
#: src/common/command.c:1126 src/common/command.c:1174
#, c-format
msgid "%s incorrect notify level (must be between %d and %d)\n"
msgstr ""
#: src/common/command.c:1131
#: src/common/command.c:1135
#, c-format
msgid "%s incorrect buffer for notify (must be channel or private)\n"
msgstr ""
#: src/common/command.c:1140
#: src/common/command.c:1144
#, c-format
msgid "New notify level for %s%s%s: %s%d %s"
msgstr ""
#: src/common/command.c:1150
#: src/common/command.c:1154
msgid "(hotlist: never)\n"
msgstr ""
#: src/common/command.c:1153
#: src/common/command.c:1157
msgid "(hotlist: highlights)\n"
msgstr ""
#: src/common/command.c:1156
#: src/common/command.c:1160
msgid "(hotlist: highlights + messages)\n"
msgstr ""
#: src/common/command.c:1159
#: src/common/command.c:1163
msgid "(hotlist: highlights + messages + join/part (all))\n"
msgstr ""
#: src/common/command.c:1237
#: src/common/command.c:1241
#, c-format
msgid "unknown parameter \"%s\" for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1267
#: src/common/command.c:1271
#, c-format
msgid "%s already connected to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1275
#: src/common/command.c:1279
#, c-format
msgid "%s currently connecting to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1293 src/common/command.c:1368
#: src/common/command.c:1297 src/common/command.c:1417
#, c-format
msgid "%s server not found\n"
msgstr ""
#: src/common/command.c:1323 src/common/command.c:1878
#: src/common/command.c:2786 src/common/command.c:2810
#: src/common/command.c:1372 src/common/command.c:1927
#: src/common/command.c:2850 src/common/command.c:2885
#, c-format
msgid "%s unknown option for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1352
#: src/common/command.c:1401
#, c-format
msgid "%s not connected to server \"%s\"!\n"
msgstr ""
#: src/common/command.c:1360
#: src/common/command.c:1409
msgid "Auto-reconnection is cancelled\n"
msgstr ""
#: src/common/command.c:1391 src/common/weechat.c:365
#: src/common/command.c:1440 src/common/weechat.c:365
#, c-format
msgid "%s internal commands:\n"
msgstr ""
#: src/common/command.c:1401 src/common/weechat.c:385
#: src/common/command.c:1450 src/common/weechat.c:385
#, c-format
msgid "IRC commands:\n"
msgstr ""
#: src/common/command.c:1415
#: src/common/command.c:1464
msgid "Plugin commands:\n"
msgstr ""
#: src/common/command.c:1531
#: src/common/command.c:1580
#, c-format
msgid "No help available, \"%s\" is an unknown command\n"
msgstr ""
#: src/common/command.c:1550
#: src/common/command.c:1599
#, c-format
msgid "%son %s%s%s/%s%s%s:%s ignoring %s%s%s from %s%s\n"
msgstr ""
#: src/common/command.c:1584
#: src/common/command.c:1633
msgid "List of ignore:\n"
msgstr ""
#: src/common/command.c:1601
#: src/common/command.c:1650
msgid "No ignore defined.\n"
msgstr ""
#: src/common/command.c:1627
#: src/common/command.c:1676
msgid "New ignore:"
msgstr ""
#: src/common/command.c:1647
#: src/common/command.c:1696
#, c-format
msgid "New key binding: %s"
msgstr ""
#: src/common/command.c:1681
#: src/common/command.c:1730
msgid "Key bindings:\n"
msgstr ""
#: src/common/command.c:1695
#: src/common/command.c:1744
#, c-format
msgid "Key \"%s\" unbinded\n"
msgstr ""
#: src/common/command.c:1701
#: src/common/command.c:1750
#, c-format
msgid "%s unable to unbind key \"%s\"\n"
msgstr ""
#: src/common/command.c:1709 src/common/weechat.c:416
#: src/common/command.c:1758 src/common/weechat.c:416
#, c-format
msgid "Internal key functions:\n"
msgstr ""
#: src/common/command.c:1729
#: src/common/command.c:1778
msgid "Default key bindings restored\n"
msgstr ""
#: src/common/command.c:1735
#: src/common/command.c:1784
#, c-format
msgid "%s \"-yes\" argument is required for keys reset (securuty reason)\n"
msgstr ""
#: src/common/command.c:1791
#: src/common/command.c:1840
msgid "Plugins loaded:\n"
msgstr ""
#: src/common/command.c:1807
#: src/common/command.c:1856
msgid " message handlers:\n"
msgstr ""
#: src/common/command.c:1816
#: src/common/command.c:1865
#, c-format
msgid " IRC(%s)\n"
msgstr ""
#: src/common/command.c:1823
#: src/common/command.c:1872
msgid " (no message handler)\n"
msgstr ""
#: src/common/command.c:1828
#: src/common/command.c:1877
msgid " command handlers:\n"
msgstr ""
#: src/common/command.c:1849
#: src/common/command.c:1898
msgid " (no command handler)\n"
msgstr ""
#: src/common/command.c:1855
#: src/common/command.c:1904
msgid " (no plugin)\n"
msgstr ""
#: src/common/command.c:1891
#: src/common/command.c:1940
msgid ""
"Command \"plugin\" is not available, WeeChat was built without plugins "
"support.\n"
msgstr ""
#: src/common/command.c:1938
#: src/common/command.c:1988
msgid "No server.\n"
msgstr ""
#: src/common/command.c:1949
#: src/common/command.c:1999
#, c-format
msgid "Server '%s' not found.\n"
msgstr ""
#: src/common/command.c:1961
#: src/common/command.c:2011
#, c-format
msgid "%s missing servername for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1969
#: src/common/command.c:2019
#, c-format
msgid "%s too much arguments for \"%s\" command, ignoring arguments\n"
msgstr ""
#: src/common/command.c:1988
#: src/common/command.c:2038
#, c-format
msgid "%s server \"%s\" not found for \"%s\" command\n"
msgstr ""
#: src/common/command.c:1996
#: src/common/command.c:2046
#, c-format
msgid ""
"%s you can not delete server \"%s\" because you are connected to. Try /"
"disconnect %s before.\n"
msgstr ""
#: src/common/command.c:2014
#: src/common/command.c:2066
#, c-format
msgid "Server %s%s%s has been deleted\n"
msgstr ""
#: src/common/command.c:2031
#: src/common/command.c:2085
#, c-format
msgid "%s missing parameters for \"%s\" command\n"
msgstr ""
#: src/common/command.c:2041
#: src/common/command.c:2095
#, c-format
msgid "%s server \"%s\" already exists, can't create it!\n"
msgstr ""
#: src/common/command.c:2070 src/common/command.c:2098
#: src/common/command.c:2111 src/common/command.c:2137
#: src/common/command.c:2124 src/common/command.c:2152
#: src/common/command.c:2165 src/common/command.c:2191
#, c-format
msgid "%s missing password for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2083
#: src/common/command.c:2137
#, c-format
msgid "%s missing nick(s) for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2124
#: src/common/command.c:2178
#, c-format
msgid "%s missing command for \"%s\" parameter\n"
msgstr ""
#: src/common/command.c:2159
#: src/common/command.c:2213
#, c-format
msgid "Server %s%s%s created\n"
msgstr ""
#: src/common/command.c:2168
#: src/common/command.c:2222
#, c-format
msgid "%s unable to create server\n"
msgstr ""
#: src/common/command.c:2227
#: src/common/command.c:2281
msgid "(unknown)"
msgstr ""
#: src/common/command.c:2250
#: src/common/command.c:2304
#, c-format
msgid "%s(password hidden) "
msgstr ""
#: src/common/command.c:2317
#: src/common/command.c:2371
#, c-format
msgid "%s server \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2350 src/common/command.c:2398
#: src/common/command.c:2404 src/common/command.c:2452
#, c-format
msgid "%s config option \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2355 src/common/command.c:2390
#: src/common/command.c:2409 src/common/command.c:2444
#, c-format
msgid "%s incorrect value for option \"%s\"\n"
msgstr ""
#: src/common/command.c:2371
#: src/common/command.c:2425
#, c-format
msgid "%s option \"%s\" can not be changed while WeeChat is running\n"
msgstr ""
#: src/common/command.c:2481
#: src/common/command.c:2535
#, c-format
msgid "No config option found with \"%s\"\n"
msgstr ""
#: src/common/command.c:2484
#: src/common/command.c:2538
msgid "No config option found\n"
msgstr ""
#: src/common/command.c:2491
#: src/common/command.c:2545
#, c-format
msgid "%sDetail:\n"
msgstr ""
#: src/common/command.c:2496 src/common/weechat.c:302
#: src/common/command.c:2550 src/common/weechat.c:302
#, c-format
msgid " . type boolean (values: 'on' or 'off')\n"
msgstr ""
#: src/common/command.c:2497 src/common/command.c:2520
#: src/common/command.c:2526 src/common/command.c:2532
#: src/common/command.c:2551 src/common/command.c:2574
#: src/common/command.c:2580 src/common/command.c:2586
#: src/common/weechat.c:303 src/common/weechat.c:326 src/common/weechat.c:332
#: src/common/weechat.c:338
#, c-format
msgid " . default value: '%s'\n"
msgstr ""
#: src/common/command.c:2502 src/common/weechat.c:308
#: src/common/command.c:2556 src/common/weechat.c:308
#, c-format
msgid " . type integer (values: between %d and %d)\n"
msgstr ""
#: src/common/command.c:2505 src/common/weechat.c:311
#: src/common/command.c:2559 src/common/weechat.c:311
#, c-format
msgid " . default value: %d\n"
msgstr ""
#: src/common/command.c:2509 src/common/weechat.c:315
#: src/common/command.c:2563 src/common/weechat.c:315
#, c-format
msgid " . type string (values: "
msgstr ""
#: src/common/command.c:2522 src/common/command.c:2528
#: src/common/command.c:2534 src/common/weechat.c:328 src/common/weechat.c:334
#: src/common/command.c:2576 src/common/command.c:2582
#: src/common/command.c:2588 src/common/weechat.c:328 src/common/weechat.c:334
#: src/common/weechat.c:340
msgid "empty"
msgstr ""
#: src/common/command.c:2525 src/common/weechat.c:331
#: src/common/command.c:2579 src/common/weechat.c:331
#, c-format
msgid " . type color (Curses or Gtk color, look at WeeChat doc)\n"
msgstr ""
#: src/common/command.c:2531 src/common/weechat.c:337
#: src/common/command.c:2585 src/common/weechat.c:337
#, c-format
msgid " . type string (any string)\n"
msgstr ""
#: src/common/command.c:2537 src/common/weechat.c:343
#: src/common/command.c:2591 src/common/weechat.c:343
#, c-format
msgid " . description: %s\n"
msgstr ""
#: src/common/command.c:2548
#: src/common/command.c:2602
#, c-format
msgid "config option(s) found with \"%s\"\n"
msgstr ""
#: src/common/command.c:2551
#: src/common/command.c:2605
msgid "config option(s) found\n"
msgstr ""
#: src/common/command.c:2572
#: src/common/command.c:2626
#, c-format
msgid "%s alias or command \"%s\" not found\n"
msgstr ""
#: src/common/command.c:2582
#: src/common/command.c:2636
#, c-format
msgid "Alias \"%s\" removed\n"
msgstr ""
#: src/common/command.c:2638
#: src/common/command.c:2692
msgid "ignore were removed.\n"
msgstr ""
#: src/common/command.c:2640
#: src/common/command.c:2694
msgid "ignore was removed.\n"
msgstr ""
#: src/common/command.c:2645
#: src/common/command.c:2699
#, c-format
msgid "%s no ignore found\n"
msgstr ""
#: src/common/command.c:2675
#: src/common/command.c:2729
#, c-format
msgid "WeeChat uptime: %d %s %02d:%02d:%02d, started on %s"
msgstr ""
#: src/common/command.c:2692
#: src/common/command.c:2746
#, c-format
msgid "WeeChat uptime: %s%d %s%s %s%02d%s:%s%02d%s:%s%02d%s, started on %s%s"
msgstr ""
#: src/common/command.c:2732
#: src/common/command.c:2786
msgid "Opened windows:\n"
msgstr ""
#: src/common/command.c:2861
#, c-format
msgid ""
"%s can not merge windows, there's no other window with same size near "
"current one.\n"
msgstr ""
#: src/common/fifo.c:71 src/common/fifo.c:73
#, c-format
msgid "%s unable to create FIFO pipe for remote control (%s)\n"
+92 -17
View File
@@ -66,8 +66,9 @@ t_weechat_command weechat_commands[] =
N_("servername: server name to disconnect"),
0, 1, weechat_cmd_disconnect, NULL },
{ "debug", N_("print debug messages"),
N_("dump"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)"),
N_("dump | windows"),
N_("dump: save memory dump in WeeChat log file (same dump is written when WeeChat crashes)\n"
"windows: display windows tree"),
1, 1, weechat_cmd_debug, NULL },
{ "help", N_("display help about commands"),
N_("[command]"), N_("command: name of a WeeChat or IRC command"),
@@ -140,14 +141,17 @@ t_weechat_command weechat_commands[] =
N_("-o: send uptime on current channel as an IRC message"),
0, 1, weechat_cmd_uptime, NULL },
{ "window", N_("manage windows"),
N_("[list | -1 | +1 | b# | splith | splitv | [merge [down | up | left | right | all]]]"),
N_("[list | -1 | +1 | b# | splith [pct] | splitv [pct] | [merge [all]]]"),
N_("list: list opened windows (no parameter implies this list)\n"
"-1: jump to previous window\n"
"+1: jump to next window\n"
"b#: jump to next window displaying buffer number #\n"
"splith: split current window horizontally\n"
"splitv: split current window vertically\n"
"merge: merge window with another"),
"merge: merge window with another (all = keep only one window)\n\n"
"For splith and splitv, pct is a pourcentage 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"),
0, 2, weechat_cmd_window, NULL },
{ NULL, NULL, NULL, NULL, 0, 0, NULL, NULL }
};
@@ -1296,6 +1300,45 @@ weechat_cmd_connect (int argc, char **argv)
return 0;
}
/*
* weechat_cmd_debug_display_windows: display tree of windows
*/
void
weechat_cmd_debug_display_windows (t_gui_window_tree *tree, int indent)
{
int i;
if (tree)
{
for (i = 0; i < indent; i++)
gui_printf_nolog (NULL, " ");
if (tree->window)
{
/* leaf */
gui_printf_nolog (NULL, "leaf: %X (parent:%X), win=%X, child1=%X, child2=%X, %d,%d %dx%d, %d%%x%d%%\n",
tree, tree->parent_node, tree->window,
tree->child1, tree->child2,
tree->window->win_x, tree->window->win_y,
tree->window->win_width, tree->window->win_height,
tree->window->win_width_pct, tree->window->win_height_pct);
}
else
{
/* node */
gui_printf_nolog (NULL, "node: %X (parent:%X), win=%X, child1=%X, child2=%X)\n",
tree, tree->parent_node, tree->window,
tree->child1, tree->child2);
}
if (tree->child1)
weechat_cmd_debug_display_windows (tree->child1, indent + 1);
if (tree->child2)
weechat_cmd_debug_display_windows (tree->child2, indent + 1);
}
}
/*
* weechat_cmd_debug: print debug messages
*/
@@ -1316,6 +1359,12 @@ weechat_cmd_debug (int argc, char **argv)
{
wee_dump (0);
}
else if (ascii_strcasecmp (argv[0], "windows") == 0)
{
gui_printf_nolog (NULL, "\n");
gui_printf_nolog (NULL, "DEBUG: windows tree:\n");
weechat_cmd_debug_display_windows (gui_windows_tree, 1);
}
else
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
@@ -1918,6 +1967,7 @@ weechat_cmd_server (int argc, char **argv)
int i;
t_irc_server server, *ptr_server, *server_found, *new_server;
t_gui_buffer *ptr_buffer;
char *server_name;
if ((argc == 0) || (argc == 1))
{
@@ -2008,13 +2058,17 @@ weechat_cmd_server (int argc, char **argv)
}
}
server_name = strdup (server_found->name);
server_free (server_found);
irc_display_prefix (NULL, NULL, PREFIX_INFO);
gui_printf (NULL, _("Server %s%s%s has been deleted\n"),
GUI_COLOR(COLOR_WIN_CHAT_SERVER),
server_found->name,
server_name,
GUI_COLOR(COLOR_WIN_CHAT));
if (server_name)
free (server_name);
gui_redraw_buffer (gui_current_window->buffer);
@@ -2758,26 +2812,36 @@ weechat_cmd_window (int argc, char **argv)
if (ascii_strcasecmp (argv[0], "splith") == 0)
{
/* split window horizontally */
gui_window_split_horiz (gui_current_window);
if (argc > 1)
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0')
&& (number > 0) && (number < 100))
gui_window_split_horiz (gui_current_window, number);
}
else
gui_window_split_horiz (gui_current_window, 50);
}
else if (ascii_strcasecmp (argv[0], "splitv") == 0)
{
/* split window vertically */
gui_window_split_vertic (gui_current_window);
if (argc > 1)
{
error = NULL;
number = strtol (argv[1], &error, 10);
if ((error) && (error[0] == '\0')
&& (number > 0) && (number < 100))
gui_window_split_vertic (gui_current_window, number);
}
else
gui_window_split_vertic (gui_current_window, 50);
}
else if (ascii_strcasecmp (argv[0], "merge") == 0)
{
if (argc >= 2)
{
if (ascii_strcasecmp (argv[1], "down") == 0)
gui_window_merge_down (gui_current_window);
else if (ascii_strcasecmp (argv[1], "up") == 0)
gui_window_merge_up (gui_current_window);
else if (ascii_strcasecmp (argv[1], "left") == 0)
gui_window_merge_left (gui_current_window);
else if (ascii_strcasecmp (argv[1], "right") == 0)
gui_window_merge_right (gui_current_window);
else if (ascii_strcasecmp (argv[1], "all") == 0)
if (ascii_strcasecmp (argv[1], "all") == 0)
gui_window_merge_all (gui_current_window);
else
{
@@ -2789,7 +2853,18 @@ weechat_cmd_window (int argc, char **argv)
}
}
else
gui_window_merge_auto (gui_current_window);
{
if (!gui_window_merge (gui_current_window))
{
irc_display_prefix (NULL, NULL, PREFIX_ERROR);
gui_printf (NULL,
_("%s can not merge windows, "
"there's no other window with same size "
"near current one.\n"),
WEECHAT_ERROR);
return -1;
}
}
}
else if (ascii_strncasecmp (argv[0], "b", 1) == 0)
{
+5
View File
@@ -186,9 +186,14 @@ completion_build_list (t_completion *completion, void *channel)
if (ascii_strcasecmp (completion->base_command, "debug") == 0)
{
if (completion->base_command_arg == 1)
{
weelist_add (&completion->completion_list,
&completion->last_completion,
"dump");
weelist_add (&completion->completion_list,
&completion->last_completion,
"windows");
}
else
completion_stop (completion);
return;
+167 -205
View File
@@ -2800,7 +2800,7 @@ gui_window_init_subwindows (t_gui_window *window)
*/
void
gui_window_split_horiz (t_gui_window *window)
gui_window_split_horiz (t_gui_window *window, int pourcentage)
{
t_gui_window *new_window;
int height1, height2;
@@ -2808,24 +2808,32 @@ gui_window_split_horiz (t_gui_window *window)
if (!gui_ok)
return;
height1 = window->win_height / 2;
height1 = (window->win_height * pourcentage) / 100;
height2 = window->win_height - height1;
if ((new_window = gui_window_new (window->win_x, window->win_y,
window->win_width, height1)))
if ((height1 >= WINDOW_MIN_HEIGHT) && (height2 >= WINDOW_MIN_HEIGHT)
&& (pourcentage > 0) && (pourcentage <= 100))
{
/* reduce old window height (bottom window) */
window->win_y = new_window->win_y + new_window->win_height;
window->win_height = height2;
/* assign same buffer for new window (top window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
if ((new_window = gui_window_new (window,
window->win_x, window->win_y,
window->win_width, height1,
100, pourcentage)))
{
/* reduce old window height (bottom window) */
window->win_y = new_window->win_y + new_window->win_height;
window->win_height = height2;
window->win_height_pct = 100 - pourcentage;
/* assign same buffer for new window (top window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
}
}
@@ -2834,7 +2842,7 @@ gui_window_split_horiz (t_gui_window *window)
*/
void
gui_window_split_vertic (t_gui_window *window)
gui_window_split_vertic (t_gui_window *window, int pourcentage)
{
t_gui_window *new_window;
int width1, width2;
@@ -2842,170 +2850,84 @@ gui_window_split_vertic (t_gui_window *window)
if (!gui_ok)
return;
width1 = window->win_width / 2;
width1 = (window->win_width * pourcentage) / 100;
width2 = window->win_width - width1 - 1;
if ((new_window = gui_window_new (window->win_x + width1 + 1, window->win_y,
width2, window->win_height)))
if ((width1 >= WINDOW_MIN_WIDTH) && (width2 >= WINDOW_MIN_WIDTH)
&& (pourcentage > 0) && (pourcentage <= 100))
{
/* reduce old window height (left window) */
window->win_width = width1;
if ((new_window = gui_window_new (window,
window->win_x + width1 + 1, window->win_y,
width2, window->win_height,
pourcentage, 100)))
{
/* reduce old window height (left window) */
window->win_width = width1;
window->win_width_pct = 100 - pourcentage;
/* assign same buffer for new window (right window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
/* create & draw separator */
gui_draw_window_separator (gui_current_window);
}
}
}
/*
* gui_window_merge: merge window with its sister
*/
int
gui_window_merge (t_gui_window *window)
{
t_gui_window_tree *parent, *sister;
parent = window->ptr_tree->parent_node;
if (parent)
{
sister = (parent->child1->window == window) ?
parent->child2 : parent->child1;
/* assign same buffer for new window (right window) */
new_window->buffer = window->buffer;
new_window->buffer->num_displayed++;
if (!(sister->window))
return 0;
if (window->win_y == sister->window->win_y)
{
/* horizontal merge */
window->win_width += sister->window->win_width + 1;
window->win_width_pct += sister->window->win_width_pct;
}
else
{
/* vertical merge */
window->win_height += sister->window->win_height;
window->win_height_pct += sister->window->win_height_pct;
}
if (sister->window->win_x < window->win_x)
window->win_x = sister->window->win_x;
if (sister->window->win_y < window->win_y)
window->win_y = sister->window->win_y;
gui_window_free (sister->window);
gui_window_tree_node_to_leaf (parent, window);
gui_switch_to_buffer (window, window->buffer);
gui_current_window = new_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
/* create & draw separator */
gui_draw_window_separator (gui_current_window);
gui_redraw_buffer (window->buffer);
return 1;
}
return 0;
}
/*
* gui_window_merge_down: merge window, direction down
*/
int
gui_window_merge_down (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_y == window->win_y + window->win_height)
&& (ptr_win->win_x == window->win_x)
&& (ptr_win->win_width == window->win_width))
{
window->win_height += ptr_win->win_height;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found below current window */
return -1;
}
/*
* gui_window_merge_up: merge window, direction up
*/
int
gui_window_merge_up (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_y + ptr_win->win_height == window->win_y)
&& (ptr_win->win_x == window->win_x)
&& (ptr_win->win_width == window->win_width))
{
window->win_height += ptr_win->win_height;
window->win_y -= ptr_win->win_height;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found above current window */
return -1;
}
/*
* gui_window_merge_left: merge window, direction left
*/
int
gui_window_merge_left (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_x + ptr_win->win_width + 1 == window->win_x)
&& (ptr_win->win_y == window->win_y)
&& (ptr_win->win_height == window->win_height))
{
window->win_width += ptr_win->win_width + 1;
window->win_x -= ptr_win->win_width + 1;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found on the left of current window */
return -1;
}
/*
* gui_window_merge_right: merge window, direction right
*/
int
gui_window_merge_right (t_gui_window *window)
{
t_gui_window *ptr_win;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if (ptr_win != window)
{
if ((ptr_win->win_x == window->win_x + window->win_width + 1)
&& (ptr_win->win_y == window->win_y)
&& (ptr_win->win_height == window->win_height))
{
window->win_width += ptr_win->win_width + 1;
gui_window_free (ptr_win);
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
return 0;
}
}
}
/* no window found on the right of current window */
return -1;
}
/*
* gui_window_merge: merge a window, direction auto
*/
void
gui_window_merge_auto (t_gui_window *window)
{
if (gui_window_merge_down (window) == 0)
return;
if (gui_window_merge_up (window) == 0)
return;
if (gui_window_merge_left (window) == 0)
return;
if (gui_window_merge_right (window) == 0)
return;
}
/*
* gui_window_merge_all: merge all windows
* gui_window_merge_all: merge all windows into only one
*/
void
@@ -3015,14 +2937,61 @@ gui_window_merge_all (t_gui_window *window)
{
gui_window_free ((gui_windows == window) ? gui_windows->next_window : gui_windows);
}
gui_window_tree_free (&gui_windows_tree);
gui_window_tree_init (window);
window->ptr_tree = gui_windows_tree;
window->win_x = 0;
window->win_y = 0;
window->win_width = COLS;
window->win_height = LINES;
window->win_width_pct = 100;
window->win_height_pct = 100;
gui_switch_to_buffer (window, window->buffer);
gui_redraw_buffer (window->buffer);
}
/*
* gui_window_auto_resize: auto-resize all windows, according to % of global size
* This function is called after a terminal resize.
* Returns 0 if ok, -1 if all window should be merged
* (not enough space according to windows %)
*/
void
gui_window_auto_resize (t_gui_window_tree *tree,
int x, int y, int width, int height)
{
int size1, size2;
if (tree)
{
if (tree->window)
{
tree->window->win_x = x;
tree->window->win_y = y;
tree->window->win_width = width;
tree->window->win_height = height;
}
else
{
if (tree->split_horiz)
{
size1 = (height * tree->split_pct) / 100;
size2 = height - size1;
gui_window_auto_resize (tree->child1, x, y + size1, width, size2);
gui_window_auto_resize (tree->child2, x, y, width, size1);
}
else
{
size1 = (width * tree->split_pct) / 100;
size2 = width - size1 - 1;
gui_window_auto_resize (tree->child1, x, y, size1, height);
gui_window_auto_resize (tree->child2, x + size1 + 1, y, size2, height);
}
}
}
}
/*
* gui_refresh_screen: called when term size is modified
*/
@@ -3033,7 +3002,7 @@ gui_refresh_screen ()
t_gui_window *ptr_win, *old_current_window;
int old_width, old_height;
int new_width, new_height;
int merge_all_windows;
int merge_all;
getmaxyx (stdscr, old_height, old_width);
@@ -3044,44 +3013,36 @@ gui_refresh_screen ()
old_current_window = gui_current_window;
gui_ok = ((new_width > 5) && (new_height > 5));
gui_ok = ((new_width > WINDOW_MIN_WIDTH) && (new_height > WINDOW_MIN_HEIGHT));
merge_all_windows = 0;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
if (gui_ok)
{
ptr_win->dcc_first = NULL;
ptr_win->dcc_selected = NULL;
gui_window_auto_resize (gui_windows_tree, 0, 0, COLS, LINES);
if (!merge_all_windows)
merge_all = 0;
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
if ((ptr_win->win_x > new_width - 5)
|| (ptr_win->win_y > new_height - 5))
merge_all_windows = 1;
else
if ((ptr_win->win_width < WINDOW_MIN_WIDTH)
|| (ptr_win->win_height < WINDOW_MIN_HEIGHT))
{
if (ptr_win->win_x + ptr_win->win_width == old_width)
ptr_win->win_width = new_width - ptr_win->win_x;
if (ptr_win->win_y + ptr_win->win_height == old_height)
ptr_win->win_height = new_height - ptr_win->win_y;
if ((ptr_win->win_width < 5) || (ptr_win->win_height < 5))
merge_all_windows = 1;
merge_all = 1;
break;
}
}
if (merge_all)
gui_window_merge_all (gui_current_window);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_switch_to_buffer (ptr_win, ptr_win->buffer);
gui_redraw_buffer (ptr_win->buffer);
gui_draw_window_separator (ptr_win);
}
gui_current_window = old_current_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
if (merge_all_windows)
gui_window_merge_all (gui_current_window);
for (ptr_win = gui_windows; ptr_win; ptr_win = ptr_win->next_window)
{
gui_switch_to_buffer (ptr_win, ptr_win->buffer);
gui_redraw_buffer (ptr_win->buffer);
gui_draw_window_separator (ptr_win);
}
gui_current_window = old_current_window;
gui_switch_to_buffer (gui_current_window, gui_current_window->buffer);
gui_redraw_buffer (gui_current_window->buffer);
}
/*
@@ -3265,7 +3226,7 @@ gui_init ()
gui_input_clipboard = NULL;
/* create new window/buffer */
if (gui_window_new (0, 0, COLS, LINES))
if (gui_window_new (NULL, 0, 0, COLS, LINES, 100, 100))
{
gui_current_window = gui_windows;
gui_buffer_new (gui_windows, NULL, NULL, 0, 1);
@@ -3316,6 +3277,7 @@ gui_end ()
/* delete all windows */
while (gui_windows)
gui_window_free (gui_windows);
gui_window_tree_free (&gui_windows_tree);
/* delete global history */
history_global_free ();
+131 -1
View File
@@ -54,6 +54,8 @@ t_gui_window *gui_windows = NULL; /* pointer to first window */
t_gui_window *last_gui_window = NULL; /* pointer to last window */
t_gui_window *gui_current_window = NULL; /* pointer to current window */
t_gui_window_tree *gui_windows_tree = NULL; /* pointer to windows tree */
t_gui_buffer *gui_buffers = NULL; /* pointer to first buffer */
t_gui_buffer *last_gui_buffer = NULL; /* pointer to last buffer */
t_gui_buffer *buffer_before_dcc = NULL; /* buffer before dcc switch */
@@ -61,25 +63,148 @@ t_gui_infobar *gui_infobar; /* pointer to infobar content */
char *gui_input_clipboard = NULL; /* clipboard content */
/*
* gui_window_tree_init: create first entry in windows tree
*/
int
gui_window_tree_init (t_gui_window *window)
{
gui_windows_tree = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!gui_windows_tree)
return 0;
gui_windows_tree->parent_node = NULL;
gui_windows_tree->split_horiz = 0;
gui_windows_tree->split_pct = 0;
gui_windows_tree->child1 = NULL;
gui_windows_tree->child2 = NULL;
gui_windows_tree->window = window;
return 1;
}
/*
* gui_window_tree_node_to_leaf: convert a node to a leaf (free any leafs)
* Called when 2 windows are merging into one
*/
void
gui_window_tree_node_to_leaf (t_gui_window_tree *node, t_gui_window *window)
{
node->split_horiz = 0;
node->split_pct = 0;
if (node->child1)
{
free (node->child1);
node->child1 = NULL;
}
if (node->child2)
{
free (node->child2);
node->child2 = NULL;
}
node->window = window;
window->ptr_tree = node;
}
/*
* gui_window_tree_free: delete entire windows tree
*/
void
gui_window_tree_free (t_gui_window_tree **tree)
{
if (*tree)
{
if ((*tree)->child1)
gui_window_tree_free (&((*tree)->child1));
if ((*tree)->child2)
gui_window_tree_free (&((*tree)->child2));
free (*tree);
*tree = NULL;
}
}
/*
* gui_window_new: create a new window
*/
t_gui_window *
gui_window_new (int x, int y, int width, int height)
gui_window_new (t_gui_window *parent, int x, int y, int width, int height,
int width_pct, int height_pct)
{
t_gui_window *new_window;
t_gui_window_tree *ptr_tree, *child1, *child2, *ptr_leaf;
#ifdef DEBUG
wee_log_printf ("Creating new window (x:%d, y:%d, width:%d, height:%d)\n",
x, y, width, height);
#endif
if (parent)
{
child1 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!child1)
return NULL;
child2 = (t_gui_window_tree *)malloc (sizeof (t_gui_window_tree));
if (!child2)
{
free (child1);
return NULL;
}
ptr_tree = parent->ptr_tree;
if (width_pct == 100)
{
ptr_tree->split_horiz = 1;
ptr_tree->split_pct = height_pct;
}
else
{
ptr_tree->split_horiz = 0;
ptr_tree->split_pct = width_pct;
}
/* parent window leaf becomes node and we add 2 leafs below
(#1 is parent win, #2 is new win) */
parent->ptr_tree = child1;
child1->parent_node = ptr_tree;
child1->child1 = NULL;
child1->child2 = NULL;
child1->window = ptr_tree->window;
child2->parent_node = ptr_tree;
child2->child1 = NULL;
child2->child2 = NULL;
child2->window = NULL; /* will be assigned by new window below */
ptr_tree->child1 = child1;
ptr_tree->child2 = child2;
ptr_tree->window = NULL; /* leaf becomes node */
ptr_leaf = child2;
}
else
{
if (!gui_window_tree_init (NULL))
return NULL;
ptr_leaf = gui_windows_tree;
}
if ((new_window = (t_gui_window *)(malloc (sizeof (t_gui_window)))))
{
new_window->win_x = x;
new_window->win_y = y;
new_window->win_width = width;
new_window->win_height = height;
new_window->win_width_pct = width_pct;
new_window->win_height_pct = height_pct;
new_window->new_x = -1;
new_window->new_y = -1;
new_window->new_width = -1;
new_window->new_height = -1;
new_window->win_chat_x = 0;
new_window->win_chat_y = 0;
@@ -120,6 +245,9 @@ gui_window_new (int x, int y, int width, int height)
new_window->start_line = NULL;
new_window->start_line_pos = 0;
new_window->ptr_tree = ptr_leaf;
ptr_leaf->window = new_window;
/* add window to windows queue */
new_window->prev_window = last_gui_window;
if (gui_windows)
@@ -1427,6 +1555,8 @@ gui_window_print_log (t_gui_window *window)
wee_log_printf (" win_y . . . . . . . : %d\n", window->win_y);
wee_log_printf (" win_width . . . . . : %d\n", window->win_width);
wee_log_printf (" win_height. . . . . : %d\n", window->win_height);
wee_log_printf (" win_width_pct . . . : %d\n", window->win_width_pct);
wee_log_printf (" win_height_pct. . . : %d\n", window->win_height_pct);
wee_log_printf (" win_chat_x. . . . . : %d\n", window->win_chat_x);
wee_log_printf (" win_chat_y. . . . . : %d\n", window->win_chat_y);
wee_log_printf (" win_chat_width. . . : %d\n", window->win_chat_width);
+33 -8
View File
@@ -164,6 +164,9 @@ enum t_weechat_color
#define gui_printf_nolog_notime(buffer, fmt, argz...) \
gui_printf_internal(buffer, 0, MSG_TYPE_NOLOG, fmt, ##argz)
#define WINDOW_MIN_WIDTH 10
#define WINDOW_MIN_HEIGHT 5
#define NOTIFY_LEVEL_MIN 0
#define NOTIFY_LEVEL_MAX 3
#define NOTIFY_LEVEL_DEFAULT NOTIFY_LEVEL_MAX
@@ -261,6 +264,7 @@ struct t_gui_buffer
t_gui_buffer *next_buffer; /* link to next buffer */
};
typedef struct t_gui_window_tree t_gui_window_tree;
typedef struct t_gui_window t_gui_window;
struct t_gui_window
@@ -268,6 +272,11 @@ struct t_gui_window
/* global position & size */
int win_x, win_y; /* position of window */
int win_width, win_height; /* window geometry */
int win_width_pct; /* % of width (compared to term size) */
int win_height_pct; /* % of height (compared to term size) */
int new_x, new_y; /* used for computing new position */
int new_width, new_height; /* used for computing new size */
/* chat window settings */
int win_chat_x, win_chat_y; /* chat window position */
@@ -320,10 +329,26 @@ struct t_gui_window
t_gui_line *start_line; /* pointer to line if scrolling */
int start_line_pos; /* position in first line displayed */
t_gui_window_tree *ptr_tree; /* pointer to leaf in windows tree */
t_gui_window *prev_window; /* link to previous window */
t_gui_window *next_window; /* link to next window */
};
struct t_gui_window_tree
{
t_gui_window_tree *parent_node; /* pointer to parent node */
/* node info */
int split_horiz; /* 1 if horizontal, 0 if vertical */
int split_pct; /* % of split size (represents child1) */
t_gui_window_tree *child1; /* first child, NULL if a leaf */
t_gui_window_tree *child2; /* second child, NULL if a leaf */
/* leaf info */
t_gui_window *window; /* pointer to window, NULL if a node */
};
typedef struct t_gui_key t_gui_key;
struct t_gui_key
@@ -353,6 +378,7 @@ extern int gui_add_hotlist;
extern t_gui_window *gui_windows;
extern t_gui_window *last_gui_window;
extern t_gui_window *gui_current_window;
extern t_gui_window_tree *gui_windows_tree;
extern t_gui_buffer *gui_buffers;
extern t_gui_buffer *last_gui_buffer;
extern t_gui_buffer *buffer_before_dcc;
@@ -369,7 +395,10 @@ extern t_gui_color *gui_color[NUM_COLORS];
/* GUI independent functions: windows & buffers */
extern t_gui_window *gui_window_new (int, int, int, int);
extern int gui_window_tree_init (t_gui_window *);
extern void gui_window_tree_node_to_leaf (t_gui_window_tree *, t_gui_window *);
extern void gui_window_tree_free (t_gui_window_tree **);
extern t_gui_window *gui_window_new (t_gui_window *, int, int, int, int, int, int);
extern t_gui_buffer *gui_buffer_new (t_gui_window *, void *, void *, int, int);
extern void gui_buffer_clear (t_gui_buffer *);
extern void gui_buffer_clear_all ();
@@ -480,13 +509,9 @@ extern void gui_window_nick_end (t_gui_window *);
extern void gui_window_nick_page_up (t_gui_window *);
extern void gui_window_nick_page_down (t_gui_window *);
extern void gui_window_init_subwindows (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *);
extern void gui_window_split_vertic (t_gui_window *);
extern int gui_window_merge_up (t_gui_window *);
extern int gui_window_merge_down (t_gui_window *);
extern int gui_window_merge_left (t_gui_window *);
extern int gui_window_merge_right (t_gui_window *);
extern void gui_window_merge_auto (t_gui_window *);
extern void gui_window_split_horiz (t_gui_window *, int);
extern void gui_window_split_vertic (t_gui_window *, int);
extern int gui_window_merge (t_gui_window *);
extern void gui_window_merge_all (t_gui_window *);
extern void gui_refresh_screen ();
extern void gui_pre_init (int *, char **[]);