Changeset 9754 for branches/plugin-system/plugins/length_notifier.py
- Timestamp:
- 06/03/08 15:40:27 (6 months ago)
- Files:
-
- 1 modified
-
branches/plugin-system/plugins/length_notifier.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin-system/plugins/length_notifier.py
r9737 r9754 75 75 d = {'prev_color' : None} 76 76 tv = chat_control.msg_textview 77 b = tv.get_buffer()78 h_id = b.connect('changed', self.textview_length_warning, chat_control)77 tb = tv.get_buffer() 78 h_id = tb.connect('changed', self.textview_length_warning, chat_control) 79 79 d['h_id'] = h_id 80 81 t = tb.get_text(tb.get_start_iter(), tb.get_end_iter()) 82 if t: 83 len_t = len(t) 84 if len_t>self.MESSAGE_WARNING_LENGTH: 85 d['prev_color'] = tv.style.copy().base[gtk.STATE_NORMAL] 86 tv.modify_base(gtk.STATE_NORMAL, self.WARNING_COLOR) 87 80 88 chat_control.length_notifier_plugin_data = d 81 89 … … 87 95 def disconnect_from_chat_control(self, chat_control): 88 96 d = chat_control.length_notifier_plugin_data 89 chat_control.msg_textview.get_buffer().disconnect(d['h_id']) 97 tv = chat_control.msg_textview 98 tv.get_buffer().disconnect(d['h_id']) 90 99 if d['prev_color']: 91 tv.modify_base(gtk.STATE_NORMAL, self.PREV_COLOR)100 tv.modify_base(gtk.STATE_NORMAL, d['prev_color']) 92 101 93 102 @log_calls('LengthNotifierPlugin')
