Changeset 7841 for branches/gajim_0.11/src/dialogs.py
- Timestamp:
- 01/15/07 19:51:27 (23 months ago)
- Files:
-
- 1 modified
-
branches/gajim_0.11/src/dialogs.py (modified) (44 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/gajim_0.11/src/dialogs.py
r7829 r7841 215 215 column.pack_start(renderer) 216 216 column.set_attributes(renderer, text = 0) 217 217 218 218 column = gtk.TreeViewColumn(_('In the group')) 219 219 column.set_expand(False) … … 320 320 title_text = _('Status Message') 321 321 self.window.set_title(title_text) 322 322 323 323 message_textview = self.xml.get_widget('message_textview') 324 324 self.message_buffer = message_textview.get_buffer() … … 332 332 msg = helpers.from_one_line(msg) 333 333 self.message_buffer.set_text(msg) 334 334 335 335 # have an empty string selectable, so user can clear msg 336 336 self.preset_messages_dict = {'': ''} … … 340 340 self.preset_messages_dict[msg_name] = msg_text 341 341 sorted_keys_list = helpers.get_sorted_keys(self.preset_messages_dict) 342 342 343 343 self.message_liststore = gtk.ListStore(str) # msg_name 344 344 self.message_combobox = self.xml.get_widget('message_combobox') … … 375 375 name = model[active][0].decode('utf-8') 376 376 self.message_buffer.set_text(self.preset_messages_dict[name]) 377 377 378 378 def on_change_status_message_dialog_key_press_event(self, widget, event): 379 379 if event.keyval == gtk.keysyms.Return or \ … … 388 388 else: 389 389 btn.set_sensitive(True) 390 390 391 391 def on_save_as_preset_button_clicked(self, widget): 392 392 start_iter, finish_iter = self.message_buffer.get_bounds() … … 404 404 msg_name = msg_name.decode('utf-8') 405 405 iter_ = self.message_liststore.append((msg_name,)) 406 406 407 407 gajim.config.add_per('statusmsg', msg_name) 408 408 gajim.config.set_per('statusmsg', msg_name, 'message', msg_text_1l) … … 602 602 'utf-8') 603 603 jid = jid.replace('@', '%') + '@' + transport 604 604 605 605 # check if jid is conform to RFC and stringprep it 606 606 try: … … 727 727 text = open(copying_file_path).read() 728 728 dlg.set_license(text) 729 729 730 730 dlg.set_comments('%s\n%s %s\n%s %s' 731 731 % (_('A GTK+ jabber client'), \ … … 750 750 elif author != '': # Real author line 751 751 authors.append(author) 752 752 753 753 thanks_file_path = None 754 754 if os.path.isfile(os.path.join(gajim.defs.docdir, 'THANKS')): … … 758 758 if thanks_file_path: 759 759 authors.append('\n' + _('THANKS:')) 760 760 761 761 text = open(thanks_file_path).read() 762 762 text_splitted = text.split('\n') … … 766 766 'the package maintainers.') 767 767 authors.append(text) 768 768 769 769 dlg.set_authors(authors) 770 770 771 771 if gtk.pygtk_version >= (2, 8, 0) and gtk.gtk_version >= (2, 8, 0): 772 772 dlg.props.wrap_license = True … … 778 778 #here you write your name in the form Name FamilyName <someone@somewhere> 779 779 dlg.set_translator_credits(_('translator-credits')) 780 780 781 781 artists = ['Anders Ström', 'Christophe Got', 'Dennis Craven', 782 782 'Guillaume Morin', 'Josef Vybíral', 'Membris Khan'] … … 785 785 rep = dlg.run() 786 786 dlg.destroy() 787 787 788 788 def tuple2str(self, tuple_): 789 789 str_ = '' … … 901 901 else: 902 902 self.just_destroy(dialog) 903 903 904 904 def just_destroy(self, widget): 905 905 self.destroy() … … 1019 1019 self.input_entry.set_text(input_str) 1020 1020 self.input_entry.select_region(0, -1) # select all 1021 1021 1022 1022 self.is_modal = is_modal 1023 1023 if not is_modal and ok_handler is not None: … … 1041 1041 else: 1042 1042 self.ok_handler(user_input) 1043 1043 1044 1044 def on_cancelbutton_clicked(self, widget): 1045 1045 self.dialog.destroy() … … 1076 1076 def on_close_button_clicked(self, widget): 1077 1077 self.window.destroy() 1078 1078 1079 1079 def on_authorize_button_clicked(self, widget): 1080 1080 '''accept the request''' … … 1097 1097 gajim.interface.instances[self.account]['infos'][self.jid].xml.\ 1098 1098 get_widget('information_notebook').remove_page(0) 1099 1099 1100 1100 def on_start_chat_activate(self, widget): 1101 1101 '''open chat''' … … 1139 1139 self._room_jid_entry = self.xml.get_widget('room_jid_entry') 1140 1140 self._nickname_entry = self.xml.get_widget('nickname_entry') 1141 1141 1142 1142 self._room_jid_entry.set_text(room_jid) 1143 1143 self._nickname_entry.set_text(nick) … … 1264 1264 def __init__(self, account): 1265 1265 self.account = account 1266 1266 1267 1267 if len(gajim.connections) > 1: 1268 1268 title = _('Start Chat with account %s') % account … … 1271 1271 prompt_text = _('Fill in the nickname or the Jabber ID of the contact you would like\nto send a chat message to:') 1272 1272 InputDialog.__init__(self, title, prompt_text, is_modal = False) 1273 1273 1274 1274 self.completion_dict = {} 1275 1275 liststore = gtkgui_helpers.get_completion_liststore(self.input_entry) … … 1289 1289 cancelbutton.connect('clicked', self.on_cancelbutton_clicked) 1290 1290 self.dialog.show_all() 1291 1291 1292 1292 def new_chat_response(self, jid): 1293 1293 ''' called when ok button is clicked ''' … … 1407 1407 event_description_label.set_markup( 1408 1408 '<span foreground="black">%s</span>' % text) 1409 1409 1410 1410 # set the image 1411 1411 image.set_from_file(path_to_image) 1412 1412 1413 1413 # position the window to bottom-right of screen 1414 1414 window_width, self.window_height = self.window.get_size() … … 1441 1441 # we want to remove the first window added in the list 1442 1442 gajim.interface.roster.popup_notification_windows.pop(0) # remove 1st item 1443 1443 1444 1444 # move the rest of popup windows 1445 1445 gajim.interface.roster.popups_notification_height = 0 … … 1472 1472 self.from_whom = from_whom 1473 1473 self.resource = resource 1474 1474 1475 1475 self.xml = gtkgui_helpers.get_glade('single_message_window.glade') 1476 1476 self.window = self.xml.get_widget('single_message_window') … … 1505 1505 else: 1506 1506 self.to_entry.set_text(to) 1507 1507 1508 1508 if gajim.config.get('use_speller') and HAS_GTK_SPELL and action == 'send': 1509 1509 try: … … 1517 1517 ErrorDialog(unicode(msg), _('If that is not your language for which you want to highlight misspelled words, then please set your $LANG as appropriate. Eg. for French do export LANG=fr_FR or export LANG=fr_FR.UTF-8 in ~/.bash_profile or to make it global in /etc/profile.\n\nHighlighting misspelled words feature will not be used')) 1518 1518 gajim.config.set('use_speller', False) 1519 1519 1520 1520 self.send_button.set_no_show_all(True) 1521 1521 self.reply_button.set_no_show_all(True) … … 1529 1529 self.message_scrolledwindow.set_no_show_all(True) 1530 1530 self.conversation_scrolledwindow.set_no_show_all(True) 1531 1531 1532 1532 self.prepare_widgets_for(self.action) 1533 1533 … … 1600 1600 self.conversation_scrolledwindow.hide() 1601 1601 self.message_scrolledwindow.show() 1602 1602 1603 1603 if self.message: # we come from a reply? 1604 1604 self.message_textview.grab_focus() … … 1611 1611 if self.to: # do we already have jid? 1612 1612 self.subject_entry.grab_focus() 1613 1613 1614 1614 elif action == 'receive': # prepare UI for Receiving 1615 1615 title = _('Received %s') % title … … 1635 1635 self.cancel_button.hide() 1636 1636 self.close_button.show() 1637 1637 1638 1638 self.window.set_title(title) 1639 1639 … … 1649 1649 characters_no = self.message_tv_buffer.get_char_count() 1650 1650 self.count_chars_label.set_text(unicode(characters_no)) 1651 1651 1652 1652 def send_single_message(self): 1653 1653 if gajim.connections[self.account].connected <= 1: … … 1676 1676 gajim.connections[self.account].send_message(to_whom_jid, message, 1677 1677 keyID = None, type = 'normal', subject=subject) 1678 1678 1679 1679 self.subject_entry.set_text('') # we sent ok, clear the subject 1680 1680 self.message_tv_buffer.set_text('') # we sent ok, clear the textview … … 1707 1707 def __init__(self, account): 1708 1708 self.account = account 1709 1709 1710 1710 self.xml = gtkgui_helpers.get_glade('xml_console_window.glade') 1711 1711 self.window = self.xml.get_widget('xml_console_window') … … 1716 1716 end_iter = buffer.get_end_iter() 1717 1717 buffer.create_mark('end', end_iter, False) 1718 1718 1719 1719 self.tagIn = buffer.create_tag('incoming') 1720 1720 color = gajim.config.get('inmsgcolor') … … 1728 1728 self.input_textview.modify_text( 1729 1729 gtk.STATE_NORMAL, gtk.gdk.color_parse(color)) 1730 1730 1731 1731 if len(gajim.connections) > 1: 1732 1732 title = _('XML Console for %s') % self.account 1733 1733 else: 1734 1734 title = _('XML Console') 1735 1735 1736 1736 self.window.set_title(title) 1737 1737 self.window.show_all() 1738 1738 1739 1739 self.xml.signal_autoconnect(self) 1740 1740 … … 1792 1792 gajim.connections[self.account].send_stanza(stanza) 1793 1793 self.input_tv_buffer.set_text('') # we sent ok, clear the textview 1794 1794 1795 1795 def on_presence_button_clicked(self, widget): 1796 1796 self.input_tv_buffer.set_text( … … 1802 1802 '<iq to="" type=""><query xmlns=""></query></iq>' 1803 1803 ) 1804 1804 1805 1805 def on_message_button_clicked(self, widget): 1806 1806 self.input_tv_buffer.set_text( … … 2188 2188 self.list_of_privacy_lists_combobox.get_active()] 2189 2189 gajim.connections[self.account].del_privacy_list(active_list) 2190 2190 2191 2191 def privacy_list_removed(self, active_list): 2192 2192 self.privacy_lists_save.remove(active_list) … … 2241 2241 self.dialog = xml.get_widget('invitation_received_dialog') 2242 2242 2243 #FIXME: use nickname instead of contact_jid 2244 pritext = _('%(contact_jid)s has invited you to group chat %(room_jid)s')\ 2245 % {'room_jid': room_jid, 'contact_jid': contact_jid } 2246 2243 #Don't translate $Contact 2244 pritext = _('$Contact has invited you to group chat %(room_jid)s')\ 2245 % {'room_jid': room_jid} 2246 contact = gajim.contacts.get_first_contact_from_jid(account, contact_jid) 2247 if contact and contact.name: 2248 contact_text = '%s (%s)' % (contact.name, contact_jid) 2249 else: 2250 contact_text = contact_jid 2251 pritext = pritext.replace('$Contact', contact_text) 2252 2247 2253 label_text = '<big><b>%s</b></big>' % pritext 2248 2254 … … 2258 2264 self.on_accept_button_clicked) 2259 2265 self.dialog.show_all() 2260 2266 2261 2267 def on_deny_button_clicked(self, widget): 2262 2268 self.dialog.destroy() 2263 2269 2264 2270 def on_accept_button_clicked(self, widget): 2265 2271 self.dialog.destroy() … … 2268 2274 except GajimGeneralException: 2269 2275 pass 2270 2276 2271 2277 class ProgressDialog: 2272 2278 def __init__(self, title_text, during_text, messages_queue): … … 2283 2289 self.dialog.show_all() 2284 2290 self.xml.signal_autoconnect(self) 2285 2291 2286 2292 self.update_progressbar_timeout_id = gobject.timeout_add(100, 2287 2293 self.update_progressbar)
