Skip to content
This repository has been archived by the owner on Feb 2, 2020. It is now read-only.

Commit

Permalink
Added more descriptive title (showing columns) for listbuffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
FiXato committed Sep 8, 2011
1 parent a2be8ee commit b5ac8c2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions listbuffer.py
Expand Up @@ -120,7 +120,13 @@ def lb_create_buffer():
# Sets notify to 0 as this buffer does not need to be in hotlist.
lb_buffer = weechat.buffer_new("listbuffer", "lb_input_cb", \
"", "lb_close_cb", "")
weechat.buffer_set(lb_buffer, "title", "/LIST buffer")
weechat.buffer_set(lb_buffer, "title", lb_line_format({
'channel': 'Channel name',
'users': 'Users',
'modes': 'Modes',
'topic': 'Topic',
'nomodes': None,
}))
weechat.buffer_set(lb_buffer, "notify", "0")
weechat.buffer_set(lb_buffer, "nicklist", "0")
weechat.buffer_set(lb_buffer, "type", "free")
Expand Down Expand Up @@ -225,7 +231,7 @@ def lb_line_format(list_data,curr=False):
str = ""
if (curr):
str += weechat.color("yellow,red")
str += "%s%25s %6s " % (weechat.color("bold"), list_data['channel'], "(%s)" % list_data['users'])
str += "%s%25s %7s " % (weechat.color("bold"), list_data['channel'], "(%s)" % list_data['users'])
if not list_data['nomodes']:
str += "%10s: " % ("[%s]" % list_data['modes'])
str += "%s" % list_data['topic']
Expand Down Expand Up @@ -307,7 +313,6 @@ def lb_sort_next():
if len(lb_sort_options) <= new_index:
new_index = 0

print new_index
lb_current_sort = lb_sort_options[new_index]
lb_sort()

Expand All @@ -321,7 +326,6 @@ def lb_sort_previous():
if new_index < 0:
new_index = len(lb_sort_options) - 1

print new_index
lb_current_sort = lb_sort_options[new_index]
lb_sort()

Expand Down

0 comments on commit b5ac8c2

Please sign in to comment.