X-Git-Url: http://git.maemo.org/git/?p=watersofshiloah;a=blobdiff_plain;f=src%2Fmormonchannel_gtk.py;h=a23728985ecdb8aacd6b810fe0a8f5b6deadd63c;hp=d86f226de09bc2713f2ac9ae7a31c7a98ab61669;hb=5c4d196112b6bfd6123b3e162d947fa33b97d14a;hpb=3daeae4dded6b994e3c4862b63a1f2086622bc35 diff --git a/src/mormonchannel_gtk.py b/src/mormonchannel_gtk.py index d86f226..a237289 100755 --- a/src/mormonchannel_gtk.py +++ b/src/mormonchannel_gtk.py @@ -2,28 +2,32 @@ # -*- coding: utf-8 -*- """ -@todo Restructure so there is a windows/ folder with a file per source -@todo Add additional sources -@todo Switch home icon color -@todo Switch from swappping icons on press to the pressed version of icons -@bug Fix presenter display -@todo Track recent -@todo Favorites -@todo Sequential playback -@todo Enable Call Monitor -@todo Audio seek bar -@todo Persisted Pause +@bug For some reason, the back/close button doesn't work when I nest multiple levels +@bug When switching from conference to magazines, it randomly jumps around and duplicates windows +@bug fullscreen does not propgate +@todo Update the program time shown + +@todo Re-use windows for better performance +@todo Need to confirm id's are persistent (not just for todos but broken behavior on transition) + @todo Track recent + @todo Persisted Pause + @todo Favorites +@todo Sleep timer @todo Reverse order option. Toggle between playing ascending/descending chronological order @todo Podcast integration + @todo Default with BYU Devotionals, http://speeches.byu.edu/?act=help&page=podcast """ from __future__ import with_statement +import os import gc import logging import ConfigParser import gobject +import dbus +import dbus.mainloop.glib import gtk try: @@ -49,13 +53,15 @@ class MormonChannelProgram(hildonize.get_app_class()): def __init__(self): super(MormonChannelProgram, self).__init__() - self._store = imagestore.ImageStore("../data", "../data") + currentPath = os.path.abspath(__file__) + storePath = os.path.join(os.path.split(os.path.dirname(currentPath))[0], "data") + self._store = imagestore.ImageStore(storePath, constants._cache_path_) self._index = stream_index.AudioIndex() self._player = player.Player(self._index) + self._store.start() self._index.start() try: - if not hildonize.IS_HILDON_SUPPORTED: _moduleLogger.info("No hildonization support") @@ -68,12 +74,14 @@ class MormonChannelProgram(hildonize.get_app_class()): self._osso_c = None self._deviceState = None - self._sourceSelector = windows.SourceSelector(self._player, self._store, self._index) + self._sourceSelector = windows.source.SourceSelector(self, self._player, self._store, self._index) self._sourceSelector.window.connect("destroy", self._on_destroy) + self._sourceSelector.window.set_default_size(400, 800) self._sourceSelector.show() self._load_settings() except: self._index.stop() + self._store.stop() raise def _save_settings(self): @@ -105,24 +113,26 @@ class MormonChannelProgram(hildonize.get_app_class()): @misc_utils.log_exception(_moduleLogger) def _on_destroy(self, widget = None, data = None): - self.quit() + try: + self.quit() + finally: + gtk.main_quit() def quit(self): - try: - self._save_settings() + self._save_settings() - self._index.stop() + self._player.stop() + self._index.stop() + self._store.stop() - try: - self._deviceState.close() - except AttributeError: - pass # Either None or close was removed (in Fremantle) - try: - self._osso_c.close() - except AttributeError: - pass # Either None or close was removed (in Fremantle) - finally: - gtk.main_quit() + try: + self._deviceState.close() + except AttributeError: + pass # Either None or close was removed (in Fremantle) + try: + self._osso_c.close() + except AttributeError: + pass # Either None or close was removed (in Fremantle) @misc_utils.log_exception(_moduleLogger) def _on_show_about(self, widget = None, data = None): @@ -142,8 +152,9 @@ class MormonChannelProgram(hildonize.get_app_class()): def run(): gobject.threads_init() gtk.gdk.threads_init() + l = dbus.mainloop.glib.DBusGMainLoop(set_as_default=True) - hildonize.set_application_title(constants.__pretty_app_name__) + hildonize.set_application_name("FMRadio") # Playback while silent on Maemo 5 app = MormonChannelProgram() if not PROFILE_STARTUP: try: @@ -151,6 +162,8 @@ def run(): except KeyboardInterrupt: app.quit() raise + else: + app.quit() if __name__ == "__main__":