add a DATA_DIR in gajim

This commit is contained in:
Yann Leboulanger 2005-05-17 17:37:50 +00:00
parent fea1f2c41d
commit 99401f2abb
5 changed files with 9 additions and 6 deletions

View File

@ -26,3 +26,4 @@ config = common.config.Config()
connections = {} connections = {}
log = logging.getLogger('Gajim') log = logging.getLogger('Gajim')
logger = common.logger.Logger() logger = common.logger.Logger()
DATA_DIR = '../data'

View File

@ -107,7 +107,7 @@ class Preferences_window:
self.xml.get_widget('add_remove_emoticons_button').set_sensitive(st) self.xml.get_widget('add_remove_emoticons_button').set_sensitive(st)
#iconset #iconset
iconsets_list = os.listdir('../data/iconsets/') iconsets_list = os.listdir(os.path.join(gajim.DATA_DIR, 'iconsets/'))
model = gtk.ListStore(gobject.TYPE_STRING) model = gtk.ListStore(gobject.TYPE_STRING)
self.iconset_combobox.set_model(model) self.iconset_combobox.set_model(model)
l = [] l = []

View File

@ -20,6 +20,7 @@
import gtk import gtk
import gtk.glade import gtk.glade
import gobject import gobject
import os
from gajim import User from gajim import User
from common import gajim from common import gajim
from common import i18n from common import i18n
@ -375,7 +376,8 @@ class About_dialog:
authors = ['Yann Le Boulanger <asterix@lagaule.org>', 'Vincent Hanquez <tab@snarc.org>', 'Nikos Kouremenos <kourem@gmail.com>', 'Alex Podaras <bigpod@gmail.com>'] authors = ['Yann Le Boulanger <asterix@lagaule.org>', 'Vincent Hanquez <tab@snarc.org>', 'Nikos Kouremenos <kourem@gmail.com>', 'Alex Podaras <bigpod@gmail.com>']
dlg.set_authors(authors) dlg.set_authors(authors)
dlg.set_logo(gtk.gdk.pixbuf_new_from_file('../data/pixmaps/logo.png')) dlg.set_logo(gtk.gdk.pixbuf_new_from_file(os.path.join(gajim.DATA_DIR,
'pixmaps/logo.png')))
dlg.set_translator_credits(_('translator_credits')) dlg.set_translator_credits(_('translator_credits'))
rep = dlg.run() rep = dlg.run()

View File

@ -718,7 +718,7 @@ class Interface:
#3:autoxa and use sleeper #3:autoxa and use sleeper
iconset = gajim.config.get('iconset') iconset = gajim.config.get('iconset')
path = '../data/iconsets/' + iconset + '/' path = os.path.join(gajim.DATA_DIR, 'iconsets/' + iconset + '/')
files = [path + 'online.gif', path + 'online.png', path + 'online.xpm'] files = [path + 'online.gif', path + 'online.png', path + 'online.xpm']
pix = None pix = None
for fname in files: for fname in files:

View File

@ -1207,7 +1207,7 @@ class Roster_window:
iconset = gajim.config.get('iconset') iconset = gajim.config.get('iconset')
if not iconset: if not iconset:
iconset = 'sun' iconset = 'sun'
self.path = '../data/iconsets/' + iconset + '/' self.path = os.path.join(gajim.DATA_DIR, 'iconsets/' + iconset + '/')
self.jabber_state_images = self.load_iconset(self.path) self.jabber_state_images = self.load_iconset(self.path)
def reload_jabber_state_images(self): def reload_jabber_state_images(self):
@ -1450,8 +1450,8 @@ class Roster_window:
self.make_jabber_state_images() self.make_jabber_state_images()
self.transports_state_images = { 'aim': {}, 'gadugadu': {}, 'icq': {}, 'msn': {}, 'yahoo': {} } self.transports_state_images = { 'aim': {}, 'gadugadu': {}, 'icq': {}, 'msn': {}, 'yahoo': {} }
path = '../data/iconsets/transports' path = os.path.join(gajim.DATA_DIR, 'iconsets/transports')
folders = os.listdir('../data/iconsets/transports') folders = os.listdir(path)
for transport in folders: for transport in folders:
if transport == '.svn': if transport == '.svn':
continue continue