warning dialog should work now? introducing some other classes for dialogs too

This commit is contained in:
Nikos Kouremenos 2005-03-03 15:27:37 +00:00
parent 0bc4a5cfb0
commit c8c69049be
3 changed files with 46 additions and 7 deletions

View File

@ -490,12 +490,32 @@ class confirm_dialog:
class warning_dialog:
"""Class for warning dialog"""
def __init__(self, label):
self.dialog = gtk.MessageDialog(None,\
dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, label)
response = self.dialog.run()
self.dialog.destroy()
dialog.run()
dialog.destroy()
class information_dialog:
"""Class for information dialog"""
def __init__(self, label):
dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_INFO, gtk.BUTTONS_CLOSE, label)
dialog.run()
dialog.destroy()
class error_dialog:
"""Class for error dialog"""
def __init__(self, label):
dialog = gtk.MessageDialog(None,\
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,\
gtk.MESSAGE_ERROR, gtk.BUTTONS_CLOSE, label)
dialog.run()
dialog.destroy()
class subscription_request_window:
"""Class for authorization window :

View File

@ -8403,4 +8403,23 @@ send a chat message to</property>
</child>
</widget>
<widget class="GtkWindow" id="edit_groups_window">
<property name="visible">True</property>
<property name="title" translatable="yes">Edit Groups</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<placeholder/>
</child>
</widget>
</glade-interface>

View File

@ -1656,7 +1656,7 @@ class roster_window:
return
accounts = self.plugin.accounts.keys()
if len(accounts) == 0:
warning_dialog(_("You must setup an account before connecting to jabber network."))
error_dialog(_("You must setup an account before connecting to jabber network."))
self.set_cb()
return
status = model[active][0]
@ -2590,10 +2590,10 @@ class plugin:
'online', 'to', '', array[1], 0, '')
self.roster.contacts[account][jid] = [user1]
self.roster.add_user_to_roster(jid, account)
warning_dialog(_("You are now authorized by %s") % jid)
information_dialog(_("You are now authorized by %s") % jid)
def handle_event_unsubscribed(self, account, jid):
warning_dialog(_("You are now unsubscribed by %s") % jid)
information_dialog(_("You are now unsubscribed by %s") % jid)
def handle_event_agents(self, account, agents):
#('AGENTS', account, agents)
@ -2609,7 +2609,7 @@ class plugin:
def handle_event_reg_agent_info(self, account, array):
#('REG_AGENTS_INFO', account, (agent, infos))
if not array[1].has_key('instructions'):
warning_dialog(_("error contacting %s") % array[0])
error_dialog(_("error contacting %s") % array[0])
else:
agent_registration_window(array[0], array[1], self, account)