Skip to content
Snippets Groups Projects
Commit d8e0b91e authored by nkour's avatar nkour
Browse files

Input dialog to accept entry text as optional argument and to display it if...

Input dialog to accept entry text as optional argument and to display it if given [using that in change subject
parent ec5effc6
No related branches found
No related tags found
No related merge requests found
......@@ -419,13 +419,16 @@ class Information_dialog:
class Input_dialog:
'''Class for Input dialog'''
def __init__(self, title, label_str):
def __init__(self, title, label_str, input_str = None):
xml = gtk.glade.XML(GTKGUI_GLADE, 'input_dialog', APP)
self.dialog = xml.get_widget('input_dialog')
label = xml.get_widget('label')
self.input_entry = xml.get_widget('input_entry')
self.dialog.set_title(title)
label.set_text(label_str)
if input_str:
self.input_entry.set_text(input_str)
class Error_dialog:
'''Class for error dialog'''
......
......@@ -82,7 +82,7 @@ class Groupchat_window(chat.Chat):
self.set_subject(jid, var['subject'])
def on_close_window_activate(self, widget):
if self.on_groupchat_window_delete_event(widget, None) != True:
if not self.on_groupchat_window_delete_event(widget, None):
self.window.destroy()
def on_groupchat_window_delete_event(self, widget, event):
......@@ -267,8 +267,9 @@ class Groupchat_window(chat.Chat):
def on_change_subject_menuitem_activate(self, widget):
room_jid = self.get_active_jid()
subject = self.subject_entry[room_jid].get_text()
instance = dialogs.Input_dialog('Changing the Subject',
'Please specify the new subject:')
'Please specify the new subject:', subject)
response = instance.dialog.run()
instance.dialog.destroy()
if response == gtk.RESPONSE_OK:
......@@ -547,7 +548,7 @@ class Groupchat_window(chat.Chat):
self.redraw_tab(room_jid)
self.show_title()
conversation_textview.grab_focus() # remove focus from subject entry
conversation_textview.grab_focus()
def on_list_treeview_button_press_event(self, widget, event):
"""popup user's group's or agent menu"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment