Add type of buffers, add signals "_buffer_type_changed" and "_buffer_unmerged"

This commit is contained in:
Sebastien Helleu 2011-12-25 11:49:54 +01:00
parent 54bcac1f1b
commit 9793665389
2 changed files with 4 additions and 2 deletions

View file

@ -29,7 +29,7 @@ QtCore = qt_compat.import_module('QtCore')
QtNetwork = qt_compat.import_module('QtNetwork') QtNetwork = qt_compat.import_module('QtNetwork')
_PROTO_INIT_CMDS = ['init password=%(password)s,compression=gzip', _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', '(listlines) hdata buffer:gui_buffers(*)/own_lines/first_line(*)/data date,displayed,prefix,message',
'(nicklist) nicklist', '(nicklist) nicklist',
'sync', 'sync',

View file

@ -303,7 +303,9 @@ class MainWindow(QtGui.QMainWindow):
index = [i for i, b in enumerate(self.buffers) if b.pointer() == item['__path'][0]] index = [i for i, b in enumerate(self.buffers) if b.pointer() == item['__path'][0]]
if index: if index:
index = index[0] 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 = self.buffers[index]
buf.data['number'] = item['number'] buf.data['number'] = item['number']
self.remove_buffer(index) self.remove_buffer(index)