notif AVATAR_PATH
This commit is contained in:
parent
f816dcf307
commit
b020492de6
|
@ -74,7 +74,7 @@ def create_log_db():
|
|||
def check_and_possibly_create_paths():
|
||||
LOG_DB_PATH = logger.LOG_DB_PATH
|
||||
VCARDPATH = gajim.VCARDPATH
|
||||
AVATARPATH = gajim.AVATARPATH
|
||||
AVATAR_PATH = gajim.AVATARPATH
|
||||
dot_gajim = os.path.dirname(VCARDPATH)
|
||||
if os.path.isfile(dot_gajim):
|
||||
print _('%s is file but it should be a directory') % dot_gajim
|
||||
|
@ -93,11 +93,11 @@ def check_and_possibly_create_paths():
|
|||
print _('Gajim will now exit')
|
||||
sys.exit()
|
||||
|
||||
if not os.path.exists(AVATARPATH):
|
||||
print _('creating %s directory') % AVATARPATH
|
||||
os.mkdir(AVATARPATH, 0700)
|
||||
elif os.path.isfile(AVATARPATH):
|
||||
print _('%s is file but it should be a directory') % AVATARPATH
|
||||
if not os.path.exists(AVATAR_PATH):
|
||||
print _('creating %s directory') % AVATAR_PATH
|
||||
os.mkdir(AVATAR_PATH, 0700)
|
||||
elif os.path.isfile(AVATAR_PATH):
|
||||
print _('%s is file but it should be a directory') % AVATAR_PATH
|
||||
print _('Gajim will now exit')
|
||||
sys.exit()
|
||||
|
||||
|
|
|
@ -53,25 +53,25 @@ if os.name == 'nt':
|
|||
LOGPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Logs') # deprecated
|
||||
VCARDPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Vcards')
|
||||
TMP = os.path.join(os.environ['tmp'], 'Gajim')
|
||||
AVATARPATH = os.path.join(os.environ['appdata'], 'Gajim', 'Avatars')
|
||||
AVATAR_PATH = os.path.join(os.environ['appdata'], 'Gajim', 'Avatars')
|
||||
except KeyError:
|
||||
# win9x, in cwd
|
||||
LOGPATH = 'Logs' # deprecated
|
||||
VCARDPATH = 'Vcards'
|
||||
TMP = 'temporary files'
|
||||
AVATARPATH = 'Avatars'
|
||||
AVATAR_PATH = 'Avatars'
|
||||
else: # Unices
|
||||
DATA_DIR = '../data'
|
||||
LOGPATH = os.path.expanduser('~/.gajim/logs') # deprecated
|
||||
VCARDPATH = os.path.expanduser('~/.gajim/vcards')
|
||||
TMP = '/tmp'
|
||||
AVATARPATH = os.path.expanduser('~/.gajim/avatars')
|
||||
AVATAR_PATH = os.path.expanduser('~/.gajim/avatars')
|
||||
|
||||
try:
|
||||
LOGPATH = LOGPATH.decode(sys.getfilesystemencoding())
|
||||
VCARDPATH = VCARDPATH.decode(sys.getfilesystemencoding())
|
||||
TMP = TMP.decode(sys.getfilesystemencoding())
|
||||
AVATARPATH = AVATARPATH.decode(sys.getfilesystemencoding())
|
||||
AVATAR_PATH = AVATARPATH.decode(sys.getfilesystemencoding())
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
|
@ -840,7 +840,7 @@ class Interface:
|
|||
|
||||
def save_avatar_files(self, jid, photo_decoded):
|
||||
'''Save the decoded avatar to a separate file, and generate files for dbus notifications'''
|
||||
path_to_file = os.path.join(gajim.AVATARPATH, jid)
|
||||
path_to_file = os.path.join(gajim.AVATAR_PATH, jid)
|
||||
pixbuf, typ = gtkgui_helpers.get_pixbuf_from_data(photo_decoded,
|
||||
want_type = True)
|
||||
if typ in ('jpeg', 'png'):
|
||||
|
|
|
@ -123,14 +123,14 @@ class DesktopNotification:
|
|||
prefix = 'jabber'
|
||||
|
||||
if event_type == _('Contact Signed In'):
|
||||
path_to_file = os.path.join(gajim.AVATARPATH, jid) + '_notf_size_colored.png'
|
||||
path_to_file = os.path.join(gajim.AVATAR_PATH, jid) + '_notif_size_colored.png'
|
||||
if not os.path.exists(path_to_file):
|
||||
img = prefix + '_online.png'
|
||||
else:
|
||||
img = path_to_file
|
||||
ntype = 'presence.online'
|
||||
elif event_type == _('Contact Signed Out'):
|
||||
path_to_file = os.path.join(gajim.AVATARPATH, jid) + '_notf_size_bw.png'
|
||||
path_to_file = os.path.join(gajim.AVATAR_PATH, jid) + '_notif_size_bw.png'
|
||||
if not os.path.exists(path_to_file):
|
||||
img = prefix + '_offline.png'
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue