contacts from transports now use their protocol state images
13
data/iconsets/transports/gadugadu/closed.xpm
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * closed_xpm[] = {
|
||||||
|
"6 8 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
". ",
|
||||||
|
".. ",
|
||||||
|
"... ",
|
||||||
|
".... ",
|
||||||
|
"... ",
|
||||||
|
".. ",
|
||||||
|
". ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/gadugadu/dnd.png
Normal file
After Width: | Height: | Size: 517 B |
11
data/iconsets/transports/gadugadu/opened.xpm
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * opened_xpm[] = {
|
||||||
|
"7 6 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
".......",
|
||||||
|
" ..... ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/gadugadu/xa.png
Normal file
After Width: | Height: | Size: 517 B |
13
data/iconsets/transports/icq/closed.xpm
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * closed_xpm[] = {
|
||||||
|
"6 8 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
". ",
|
||||||
|
".. ",
|
||||||
|
"... ",
|
||||||
|
".... ",
|
||||||
|
"... ",
|
||||||
|
".. ",
|
||||||
|
". ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/icq/connecting.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
data/iconsets/transports/icq/error.png
Normal file
After Width: | Height: | Size: 505 B |
BIN
data/iconsets/transports/icq/message.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
11
data/iconsets/transports/icq/opened.xpm
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * opened_xpm[] = {
|
||||||
|
"7 6 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
".......",
|
||||||
|
" ..... ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/msn/chat.png
Normal file
After Width: | Height: | Size: 554 B |
13
data/iconsets/transports/msn/closed.xpm
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * closed_xpm[] = {
|
||||||
|
"6 8 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
". ",
|
||||||
|
".. ",
|
||||||
|
"... ",
|
||||||
|
".... ",
|
||||||
|
"... ",
|
||||||
|
".. ",
|
||||||
|
". ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/msn/connecting.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
data/iconsets/transports/msn/error.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
data/iconsets/transports/msn/invisible.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
data/iconsets/transports/msn/message.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
11
data/iconsets/transports/msn/opened.xpm
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * opened_xpm[] = {
|
||||||
|
"7 6 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
".......",
|
||||||
|
" ..... ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/msn/requested.png
Normal file
After Width: | Height: | Size: 387 B |
BIN
data/iconsets/transports/msn/xa.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
data/iconsets/transports/yahoo/chat.png
Normal file
After Width: | Height: | Size: 210 B |
13
data/iconsets/transports/yahoo/closed.xpm
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * closed_xpm[] = {
|
||||||
|
"6 8 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
". ",
|
||||||
|
".. ",
|
||||||
|
"... ",
|
||||||
|
".... ",
|
||||||
|
"... ",
|
||||||
|
".. ",
|
||||||
|
". ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/yahoo/connecting.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
data/iconsets/transports/yahoo/error.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
data/iconsets/transports/yahoo/invisible.png
Normal file
After Width: | Height: | Size: 206 B |
BIN
data/iconsets/transports/yahoo/message.gif
Normal file
After Width: | Height: | Size: 2.1 KiB |
11
data/iconsets/transports/yahoo/opened.xpm
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
/* XPM */
|
||||||
|
static char * opened_xpm[] = {
|
||||||
|
"7 6 2 1",
|
||||||
|
" c None",
|
||||||
|
". c #000000",
|
||||||
|
".......",
|
||||||
|
" ..... ",
|
||||||
|
" ... ",
|
||||||
|
" . ",
|
||||||
|
" ",
|
||||||
|
" "};
|
BIN
data/iconsets/transports/yahoo/requested.png
Normal file
After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 176 B |
Before Width: | Height: | Size: 180 B |
|
@ -1,47 +0,0 @@
|
||||||
<?xml version='1.0' encoding='UTF-8'?>
|
|
||||||
<icondef>
|
|
||||||
<meta>
|
|
||||||
<name>Stellar-Transport (default)</name>
|
|
||||||
<version>1.0</version>
|
|
||||||
<description>Default Psi 0.9.3 iconset</description>
|
|
||||||
<creation>2003-07-17</creation>
|
|
||||||
<home>http://psi.affinix.com</home>
|
|
||||||
<author email='jmkim@uci.edu'>Jason Kim</author>
|
|
||||||
<author jid='mblsha@jabber.ru' email='mblsha@users.sourceforge.net' www='http://maz.sf.net'>Michail Pishchagin (icondef.xml)</author>
|
|
||||||
</meta>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/online</x>
|
|
||||||
<object mime='image/png'>online.png</object>
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/chat</x>
|
|
||||||
<object mime='image/png'>online.png</object> <!-- FIXME -->
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/invisible</x>
|
|
||||||
<object mime='image/png'>online.png</object> <!-- FIXME -->
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/offline</x>
|
|
||||||
<object mime='image/png'>offline.png</object>
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/away</x>
|
|
||||||
<object mime='image/png'>away.png</object>
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/xa</x>
|
|
||||||
<object mime='image/png'>xa.png</object>
|
|
||||||
</icon>
|
|
||||||
|
|
||||||
<icon>
|
|
||||||
<x xmlns='name'>status/dnd</x>
|
|
||||||
<object mime='image/png'>dnd.png</object>
|
|
||||||
</icon>
|
|
||||||
</icondef>
|
|
Before Width: | Height: | Size: 128 B |
Before Width: | Height: | Size: 172 B |
Before Width: | Height: | Size: 191 B |
|
@ -208,7 +208,7 @@ class Interface:
|
||||||
self.roster.to_be_removed[account].append(user1.jid)
|
self.roster.to_be_removed[account].append(user1.jid)
|
||||||
if user1.jid in self.roster.newly_added[account]:
|
if user1.jid in self.roster.newly_added[account]:
|
||||||
self.roster.newly_added[account].remove(user1.jid)
|
self.roster.newly_added[account].remove(user1.jid)
|
||||||
self.roster.redraw_jid(user1.jid, account)
|
self.roster.draw_contact(user1.jid, account)
|
||||||
if not self.queues[account].has_key(jid):
|
if not self.queues[account].has_key(jid):
|
||||||
gobject.timeout_add(5000, self.roster.really_remove_user, \
|
gobject.timeout_add(5000, self.roster.really_remove_user, \
|
||||||
user1, account)
|
user1, account)
|
||||||
|
@ -220,7 +220,7 @@ class Interface:
|
||||||
#It must be an agent
|
#It must be an agent
|
||||||
if self.roster.contacts[account].has_key(ji):
|
if self.roster.contacts[account].has_key(ji):
|
||||||
#Update existing iter
|
#Update existing iter
|
||||||
self.roster.redraw_jid(ji, account)
|
self.roster.draw_contact(ji, account)
|
||||||
elif self.roster.contacts[account].has_key(ji):
|
elif self.roster.contacts[account].has_key(ji):
|
||||||
#It isn't an agent
|
#It isn't an agent
|
||||||
self.roster.chg_user_status(user1, array[1], array[2], account)
|
self.roster.chg_user_status(user1, array[1], array[2], account)
|
||||||
|
@ -463,7 +463,7 @@ class Interface:
|
||||||
user.ask = array[3]
|
user.ask = array[3]
|
||||||
if array[4]:
|
if array[4]:
|
||||||
user.groups = array[4]
|
user.groups = array[4]
|
||||||
self.roster.redraw_jid(jid, account)
|
self.roster.draw_contact(jid, account)
|
||||||
|
|
||||||
def read_sleepy(self):
|
def read_sleepy(self):
|
||||||
'''Check if we are idle'''
|
'''Check if we are idle'''
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Roster_window:
|
||||||
def remove_newly_added(self, jid, account):
|
def remove_newly_added(self, jid, account):
|
||||||
if jid in self.newly_added[account]:
|
if jid in self.newly_added[account]:
|
||||||
self.newly_added[account].remove(jid)
|
self.newly_added[account].remove(jid)
|
||||||
self.redraw_jid(jid, account)
|
self.draw_contact(jid, account)
|
||||||
|
|
||||||
def add_user_to_roster(self, jid, account):
|
def add_user_to_roster(self, jid, account):
|
||||||
'''Add a user to the roster and add groups if they aren't in roster'''
|
'''Add a user to the roster and add groups if they aren't in roster'''
|
||||||
|
@ -109,7 +109,7 @@ class Roster_window:
|
||||||
return
|
return
|
||||||
users = self.contacts[account][jid]
|
users = self.contacts[account][jid]
|
||||||
user = users[0]
|
user = users[0]
|
||||||
if user.jid.find('@') <= 0:
|
if user.jid.find('@') == -1: # if not '@' it's an agent
|
||||||
user.groups = ['Agents']
|
user.groups = ['Agents']
|
||||||
elif user.groups == []:
|
elif user.groups == []:
|
||||||
user.groups.append('General')
|
user.groups.append('General')
|
||||||
|
@ -146,7 +146,7 @@ class Roster_window:
|
||||||
if self.groups[account][g]['expand']:
|
if self.groups[account][g]['expand']:
|
||||||
self.tree.expand_row(model.get_path(iterG),
|
self.tree.expand_row(model.get_path(iterG),
|
||||||
False)
|
False)
|
||||||
self.redraw_jid(jid, account)
|
self.draw_contact(jid, account)
|
||||||
|
|
||||||
def really_remove_user(self, user, account):
|
def really_remove_user(self, user, account):
|
||||||
if user.jid in self.to_be_removed[account]:
|
if user.jid in self.to_be_removed[account]:
|
||||||
|
@ -173,8 +173,8 @@ class Roster_window:
|
||||||
if group_empty:
|
if group_empty:
|
||||||
del self.groups[account][group]
|
del self.groups[account][group]
|
||||||
|
|
||||||
def redraw_jid(self, jid, account):
|
def draw_contact(self, jid, account):
|
||||||
'''draw the correct pixbuf and name'''
|
'''draw the correct state image and name'''
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
iters = self.get_user_iter(jid, account)
|
iters = self.get_user_iter(jid, account)
|
||||||
if len(iters) == 0:
|
if len(iters) == 0:
|
||||||
|
@ -189,19 +189,46 @@ class Roster_window:
|
||||||
if u.priority > prio:
|
if u.priority > prio:
|
||||||
prio = u.priority
|
prio = u.priority
|
||||||
user = u
|
user = u
|
||||||
|
jabber_state_images = self.pixbufs
|
||||||
for iter in iters:
|
for iter in iters:
|
||||||
if jid.find('@') <= 0: # It's an agent
|
if jid.find('@aim.') != -1:
|
||||||
img = self.pixbufs[user.show]
|
state_images = self.transports_state_images['aim']
|
||||||
|
elif jid.find('@gadugadu.') != -1:
|
||||||
|
state_images = self.transports_state_images['gadugadu']
|
||||||
|
elif jid.find('@icq.') != -1:
|
||||||
|
state_images = self.transports_state_images['icq']
|
||||||
|
elif jid.find('@msn.') != -1:
|
||||||
|
state_images = self.transports_state_images['msn']
|
||||||
|
elif jid.find('@yahoo.') != -1:
|
||||||
|
state_images = self.transports_state_images['yahoo']
|
||||||
|
else:
|
||||||
|
state_images = jabber_state_images
|
||||||
|
|
||||||
|
if jid.find('@') == -1: # if not '@' it's an agent
|
||||||
|
if name.find('aim.') != -1:
|
||||||
|
state_images = self.transports_state_images['aim']
|
||||||
|
elif name.find('gadugadu.') != -1:
|
||||||
|
state_images = self.transports_state_images['gadugadu']
|
||||||
|
elif name.find('icq.') != -1:
|
||||||
|
state_images = self.transports_state_images['icq']
|
||||||
|
elif name.find('msn.') != -1:
|
||||||
|
state_images = self.transports_state_images['msn']
|
||||||
|
elif name.find('yahoo.') != -1:
|
||||||
|
state_images = self.transports_state_images['yahoo']
|
||||||
|
else:
|
||||||
|
state_images = jabber_state_images
|
||||||
|
|
||||||
|
img = state_images[user.show]
|
||||||
elif self.plugin.queues[account].has_key(jid):
|
elif self.plugin.queues[account].has_key(jid):
|
||||||
img = self.pixbufs['message']
|
img = state_images['message']
|
||||||
else:
|
else:
|
||||||
if user.sub != 'both':
|
if user.sub != 'both':
|
||||||
if user.ask == 'subscribe':
|
if user.ask == 'subscribe':
|
||||||
img = self.pixbufs['requested']
|
img = state_images['requested']
|
||||||
else:
|
else:
|
||||||
img = self.pixbufs['not in the roster']
|
img = state_images['not in the roster']
|
||||||
else:
|
else:
|
||||||
img = self.pixbufs[user.show]
|
img = state_images[user.show]
|
||||||
model.set_value(iter, 0, img)
|
model.set_value(iter, 0, img)
|
||||||
model.set_value(iter, 1, name)
|
model.set_value(iter, 1, name)
|
||||||
|
|
||||||
|
@ -368,15 +395,15 @@ class Roster_window:
|
||||||
not self.plugin.queues[account].has_key(user.jid):
|
not self.plugin.queues[account].has_key(user.jid):
|
||||||
if len(luser) > 1:
|
if len(luser) > 1:
|
||||||
luser.remove(user)
|
luser.remove(user)
|
||||||
self.redraw_jid(user.jid, account)
|
self.draw_contact(user.jid, account)
|
||||||
elif not showOffline:
|
elif not showOffline:
|
||||||
self.remove_user(user, account)
|
self.remove_user(user, account)
|
||||||
else:
|
else:
|
||||||
self.redraw_jid(user.jid, account)
|
self.draw_contact(user.jid, account)
|
||||||
else:
|
else:
|
||||||
if not self.get_user_iter(user.jid, account):
|
if not self.get_user_iter(user.jid, account):
|
||||||
self.add_user_to_roster(user.jid, account)
|
self.add_user_to_roster(user.jid, account)
|
||||||
self.redraw_jid(user.jid, account)
|
self.draw_contact(user.jid, account)
|
||||||
#Print status in chat window
|
#Print status in chat window
|
||||||
if self.plugin.windows[account]['chats'].has_key(user.jid):
|
if self.plugin.windows[account]['chats'].has_key(user.jid):
|
||||||
self.plugin.windows[account]['chats'][user.jid].set_image(user.jid)
|
self.plugin.windows[account]['chats'][user.jid].set_image(user.jid)
|
||||||
|
@ -877,7 +904,7 @@ class Roster_window:
|
||||||
if not self.plugin.queues[account].has_key(jid):
|
if not self.plugin.queues[account].has_key(jid):
|
||||||
model = self.tree.get_model()
|
model = self.tree.get_model()
|
||||||
self.plugin.queues[account][jid] = Queue.Queue(50)
|
self.plugin.queues[account][jid] = Queue.Queue(50)
|
||||||
self.redraw_jid(jid, account)
|
self.draw_contact(jid, account)
|
||||||
if self.plugin.systray_enabled:
|
if self.plugin.systray_enabled:
|
||||||
self.plugin.systray.add_jid(jid, account)
|
self.plugin.systray.add_jid(jid, account)
|
||||||
self.plugin.queues[account][jid].put((msg, tim))
|
self.plugin.queues[account][jid].put((msg, tim))
|
||||||
|
@ -1102,7 +1129,7 @@ class Roster_window:
|
||||||
for u in self.contacts[account][jid]:
|
for u in self.contacts[account][jid]:
|
||||||
u.name = new_text
|
u.name = new_text
|
||||||
gajim.connections[account].update_user(jid, new_text, u.groups)
|
gajim.connections[account].update_user(jid, new_text, u.groups)
|
||||||
self.redraw_jid(jid, account)
|
self.draw_contact(jid, account)
|
||||||
elif type == 'group':
|
elif type == 'group':
|
||||||
old_name = model.get_value(iter, 1)
|
old_name = model.get_value(iter, 1)
|
||||||
#get all users in that group
|
#get all users in that group
|
||||||
|
@ -1153,14 +1180,18 @@ class Roster_window:
|
||||||
image.set_from_file(file)
|
image.set_from_file(file)
|
||||||
break
|
break
|
||||||
|
|
||||||
def init_transports_pixbufs(self, arg, dirname, fnames):
|
def init_transports_state_images(self, dirname, fnames):
|
||||||
name_only = os.path.basename(dirname)
|
name_only = os.path.basename(dirname)
|
||||||
if name_only == 'transports' or name_only == '.svn':
|
for fname in fnames: # fname is abs
|
||||||
return
|
if fname == '.svn':
|
||||||
for fname in fnames:
|
continue
|
||||||
transport_kind = name_only
|
state = unicode(fname[:-4]) # without extension
|
||||||
return
|
state = state.replace('_', ' ') # make '_' a space for dict key
|
||||||
self.transports_pixbufs[transport_kind][fname] = 'be'
|
path_to_fname = os.path.join(dirname, fname)
|
||||||
|
image = gtk.Image()
|
||||||
|
image.set_from_file(path_to_fname)
|
||||||
|
image.show()
|
||||||
|
self.transports_state_images[name_only][state] = image
|
||||||
|
|
||||||
def reload_pixbufs(self):
|
def reload_pixbufs(self):
|
||||||
self.mkpixbufs()
|
self.mkpixbufs()
|
||||||
|
@ -1387,8 +1418,16 @@ class Roster_window:
|
||||||
model.set_sort_column_id(1, gtk.SORT_ASCENDING)
|
model.set_sort_column_id(1, gtk.SORT_ASCENDING)
|
||||||
self.tree.set_model(model)
|
self.tree.set_model(model)
|
||||||
self.mkpixbufs()
|
self.mkpixbufs()
|
||||||
self.transports_pixbufs = { 'aim': {}, 'gadugadu': {}, 'icq': {}, 'msn': {}, 'yahoo': {} }
|
self.transports_state_images = { 'aim': {}, 'gadugadu': {}, 'icq': {}, 'msn': {}, 'yahoo': {} }
|
||||||
os.path.walk('../data/iconsets/transports', self.init_transports_pixbufs, None) # arg is None
|
|
||||||
|
path = '../data/iconsets/transports'
|
||||||
|
folders = os.listdir('../data/iconsets/transports')
|
||||||
|
for folder in folders:
|
||||||
|
if folder == '.svn':
|
||||||
|
continue
|
||||||
|
folder = os.path.join(path, folder)
|
||||||
|
image_files = os.listdir(folder)
|
||||||
|
self.init_transports_state_images(folder, image_files)
|
||||||
|
|
||||||
liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.Image,
|
liststore = gtk.ListStore(gobject.TYPE_STRING, gtk.Image,
|
||||||
gobject.TYPE_STRING)
|
gobject.TYPE_STRING)
|
||||||
|
|
|
@ -211,7 +211,7 @@ class Tabbed_chat_window(chat.Chat):
|
||||||
self.plugin.roster.nb_unread -= 1
|
self.plugin.roster.nb_unread -= 1
|
||||||
self.plugin.roster.show_title()
|
self.plugin.roster.show_title()
|
||||||
del self.plugin.queues[self.account][jid]
|
del self.plugin.queues[self.account][jid]
|
||||||
self.plugin.roster.redraw_jid(jid, self.account)
|
self.plugin.roster.draw_contact(jid, self.account)
|
||||||
if self.plugin.systray_enabled:
|
if self.plugin.systray_enabled:
|
||||||
self.plugin.systray.remove_jid(jid, self.account)
|
self.plugin.systray.remove_jid(jid, self.account)
|
||||||
showOffline = gajim.config.get('showoffline')
|
showOffline = gajim.config.get('showoffline')
|
||||||
|
|