Summary: | Add an example/test dialler | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Simon McVittie <smcv> |
Component: | tp-glib | Assignee: | Simon McVittie <smcv> |
Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | Keywords: | patch |
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
the example dialler in use
[1/3] Add a simple Gtk3 dialler [2/3] Optionally install most of the Python examples [3/3] Install remaining Python examples [4/5] use lower-case consistently [5/5] dialler: use GtkApplication [6/7] dialler: don't connect to delete-event [7/7] Override GApplication.activate() rather than using the signal |
Created attachment 59728 [details] [review] [1/3] Add a simple Gtk3 dialler Created attachment 59729 [details] [review] [2/3] Optionally install most of the Python examples We already optionally install many of the C examples. Created attachment 59730 [details] [review] [3/3] Install remaining Python examples --- To make this easier, I moved them out of their subdirectory and renamed them. Comment on attachment 59728 [details] [review] [1/3] Add a simple Gtk3 dialler Review of attachment 59728 [details] [review]: ----------------------------------------------------------------- ::: examples/client/python/dialler.py @@ +48,5 @@ > + self.potential_handlers = set() > + self.handlers = Gtk.ListStore(str, str) > + > + self.window = Gtk.Window() > + self.window.connect('delete-event', Gtk.main_quit) no GtkApplication? :-( @@ +71,5 @@ > + self.target_entry.set_text('smcv@example.com') > + self.grid.attach(self.target_entry, 1, row, 1, 1) > + row += 1 > + > + self.grid.attach(Gtk.Label('preferred Handler:'), 0, row, 1, 1) "Handler" — the only capital letter in the UI... please remove this or add capitals everywhere else. In fact, yeah, everywhere else would look hilarious. Comment on attachment 59729 [details] [review] [2/3] Optionally install most of the Python examples Review of attachment 59729 [details] [review]: ----------------------------------------------------------------- Seems okay. Comment on attachment 59730 [details] [review] [3/3] Install remaining Python examples Review of attachment 59730 [details] [review]: ----------------------------------------------------------------- ::: examples/client/python/Makefile.am @@ -6,5 @@ > text-handler.py \ > file-transfer.py \ > ft-handler.py \ > - stream-tubes.py/offerer.py \ > - stream-tubes.py/accepter.py What the hell was this?! How did I not see this weird directory name when I reviewed it before?! Created attachment 59794 [details] [review] [4/5] use lower-case consistently The inconsistency offended Jonny. Created attachment 59795 [details] [review] [5/5] dialler: use GtkApplication --- I *think* this is right, but this is my first Gtk for months (possibly years), so... Comment on attachment 59795 [details] [review] [5/5] dialler: use GtkApplication Review of attachment 59795 [details] [review]: ----------------------------------------------------------------- Looks basically fine. Just two comments thought. ::: examples/client/python/dialler.py @@ +50,5 @@ > self.handlers = Gtk.ListStore(str, str) > > + self.window = None > + > + def _activate_cb(self, data): Hm, I didn't think you needed this but I can see now why you did it. Perhaps this is a GLib bug given your NON_UNIQUE flag is there. Oh well. @@ +59,2 @@ > self.window = Gtk.Window() > + self.window.connect('delete-event', lambda *ignored: self.quit()) You don't need this. Gtk.Application.add_window means it'll listen to this window and quit the app if there are no more windows. Created attachment 59850 [details] [review] [6/7] dialler: don't connect to delete-event Jonny pointed out that GtkApplication handles this for you. Created attachment 59851 [details] [review] [7/7] Override GApplication.activate() rather than using the signal --- It turns out GIO warns if you don't either override activate() or connect to the signal. I think overriding the method is a bit nicer so let's do that. It seems that non-unique apps don't take a well-known bus name, but can still be Activate()d if you know or find out their D-Bus unique name, so you're still expected to implement activate() as something sensible and (for simple apps) idempotent. I'll squash everything that touches dialler.py (patches 4 and up) into patch 1 once reviewed. Both those patches look good. Fixed in git for 0.19.0 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.
Created attachment 59727 [details] the example dialler in use When developing call UIs sometimes it's useful to have a way to initiate a call independently of the usual Handler. So, I wrote a simple Python dialler. I think it could be a useful thing to have in telepathy-glib's examples/.