use defs file to look for COPYING, AUTHORS and THANKS files.
This commit is contained in:
		
							parent
							
								
									467bc8dde8
								
							
						
					
					
						commit
						c0ca8027af
					
				
					 2 changed files with 42 additions and 22 deletions
				
			
		|  | @ -25,6 +25,8 @@ import config | ||||||
| from contacts import Contacts | from contacts import Contacts | ||||||
| from events import Events | from events import Events | ||||||
| 
 | 
 | ||||||
|  | import defs | ||||||
|  | 
 | ||||||
| interface = None # The actual interface (the gtk one for the moment) | interface = None # The actual interface (the gtk one for the moment) | ||||||
| config = config.Config() | config = config.Config() | ||||||
| version = config.get('version') | version = config.get('version') | ||||||
|  |  | ||||||
|  | @ -713,8 +713,14 @@ class AboutDialog: | ||||||
| 		dlg.set_version(gajim.version) | 		dlg.set_version(gajim.version) | ||||||
| 		s = u'Copyright © 2003-2006 Gajim Team' | 		s = u'Copyright © 2003-2006 Gajim Team' | ||||||
| 		dlg.set_copyright(s) | 		dlg.set_copyright(s) | ||||||
| 		text = open('../COPYING').read() | 		copying_file_path = None | ||||||
| 		dlg.set_license(text) | 		if os.path.isfile(os.path.join(gajim.defs.docdir, 'COPYING')): | ||||||
|  | 			copying_file_path = os.path.join(gajim.defs.docdir, 'COPYING') | ||||||
|  | 		elif os.path.isfile('../COPYING'): | ||||||
|  | 			copying_file_path = '../COPYING' | ||||||
|  | 		if copying_file_path: | ||||||
|  | 			text = open(copying_file_path).read() | ||||||
|  | 			dlg.set_license(text) | ||||||
| 		 | 		 | ||||||
| 		dlg.set_comments('%s\n%s %s\n%s %s'  | 		dlg.set_comments('%s\n%s %s\n%s %s'  | ||||||
| 			% (_('A GTK+ jabber client'), \ | 			% (_('A GTK+ jabber client'), \ | ||||||
|  | @ -722,28 +728,40 @@ class AboutDialog: | ||||||
| 			_('PyGTK Version:'), self.tuple2str(gtk.pygtk_version))) | 			_('PyGTK Version:'), self.tuple2str(gtk.pygtk_version))) | ||||||
| 		dlg.set_website('http://www.gajim.org/') | 		dlg.set_website('http://www.gajim.org/') | ||||||
| 
 | 
 | ||||||
| 		authors = [] | 		authors_file_path = None | ||||||
| 		authors_file = open('../AUTHORS').read() | 		if os.path.isfile(os.path.join(gajim.defs.docdir, 'AUTHORS')): | ||||||
| 		authors_file = authors_file.split('\n') | 			authors_file_path = os.path.join(gajim.defs.docdir, 'AUTHORS') | ||||||
| 		for author in authors_file: | 		elif os.path.isfile('../AUTHORS'): | ||||||
| 			if author == 'CURRENT DEVELOPERS:': | 			authors_file_path = '../AUTHORS' | ||||||
| 				authors.append(_('Current Developers:')) | 		if authors_file_path: | ||||||
| 			elif author == 'PAST DEVELOPERS:': | 			authors = [] | ||||||
| 				authors.append('\n' + _('Past Developers:')) | 			authors_file = open(authors_file_path).read() | ||||||
| 			elif author != '': # Real author line | 			authors_file = authors_file.split('\n') | ||||||
| 				authors.append(author) | 			for author in authors_file: | ||||||
|  | 				if author == 'CURRENT DEVELOPERS:': | ||||||
|  | 					authors.append(_('Current Developers:')) | ||||||
|  | 				elif author == 'PAST DEVELOPERS:': | ||||||
|  | 					authors.append('\n' + _('Past Developers:')) | ||||||
|  | 				elif author != '': # Real author line | ||||||
|  | 					authors.append(author) | ||||||
|  | 	 | ||||||
|  | 			thanks_file_path = None | ||||||
|  | 			if os.path.isfile(os.path.join(gajim.defs.docdir, 'THANKS')): | ||||||
|  | 				thanks_file_path = os.path.join(gajim.defs.docdir, 'THANKS') | ||||||
|  | 			elif os.path.isfile('../THANKS'): | ||||||
|  | 				thanks_file_path = '../THANKS' | ||||||
|  | 			if thanks_file_path: | ||||||
|  | 				authors.append('\n' + _('THANKS:')) | ||||||
| 				 | 				 | ||||||
| 		authors.append('\n' + _('THANKS:')) | 				text = open(thanks_file_path).read() | ||||||
| 				 | 				text_splitted = text.split('\n') | ||||||
| 		text = open('../THANKS').read() | 				text = '\n'.join(text_splitted[:-2]) # remove one english sentence | ||||||
| 		text_splitted = text.split('\n') | 				# and add it manually as translatable | ||||||
| 		text = '\n'.join(text_splitted[:-2]) # remove one english sentence | 				text += '\n%s\n' % _('Last but not least, we would like to thank all ' | ||||||
| 		# and add it manually as translatable | 					'the package maintainers.') | ||||||
| 		text += '\n%s\n' % _('Last but not least, we would like to thank all ' | 				authors.append(text) | ||||||
| 			'the package maintainers.') |  | ||||||
| 		authors.append(text) |  | ||||||
| 		 | 		 | ||||||
| 		dlg.set_authors(authors) | 			dlg.set_authors(authors) | ||||||
| 		 | 		 | ||||||
| 		if gtk.pygtk_version >= (2, 8, 0) and gtk.gtk_version >= (2, 8, 0): | 		if gtk.pygtk_version >= (2, 8, 0) and gtk.gtk_version >= (2, 8, 0): | ||||||
| 			dlg.props.wrap_license = True | 			dlg.props.wrap_license = True | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue