From 1c392909d48aa9bd993eca3a5378134555fce1ef Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Sun, 18 Apr 2010 22:13:36 +0100 Subject: Remove call-gtk.py as it's outdated and obsolete Stream-engine really? It seems unlikely that anyone will update this example in a reasonable time-frame so let's just remove it. The current one confuses people more then it helps them :) --- examples/call-gtk.py | 116 --------------------------------------------------- 1 file changed, 116 deletions(-) delete mode 100644 examples/call-gtk.py diff --git a/examples/call-gtk.py b/examples/call-gtk.py deleted file mode 100644 index cae9f91..0000000 --- a/examples/call-gtk.py +++ /dev/null @@ -1,116 +0,0 @@ - -import sys - -import pygtk -pygtk.require('2.0') - -import dbus -import gobject -import gtk - -from account import connection_from_file -from call import IncomingCall, OutgoingCall, get_stream_engine - -from telepathy.interfaces import CONN_INTERFACE - -class CallWindow(gtk.Window): - def __init__(self): - gtk.Window.__init__(self) - - hbox = gtk.HBox() - hbox.set_border_width(10) - vbox = gtk.VBox() - - output_frame = gtk.Frame() - output_frame.set_shadow_type(gtk.SHADOW_IN) - - preview_frame = gtk.Frame() - preview_frame.set_shadow_type(gtk.SHADOW_IN) - - self.output = gtk.Socket() - self.output.set_size_request(400, 300) - self.preview = gtk.Socket() - self.preview.set_size_request(200, 150) - - self.call_button = gtk.Button('Call') - self.call_button.connect('clicked', self._call_button_clicked) - - output_frame.add(self.output) - preview_frame.add(self.preview) - vbox.pack_start(preview_frame, False) - vbox.pack_end(self.call_button, False) - hbox.add(output_frame) - hbox.pack_start(vbox, padding=10) - self.add(hbox) - - def _call_button_clicked(self, button): - pass - -class GtkLoopMixin: - def run_main_loop(self): - gtk.main() - - def quit(self): - gtk.main_quit() - -class BaseGtkCall: - def __init__(self): - self.window = CallWindow() - self.window.connect('destroy', gtk.main_quit) - self.window.show_all() - - def add_preview_window(self): - se = dbus.Interface(get_stream_engine(), - 'org.freedesktop.Telepathy.StreamEngine') - se.AddPreviewWindow(self.window.preview.get_id()) - - return False - - def add_output_window(self): - se = dbus.Interface(get_stream_engine(), - 'org.freedesktop.Telepathy.StreamEngine') - chan_path = self.channel.object_path - se.SetOutputWindow(chan_path, 2, self.window.output.get_id()) - - return False - -class GtkOutgoingCall(GtkLoopMixin, BaseGtkCall, OutgoingCall): - def __init__(self, account_file, contact): - OutgoingCall.__init__(self, account_file, contact) - BaseGtkCall.__init__(self) - - def members_changed_cb(self, message, added, removed, local_pending, - remote_pending, actor, reason): - OutgoingCall.members_changed_cb(self, message, added, removed, - local_pending, remote_pending, actor, reason) - - if self.handle in added: - gobject.timeout_add(5000, self.add_output_window) - gobject.timeout_add(5000, self.add_preview_window) - -class GtkIncomingCall(GtkLoopMixin, BaseGtkCall, IncomingCall): - def __init__(self, account_file): - IncomingCall.__init__(self, account_file) - BaseGtkCall.__init__(self) - - def members_changed_cb(self, message, added, removed, local_pending, - remote_pending, actor, reason): - IncomingCall.members_changed_cb(self, message, added, removed, - local_pending, remote_pending, actor, reason) - - if self.conn[CONN_INTERFACE].GetSelfHandle() in added: - gobject.timeout_add(5000, self.add_output_window) - gobject.timeout_add(5000, self.add_preview_window) - -if __name__ == '__main__': - args = sys.argv[1:] - - assert len(args) in (1, 2) - - if len(args) > 1: - contact = args[1] - call = GtkOutgoingCall(args[0], args[1]) - else: - call = GtkIncomingCall(args[0]) - - call.run() -- cgit v1.2.3