bigboard r7352 - trunk/bigboard/stocks/people
- From: marco svn gnome org
- To: svn-commits-list gnome org
- Subject: bigboard r7352 - trunk/bigboard/stocks/people
- Date: Wed, 11 Jun 2008 12:35:07 +0000 (UTC)
Author: marco
Date: Wed Jun 11 12:35:07 2008
New Revision: 7352
URL: http://svn.gnome.org/viewvc/bigboard?rev=7352&view=rev
Log:
Hook up opening a chat for empathy.
Modified:
trunk/bigboard/stocks/people/imclient.py
trunk/bigboard/stocks/people/peoplewidgets.py
Modified: trunk/bigboard/stocks/people/imclient.py
==============================================================================
--- trunk/bigboard/stocks/people/imclient.py (original)
+++ trunk/bigboard/stocks/people/imclient.py Wed Jun 11 12:35:07 2008
@@ -1,3 +1,4 @@
+import cgi
import dbus
import os
import gobject
@@ -16,6 +17,11 @@
VfsMonitor('file://' + self.__accounts_config, gnomevfs.MONITOR_FILE,
lambda: self.notify('configured'))
+ def open_chat(self, buddy_id, protocol):
+ # FIXME, is there some less hardcoded way to do this?
+ os.spawnlp(os.P_NOWAIT, 'purple-remote', 'purple-remote',
+ '%s:goim?screenname=%s' % (protocol, cgi.escape(buddy_id)))
+
def get_configured(self):
return os.path.exists(self.__accounts_config)
@@ -35,6 +41,9 @@
def __init__(self):
gobject.GObject.__init__(self)
+ def open_chat(self, buddy_id, protocol):
+ empathy.open_chat_with(buddy_id, protocol)
+
def get_configured(self):
return empathy.is_configured()
@@ -53,8 +62,8 @@
global _client
if _client == None:
- _client = Pidgin()
- #_client = Empathy()
+ #_client = Pidgin()
+ _client = Empathy()
return _client
Modified: trunk/bigboard/stocks/people/peoplewidgets.py
==============================================================================
--- trunk/bigboard/stocks/people/peoplewidgets.py (original)
+++ trunk/bigboard/stocks/people/peoplewidgets.py Wed Jun 11 12:35:07 2008
@@ -1,4 +1,3 @@
-import cgi
import os
import time
import logging
@@ -10,28 +9,20 @@
import bigboard
from bigboard.databound import DataBoundItem
from bigboard.big_widgets import ActionLink, CanvasMugshotURLImage, Header
-from bigboard.big_widgets import CanvasMugshotURLImageButton, PhotoContentItem, CanvasHBox, CanvasVBox
+from bigboard.big_widgets import PhotoContentItem, CanvasHBox, CanvasVBox
import bigboard.libbig as libbig
import bigboard.globals as globals
-
from bigboard.libbig.format_escaped import format_escaped
from ddm import DataModel
+import imclient
+
_logger = logging.getLogger("bigboard.stocks.PeopleStock")
STATUS_MUSIC = 0
STATUS_IM = 1
-def _open_aim(aim):
- ## purple-remote only allows lowercase "goim" here, unfortunately I'm guessing
- ## some other gnome-open handlers only allow "GoIM" ...
- os.spawnlp(os.P_NOWAIT, 'gnome-open', 'gnome-open', 'aim:goim?screenname=' + cgi.escape(aim))
-
-def _open_xmpp(xmpp):
- # FIXME, is there some less hardcoded way to do this?
- os.spawnlp(os.P_NOWAIT, 'purple-remote', 'purple-remote', 'jabber:goim?screenname=' + cgi.escape(xmpp))
-
def _open_webdav(url):
# We pass around WebDAV URL's using the standard http:// scheme, but nautilus wants dav://
# instead.
@@ -357,7 +348,7 @@
return "AIM"
def _start_conversation(self):
- _open_aim(self.resource.name)
+ imclient.get_default().open_chat(self.resource.name, 'aim')
return True
class XMPPIcon(IMIcon):
@@ -371,7 +362,7 @@
return "XMPP"
def _start_conversation(self):
- _open_xmpp(self.resource.name)
+ imclient.get_default().open_chat(self.resource.name, 'jabber')
return True
@@ -835,11 +826,11 @@
def __on_activate_aim(self, canvas_item, addr):
self.emit("close", True)
- _open_aim(addr)
+ imclient.get_default().open_chat(self.resource.name, 'aim')
def __on_activate_xmpp(self, canvas_item, addr):
self.emit("close", True)
- _open_xmpp(addr)
+ imclient.get_default().open_chat(self.resource.name, 'jabber')
def __on_activate_add_address(self, canvas_item):
dialog = gtk.Dialog(title=("Add an address for %s" % self.person.display_name))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]