Changeset 8888
- Timestamp:
- 10/07/07 19:22:47 (14 months ago)
- Location:
- trunk/src
- Files:
-
- 7 modified
-
config.py (modified) (5 diffs)
-
dialogs.py (modified) (2 diffs)
-
filetransfers_window.py (modified) (2 diffs)
-
groupchat_control.py (modified) (2 diffs)
-
gtkgui_helpers.py (modified) (2 diffs)
-
history_manager.py (modified) (4 diffs)
-
roster_window.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/config.py
r8737 r8888 1646 1646 break 1647 1647 # Detect if we have opened windows for this account 1648 self.dialog = None 1649 def remove(widget, account): 1650 if self.dialog: 1651 self.dialog.destroy() 1648 def remove(account): 1652 1649 if gajim.interface.instances[account].has_key('remove_account'): 1653 1650 gajim.interface.instances[account]['remove_account'].window.\ … … 1657 1654 RemoveAccountWindow(account) 1658 1655 if win_opened: 1659 self.dialog = dialogs.ConfirmationDialog(1656 dialog = dialogs.ConfirmationDialog( 1660 1657 _('You have opened chat in account %s') % account, 1661 1658 _('All chat and groupchat windows will be closed. Do you want to ' … … 1663 1660 on_response_ok = (remove, account)) 1664 1661 else: 1665 remove( widget,account)1662 remove(account) 1666 1663 1667 1664 def on_rename_button_clicked(self, widget): … … 2525 2522 2526 2523 def on_remove_button_clicked(self, widget): 2527 def remove(widget): 2528 if self.dialog: 2529 self.dialog.destroy() 2524 def remove(): 2530 2525 if gajim.connections[self.account].connected and \ 2531 2526 not self.remove_and_unregister_radiobutton.get_active(): … … 2550 2545 self._on_remove_success(True) 2551 2546 2552 self.dialog = None2553 2547 if gajim.connections[self.account].connected: 2554 self.dialog = dialogs.ConfirmationDialog(2548 dialog = dialogs.ConfirmationDialog( 2555 2549 _('Account "%s" is connected to the server') % self.account, 2556 2550 _('If you remove it, the connection will be lost.'), 2557 2551 on_response_ok = remove) 2558 2552 else: 2559 remove( None)2553 remove() 2560 2554 2561 2555 def _on_remove_success(self, res): -
trunk/src/dialogs.py
r8882 r8888 1017 1017 def __init__(self, pritext, sectext='', on_response_ok = None, 1018 1018 on_response_cancel = None): 1019 self.user_response_ok = on_response_ok 1020 self.user_response_cancel = on_response_cancel 1019 1021 HigDialog.__init__(self, None, 1020 1022 gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, pritext, sectext, 1021 on_response_ok,on_response_cancel)1023 self.on_response_ok, self.on_response_cancel) 1022 1024 self.popup() 1025 1026 def on_response_ok(self, widget): 1027 if self.user_response_ok: 1028 if isinstance(self.user_response_ok, tuple): 1029 self.user_response_ok[0](*self.user_response_ok[1:]) 1030 else: 1031 self.user_response_ok() 1032 self.destroy() 1033 1034 def on_response_cancel(self, widget): 1035 if self.user_response_cancel: 1036 if isinstance(self.user_response_cancel, tuple): 1037 self.user_response_cancel[0](*self.user_response_ok[1:]) 1038 else: 1039 self.user_response_cancel() 1040 self.destroy() 1023 1041 1024 1042 class NonModalConfirmationDialog(HigDialog): … … 1026 1044 def __init__(self, pritext, sectext='', on_response_ok = None, 1027 1045 on_response_cancel = None): 1046 self.user_response_ok = on_response_ok 1047 self.user_response_cancel = on_response_cancel 1028 1048 HigDialog.__init__(self, None, 1029 1049 gtk.MESSAGE_QUESTION, gtk.BUTTONS_OK_CANCEL, pritext, sectext, 1030 on_response_ok,on_response_cancel)1050 self.on_response_ok, self.on_response_cancel) 1031 1051 self.set_modal(False) 1052 1053 def on_response_ok(self, widget): 1054 if self.user_response_ok: 1055 if isinstance(self.user_response_ok, tuple): 1056 self.user_response_ok[0](*self.user_response_ok[1:]) 1057 else: 1058 self.user_response_ok() 1059 self.destroy() 1060 1061 def on_response_cancel(self, widget): 1062 if self.user_response_cancel: 1063 if isinstance(self.user_response_cancel, tuple): 1064 self.user_response_cancel[0](*self.user_response_ok[1:]) 1065 else: 1066 self.user_response_cancel() 1067 self.destroy() 1032 1068 1033 1069 class WarningDialog(HigDialog): -
trunk/src/filetransfers_window.py
r8571 r8888 295 295 dialog, dialog2 = None, None 296 296 297 def on_response_ok(widget, account, contact, file_props): 298 dialog.destroy() 297 def on_response_ok(account, contact, file_props): 299 298 300 299 def on_ok(widget, account, contact, file_props): … … 349 348 on_cancel(widget, account, contact, file_props)) 350 349 351 def on_response_cancel(widget, account, file_props): 352 dialog.destroy() 350 def on_response_cancel(account, file_props): 353 351 gajim.connections[account].send_file_rejection(file_props) 354 352 -
trunk/src/groupchat_control.py
r8882 r8888 851 851 def on_send_file(self, widget, gc_contact): 852 852 '''sends a file to a contact in the room''' 853 def _on_send_files(widget, gc_c): 854 if widget: 855 widget.destroy() 853 def _on_send_files(gc_c): 856 854 gajim.interface.instances['file_transfers'].show_file_send_request( 857 855 self.account, gc_c) … … 866 864 dialog.popup() 867 865 else: 868 _on_send_files( None,gc_contact)866 _on_send_files(gc_contact) 869 867 870 868 def draw_contact(self, nick, selected=False, focus=False): -
trunk/src/gtkgui_helpers.py
r8882 r8888 751 751 default_name = ''): 752 752 def on_ok(widget): 753 def on_ok2( widget,file_path, pixbuf):753 def on_ok2(file_path, pixbuf): 754 754 pixbuf.save(file_path, 'jpeg') 755 dialog2.destroy()756 755 dialog.destroy() 757 756 … … 807 806 os.remove(file_path) 808 807 new_file_path = '.'.join(file_path.split('.')[:-1]) + '.jpeg' 809 dialog 2 = dialogs.ConfirmationDialog(_('Extension not supported'),808 dialogs.ConfirmationDialog(_('Extension not supported'), 810 809 _('Image cannot be saved in %(type)s format. Save as %(new_filename)s?') % {'type': type_, 'new_filename': new_file_path}, 811 810 on_response_ok = (on_ok2, new_file_path, pixbuf)) -
trunk/src/history_manager.py
r8509 r8888 482 482 return 483 483 484 def on_ok( widget,liststore, list_of_paths):484 def on_ok(liststore, list_of_paths): 485 485 # delete all rows from db that match jid_id 486 self.dialog.destroy()487 486 list_of_rowrefs = [] 488 487 for path in list_of_paths: # make them treerowrefs (it's needed) … … 515 514 'Do you really want to delete logs of the selected contacts?', 516 515 paths_len) 517 self.dialog =dialogs.ConfirmationDialog(pri_text,516 dialogs.ConfirmationDialog(pri_text, 518 517 _('This is an irreversible operation.'), on_response_ok = (on_ok, 519 518 liststore, list_of_paths)) … … 524 523 return 525 524 526 def on_ok(widget, liststore, list_of_paths): 527 self.dialog.destroy() 525 def on_ok(liststore, list_of_paths): 528 526 # delete rows from db that match log_line_id 529 527 list_of_rowrefs = [] … … 551 549 'Do you really want to delete the selected message?', 552 550 'Do you really want to delete the selected messages?', paths_len) 553 self.dialog =dialogs.ConfirmationDialog(pri_text,551 dialogs.ConfirmationDialog(pri_text, 554 552 _('This is an irreversible operation.'), on_response_ok = (on_ok, 555 553 liststore, list_of_paths)) -
trunk/src/roster_window.py
r8882 r8888 1525 1525 return 1526 1526 1527 def remove(widget, list_): 1528 self.dialog.destroy() 1527 def remove(list_): 1529 1528 for (contact, account) in list_: 1530 1529 full_jid = contact.get_full_jid() … … 1558 1557 sectext = _('You will no longer be able to send and receive messages ' 1559 1558 'to contacts from these transports:%s') % jids 1560 self.dialog =dialogs.ConfirmationDialog(pritext, sectext,1559 dialogs.ConfirmationDialog(pritext, sectext, 1561 1560 on_response_ok = (remove, list_)) 1562 1561 … … 3346 3345 gajim.events.remove_events(account, contact.jid) 3347 3346 self.readd_if_needed(contact, account) 3347 3348 def on_ok2(list_): 3349 on_ok(False, list_) 3350 3348 3351 if len(list_) == 1: 3349 3352 contact = list_[0][0] … … 3352 3355 contact.get_shown_name() 3353 3356 if contact.sub == 'to': 3354 self.dialog =dialogs.ConfirmationDialog(pritext,3357 dialogs.ConfirmationDialog(pritext, 3355 3358 _('By removing this contact you also remove authorization ' 3356 3359 'resulting in him or her always seeing you as offline.'), 3357 on_response_ok = (on_ok , list_))3360 on_response_ok = (on_ok2, list_)) 3358 3361 else: 3359 self.dialog =dialogs.ConfirmationDialogCheck(pritext,3362 dialogs.ConfirmationDialogCheck(pritext, 3360 3363 _('By removing this contact you also by default remove ' 3361 3364 'authorization resulting in him or her always seeing you as ' … … 3372 3375 'authorization resulting in them always seeing you as offline.') % \ 3373 3376 jids 3374 self.dialog =dialogs.ConfirmationDialog(pritext, sectext,3377 dialogs.ConfirmationDialog(pritext, sectext, 3375 3378 on_response_ok = (on_ok, list_)) 3376 3379 … … 3531 3534 3532 3535 def change_status(self, widget, account, status): 3533 def change(widget, account, status): 3534 if self.dialog: 3535 self.dialog.destroy() 3536 def change(account, status): 3536 3537 message = self.get_status_message(status) 3537 3538 if message is None: … … 3540 3541 self.send_status(account, status, message) 3541 3542 3542 self.dialog = None3543 3543 if status == 'invisible' and self.connected_rooms(account): 3544 self.dialog =dialogs.ConfirmationDialog(3544 dialogs.ConfirmationDialog( 3545 3545 _('You are participating in one or more group chats'), 3546 3546 _('Changing your status to invisible will result in disconnection ' … … 3548 3548 on_response_ok = (change, account, status)) 3549 3549 else: 3550 change( None,account, status)3550 change(account, status) 3551 3551 3552 3552 def on_send_custom_status(self, widget, contact_list, show, group=None): … … 4937 4937 uri_splitted = uri.split() # we may have more than one file dropped 4938 4938 nb_uri = len(uri_splitted) 4939 def _on_send_files(widget, account, jid, uris): 4940 dialog.destroy() 4939 def _on_send_files(account, jid, uris): 4941 4940 c = gajim.contacts.get_contact_with_highest_priority(account, jid) 4942 4941 for uri in uris: … … 4953 4952 path = helpers.get_file_path_from_dnd_dropped_uri(uri) 4954 4953 sec_text += '\n' + os.path.basename(path) 4955 dialog = dialogs.NonModalConfirmationDialog(prim_text, sec_text,4954 dialogs.NonModalConfirmationDialog(prim_text, sec_text, 4956 4955 on_response_ok = (_on_send_files, account_dest, jid_dest, 4957 4956 uri_splitted))
