@ -494,7 +494,6 @@ class Interface(object):
def _clear_text ( self , widget ) :
""" Clear the text field. """
self . _delete_info = None
self . _clear_reply ( )
self . _update_field . hide ( )
@ -537,9 +536,10 @@ class Interface(object):
def _delete_message ( self , widget , user_data = None ) :
""" Delete a message. """
( grid , counter ) = self . _grids [ self . _main_tabs . get_current_page ( ) ]
( model , iter ) = grid . get_selection ( ) . get_selected ( )
message = model . get_value ( iter , 0 )
page = self . _main_tabs . get_current_page ( )
message = self . _main_tabs . get_nth_page ( page ) . selected
if not message :
return
confirm = gtk . MessageDialog ( parent = self . _main_window ,
type = gtk . MESSAGE_QUESTION ,
@ -554,7 +554,6 @@ class Interface(object):
return False
self . _update_statusbar ( _ ( ' Deleting message... ' ) )
self . _delete_info = ( grid , iter )
_log . debug ( ' Deleting messing %d ' , message . id )
self . _threads . add_work ( self . _post_delete_message ,
self . _exception_delete_message ,
@ -857,13 +856,11 @@ class Interface(object):
return
### Results for the delete message call
def _post_delete_message ( self , widget , data ) :
def _post_delete_message ( self , widget , message ) :
""" Called when the message is deleted successfully. """
_log . debug ( ' Message deleted. ' )
if self . _delete_info :
( grid , iter ) = self . _delete_info
grid . get_model ( ) . remove ( iter )
self . _delete_info = None
# any grid can take care of deleting the message
MessageGrid . delete ( message )
self . _update_statusbar ( _ ( ' Message deleted. ' ) )
return
@ -895,18 +892,14 @@ class Interface(object):
return
### Results from the favorite call
def _post_favorite_message ( self , widget , data ) :
def _post_favorite_message ( self , widget , status ) :
""" Called when the message was favorited successfully. """
_log . debug ( ' Favorite status changed. ' )
( grid , iter ) = self . _favorite_info
message = grid . get_model ( ) . get_value ( iter , 0 )
if message . favorite :
display = _ ( ' Message unfavorited. ' )
else :
if status :
display = _ ( ' Message favorited. ' )
else :
display = _ ( ' Message unfavorited. ' )
self . _update_statusbar ( display )
message . favorite = not message . favorite
self . _favorite_info = None
return
def _exception_favorite_message ( self , widget , exception ) :
@ -957,9 +950,7 @@ class Interface(object):
# This is the ugly bit for speeding up things and making
# interthread communication.
self . _delete_info = None
self . _reply_message_id = None
self . _favorite_info = None
return
@ -1103,4 +1094,4 @@ class Interface(object):
' protected/private. ' ,
metavar = ' CHAR ' ,
default = _ ( ' <small>(protected)</small> ' ) ,
is_cmd_option = False )
is_cmd_option = False )