don't change status when we close the awayMessage window

This commit is contained in:
Yann Leboulanger 2004-05-02 15:20:42 +00:00
parent 609ab74902
commit 2ab2f09e0e
1 changed files with 9 additions and 3 deletions

View File

@ -504,10 +504,11 @@ class awayMsg_Window:
def run(self):
"""Wait for Ok button to be pressed and return away messsage"""
rep = self.xml.get_widget("Away_msg").run()
msg = ''
if rep == gtk.RESPONSE_OK:
beg, end = self.txtBuffer.get_bounds()
msg = self.txtBuffer.get_text(beg, end, 0)
else:
msg = -1
self.xml.get_widget("Away_msg").destroy()
return msg
@ -1598,6 +1599,8 @@ class roster_Window:
if status != 'online' and status != 'offline':
w = awayMsg_Window()
txt = w.run()
if txt != -1:
self.plugin.send('STATUS', account, (status, txt))
else:
txt = status
self.plugin.send('STATUS', account, (status, txt))
@ -1610,6 +1613,9 @@ class roster_Window:
if status != 'online' and status != 'offline':
w = awayMsg_Window()
txt = w.run()
if txt == -1:
self.set_optionmenu()
return
else:
txt = status
accounts = self.plugin.accounts.keys()