Use only one (up to date) error dialog for aspell dictionary error. See #3165.
This commit is contained in:
		
							parent
							
								
									6022a52681
								
							
						
					
					
						commit
						b10981bd03
					
				
					 3 changed files with 12 additions and 18 deletions
				
			
		| 
						 | 
				
			
			@ -209,14 +209,7 @@ class ChatControlBase(MessageControl):
 | 
			
		|||
					self.msg_textview.lang = lang
 | 
			
		||||
					spell.set_language(lang)
 | 
			
		||||
			except (gobject.GError, RuntimeError), msg:
 | 
			
		||||
				dialogs.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'))
 | 
			
		||||
				gajim.config.set('use_speller', False)
 | 
			
		||||
 | 
			
		||||
				dialogs.AspellDictError(lang)
 | 
			
		||||
		self.style_event_id = 0
 | 
			
		||||
		self.conv_textview.tv.show()
 | 
			
		||||
		self._paint_banner()
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -911,6 +911,15 @@ class BindPortError(HigDialog):
 | 
			
		|||
			_('Maybe you have another running instance of Gajim. '
 | 
			
		||||
			'File Transfer will be cancelled.'))
 | 
			
		||||
 | 
			
		||||
class AspellDictError(HigDialog):
 | 
			
		||||
	def __init__(self, lang):
 | 
			
		||||
		ErrorDialog(
 | 
			
		||||
			_('Dictionary for lang %s not available') % lang,
 | 
			
		||||
			_('You have to install %s dictionary to use spellchecking, or '
 | 
			
		||||
			'choose another language by setting the speller_language option.'
 | 
			
		||||
			'\n\nHighlighting misspelled words feature will not be used') % lang)
 | 
			
		||||
		gajim.config.set('use_speller', False)
 | 
			
		||||
 | 
			
		||||
class ConfirmationDialog(HigDialog):
 | 
			
		||||
	'''HIG compliant confirmation dialog.'''
 | 
			
		||||
	def __init__(self, pritext, sectext='', on_response_ok = None,
 | 
			
		||||
| 
						 | 
				
			
			@ -1705,9 +1714,7 @@ class SingleMessageWindow:
 | 
			
		|||
					spell1.set_language(lang)
 | 
			
		||||
					spell2.set_language(lang)
 | 
			
		||||
			except gobject.GError, msg:
 | 
			
		||||
				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'))
 | 
			
		||||
				gajim.config.set('use_speller', False)
 | 
			
		||||
 | 
			
		||||
				dialogs.AspellDictError(lang)
 | 
			
		||||
		self.send_button.set_no_show_all(True)
 | 
			
		||||
		self.reply_button.set_no_show_all(True)
 | 
			
		||||
		self.send_and_close_button.set_no_show_all(True)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2362,13 +2362,7 @@ class Interface:
 | 
			
		|||
				import gtkspell
 | 
			
		||||
				spell = gtkspell.Spell(tv, lang)
 | 
			
		||||
			except:
 | 
			
		||||
				dialogs.ErrorDialog(
 | 
			
		||||
					_('Dictionary for lang %s not available') % lang,
 | 
			
		||||
					_('You have to install %s dictionary to use spellchecking, or '
 | 
			
		||||
					'choose another language by setting the speller_language option.'
 | 
			
		||||
					) % lang)
 | 
			
		||||
				gajim.config.set('use_speller', False)
 | 
			
		||||
 | 
			
		||||
				dialogs.AspellDictError(lang)
 | 
			
		||||
		self.last_ftwindow_update = 0
 | 
			
		||||
 | 
			
		||||
		gobject.timeout_add(100, self.autoconnect)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue