240
240
def set_group_filters(self, filters ):
241
241
self.filterpage.set_group_filters(filters)
243
def update_textbuffer_insert(self,textbuffer, iter, text, length):
243
def update_textbuffer_insert(self, textbuffer, iter, text, length):
245
#TODO: delete the fucking \n. PS fuck you PYGTK for making this
247
#textbuffer.backspace(iter,True,True) doesn't work
245
248
self.do_submit=True
247
251
def emit_update_textview(self):
248
252
#get the text from the buffer
250
254
end_iter = self.update_textbuffer.get_end_iter()
251
255
text=self.update_textbuffer.get_text(start_iter,end_iter).strip()
257
#disable the textview
258
self.update_textview.set_sensitive(False)
253
259
self.emit('update-status',text)
261
'''function process_update_response
263
@param response the string response returned by the communicator
265
def emit_update_textview_responsed(self, error = False):
254
267
#detach the spellchecker
255
268
self.detach_gtkspell()
256
269
#clear the text area
257
270
self.update_textbuffer.set_text('')
258
271
#reattach the spellchecker
259
272
self.connect_gtkspell()
274
self.update_textview.set_sensitive(True)
276
'''function update_textbuffer_changed
278
@param textbuffer - the textbuffer that called the function
261
280
def update_textbuffer_changed(self,textbuffer):
262
#get the last char of the text buffer
263
281
if self.do_submit:
264
282
self.emit_update_textview()
265
283
self.do_submit=False
285
#we aren't submitting, check the amount of characters
267
286
char_count = textbuffer.get_char_count()
268
287
self.string_update_textview_append_count(140-char_count)
269
288
if (char_count > 140 ):
289
#prune the text to 140 chars
270
290
start_iter = textbuffer.get_iter_at_offset(140)
271
291
end_iter = textbuffer.get_end_iter()
272
292
textbuffer.delete(start_iter,end_iter)
273
293
elif(char_count==0 and not self.is_direct_message_mode):
294
#the text has possibly been deleted, clear associated stuff
274
295
self.emit('clear-respond-to-id')
276
297
def notebook_page_switch(self,nb,page,page_num):