From 9793665389c0be8b8d266e73d8aeb90dd925ea65 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 25 Dec 2011 11:49:54 +0100 Subject: [PATCH] Add type of buffers, add signals "_buffer_type_changed" and "_buffer_unmerged" --- src/qweechat/network.py | 2 +- src/qweechat/qweechat.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qweechat/network.py b/src/qweechat/network.py index 43d8c84..55f01d9 100644 --- a/src/qweechat/network.py +++ b/src/qweechat/network.py @@ -29,7 +29,7 @@ QtCore = qt_compat.import_module('QtCore') QtNetwork = qt_compat.import_module('QtNetwork') _PROTO_INIT_CMDS = ['init password=%(password)s,compression=gzip', - '(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,nicklist,title,local_variables', + '(listbuffers) hdata buffer:gui_buffers(*) number,full_name,short_name,type,nicklist,title,local_variables', '(listlines) hdata buffer:gui_buffers(*)/own_lines/first_line(*)/data date,displayed,prefix,message', '(nicklist) nicklist', 'sync', diff --git a/src/qweechat/qweechat.py b/src/qweechat/qweechat.py index bf3c146..e40346d 100755 --- a/src/qweechat/qweechat.py +++ b/src/qweechat/qweechat.py @@ -303,7 +303,9 @@ class MainWindow(QtGui.QMainWindow): index = [i for i, b in enumerate(self.buffers) if b.pointer() == item['__path'][0]] if index: index = index[0] - if message.msgid in ('_buffer_moved', '_buffer_merged'): + if message.msgid == '_buffer_type_changed': + self.buffers[index].data['type'] = item['type'] + elif message.msgid in ('_buffer_moved', '_buffer_merged', '_buffer_unmerged'): buf = self.buffers[index] buf.data['number'] = item['number'] self.remove_buffer(index)