Use a file for artists credits instead of hardcoded. Added helper func to get credits files paths
This commit is contained in:
parent
2c891b5b87
commit
7ad796a34a
2 changed files with 24 additions and 19 deletions
6
THANKS.artists
Normal file
6
THANKS.artists
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
Anders Ström
|
||||||
|
Christophe Got
|
||||||
|
Dennis Craven
|
||||||
|
Guillaume Morin
|
||||||
|
Josef Vybíral
|
||||||
|
Membris Khan
|
|
@ -915,11 +915,7 @@ class AboutDialog:
|
||||||
dlg.set_version(gajim.version)
|
dlg.set_version(gajim.version)
|
||||||
s = u'Copyright © 2003-2008 Gajim Team'
|
s = u'Copyright © 2003-2008 Gajim Team'
|
||||||
dlg.set_copyright(s)
|
dlg.set_copyright(s)
|
||||||
copying_file_path = None
|
copying_file_path = self.get_path('COPYING')
|
||||||
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:
|
if copying_file_path:
|
||||||
text = open(copying_file_path).read()
|
text = open(copying_file_path).read()
|
||||||
dlg.set_license(text)
|
dlg.set_license(text)
|
||||||
|
@ -930,11 +926,7 @@ 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_file_path = None
|
authors_file_path = self.get_path('AUTHORS')
|
||||||
if os.path.isfile(os.path.join(gajim.defs.docdir, 'AUTHORS')):
|
|
||||||
authors_file_path = os.path.join(gajim.defs.docdir, 'AUTHORS')
|
|
||||||
elif os.path.isfile('../AUTHORS'):
|
|
||||||
authors_file_path = '../AUTHORS'
|
|
||||||
if authors_file_path:
|
if authors_file_path:
|
||||||
authors = []
|
authors = []
|
||||||
authors_file = open(authors_file_path).read()
|
authors_file = open(authors_file_path).read()
|
||||||
|
@ -947,11 +939,7 @@ class AboutDialog:
|
||||||
elif author != '': # Real author line
|
elif author != '': # Real author line
|
||||||
authors.append(author)
|
authors.append(author)
|
||||||
|
|
||||||
thanks_file_path = None
|
thanks_file_path = self.get_path('THANKS')
|
||||||
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:
|
if thanks_file_path:
|
||||||
authors.append('\n' + _('THANKS:'))
|
authors.append('\n' + _('THANKS:'))
|
||||||
|
|
||||||
|
@ -974,8 +962,10 @@ class AboutDialog:
|
||||||
#here you write your name in the form Name FamilyName <someone@somewhere>
|
#here you write your name in the form Name FamilyName <someone@somewhere>
|
||||||
dlg.set_translator_credits(_('translator-credits'))
|
dlg.set_translator_credits(_('translator-credits'))
|
||||||
|
|
||||||
artists = ['Anders Ström', 'Christophe Got', 'Dennis Craven',
|
thanks_artists_file_path = self.get_path('THANKS.artists')
|
||||||
'Guillaume Morin', 'Josef Vybíral', 'Membris Khan']
|
if thanks_artists_file_path:
|
||||||
|
artists_text = open(thanks_artists_file_path).read()
|
||||||
|
artists = artists_text.split('\n')
|
||||||
dlg.set_artists(artists)
|
dlg.set_artists(artists)
|
||||||
# connect close button to destroy() function
|
# connect close button to destroy() function
|
||||||
for button in dlg.action_area.get_children():
|
for button in dlg.action_area.get_children():
|
||||||
|
@ -989,6 +979,15 @@ class AboutDialog:
|
||||||
str_ += str(num) + '.'
|
str_ += str(num) + '.'
|
||||||
return str_[0:-1] # remove latest .
|
return str_[0:-1] # remove latest .
|
||||||
|
|
||||||
|
def get_path(self, filename):
|
||||||
|
'''where can we find this Credits file ?'''
|
||||||
|
if os.path.isfile(os.path.join(gajim.defs.docdir, filename)):
|
||||||
|
return os.path.join(gajim.defs.docdir, filename)
|
||||||
|
elif os.path.isfile('../' + filename):
|
||||||
|
return ('../' + filename)
|
||||||
|
else:
|
||||||
|
return None
|
||||||
|
|
||||||
class Dialog(gtk.Dialog):
|
class Dialog(gtk.Dialog):
|
||||||
def __init__(self, parent, title, buttons, default = None,
|
def __init__(self, parent, title, buttons, default = None,
|
||||||
on_response_ok=None, on_response_cancel=None):
|
on_response_ok=None, on_response_cancel=None):
|
||||||
|
|
Loading…
Add table
Reference in a new issue