diff --git a/gloss b/gloss new file mode 100755 index 0000000..4103994 --- /dev/null +++ b/gloss @@ -0,0 +1,46 @@ +#!/bin/bash +install_dir=/usr/share/gloss +version="0.1" + +print_help() +{ + echo "Usage: gloss [options]" + echo "Options:" + echo " --help Display this text" + echo " --debug Start gloss in debug mode" + echo " --theme [theme name] Force use of a certain theme" + echo " --show-themes Prints a list of available themes" + echo " --version Display the gloss version" + exit +} + +print_themes() +{ + echo "Available themes:" + ls -1 --color=never $install_dir/themes + exit +} + +print_version() +{ + echo "Gloss version $version" + exit +} + +arg_string="" +for i in $* +do + case $i in + --help ) print_help + ;; + --show-themes ) print_themes + ;; + --version ) print_version + ;; + * ) arg_string=$arg_string" "$i + + esac + +done + +python $install_dir/gloss.py $arg_string diff --git a/gloss.py b/gloss.py index a8d9fa1..8aca338 100644 --- a/gloss.py +++ b/gloss.py @@ -86,12 +86,13 @@ class MainApp: def loadGloss(self): theme = None + debug = False #loop through the args for i in range(0, len(self.args)): arg = self.args[i] if arg == "--debug": print "Using debug mode" - self.glossMgr.debug = True + debug = True elif arg == "--tests": self.show_tests = True print "Showing tests" @@ -101,9 +102,7 @@ class MainApp: #Create the Gloss Manager self.glossMgr = GlossMgr(self.stage, self.dbMgr, theme=theme) - - - + self.glossMgr.debug = debug #Update splash status msg self.splashScreen.set_msg("Creating menus") diff --git a/modules/music_player/music_object_row.py b/modules/music_player/music_object_row.py index 03c5d1b..ded8829 100644 --- a/modules/music_player/music_object_row.py +++ b/modules/music_player/music_object_row.py @@ -20,6 +20,7 @@ class MusicObjectRow(ImageRow): ImageRow.__init__(self, glossMgr, width, height, columns) self.music_player = music_player self.sleep = False + self.glossMgr = glossMgr self.objectLibrary = [] self.timeline = None @@ -42,7 +43,7 @@ class MusicObjectRow(ImageRow): start = self.loaded_objects for i in range(start, end): object = self.objectLibrary[i] - print "loading: " + object.name + if self.glossMgr.debug: print "Music_Player: loading: " + object.name if i > (self.num_columns + self.buffer): pixbuf = object.get_default_image() else: diff --git a/modules/music_player/music_objects/album.py b/modules/music_player/music_objects/album.py index 5a6b801..6e6b4fc 100644 --- a/modules/music_player/music_objects/album.py +++ b/modules/music_player/music_objects/album.py @@ -22,7 +22,7 @@ class album: pixbuf = song.get_image_from_ID3() if not pixbuf is None: return pixbuf - + #If nothing has been found return the default return self.get_default_image() diff --git a/modules/music_player/music_objects/song.py b/modules/music_player/music_objects/song.py index e0079a7..85ca87e 100644 --- a/modules/music_player/music_objects/song.py +++ b/modules/music_player/music_objects/song.py @@ -50,6 +50,7 @@ class song: def get_image_from_ID3(self): #Basic check first up to make sure the filename is set if self.filename is None: + if self.music_player.glossMgr.debug: print "Music_Player: Attempting to load ID3 image from song '%s', but have no filename to look up" % self.name return None tag = eyeD3.Tag() @@ -58,6 +59,7 @@ class song: #Make sure the file exists and we can read it if not os.access(filename, os.R_OK): + if self.music_player.glossMgr.debug: print "Music_Player: Attempting to read ID3 image on file '%s', however do not appear to have read permission" % filename return None tag.link(filename) diff --git a/modules/music_player/music_player.py b/modules/music_player/music_player.py index b9f22de..ecd85c9 100644 --- a/modules/music_player/music_player.py +++ b/modules/music_player/music_player.py @@ -282,6 +282,7 @@ class Module: def update_main_img(self, data = None): #clutter.threads_enter() + pixbuf = self.current_albums[self.list1.selected].get_image() if not pixbuf is None: self.main_img.set_pixbuf(pixbuf) diff --git a/modules/music_player/playlist.py b/modules/music_player/playlist.py index 48244ca..db4af25 100644 --- a/modules/music_player/playlist.py +++ b/modules/music_player/playlist.py @@ -1,4 +1,5 @@ import gobject +import os from multimedia.AudioController import AudioController class Playlist(gobject.GObject): @@ -43,6 +44,11 @@ class Playlist(gobject.GObject): current_song = self.songs[self.position] current_song_filename = self.musicPlayer.base_dir + "/" + current_song.directory + "/" + current_song.filename + + #Make sure the file exists and we can read it + if not os.access(current_song_filename, os.R_OK): + self.glossMgr.display_msg("Access Error", "Unable to playback file '%s'" % current_song_filename) + current_song_uri = "file://" + current_song_filename if self.glossMgr.debug: print "Music_Player: Attempting to play file '%s'" % current_song_filename self.audio_controller.play_audio(current_song_uri) diff --git a/themes/default/Gloxygen/active_bar.png b/themes/Gloxygen/active_bar.png similarity index 100% rename from themes/default/Gloxygen/active_bar.png rename to themes/Gloxygen/active_bar.png diff --git a/themes/default/Gloxygen/background.png b/themes/Gloxygen/background.png similarity index 100% rename from themes/default/Gloxygen/background.png rename to themes/Gloxygen/background.png diff --git a/themes/default/Gloxygen/dvd.xml b/themes/Gloxygen/dvd.xml similarity index 100% rename from themes/default/Gloxygen/dvd.xml rename to themes/Gloxygen/dvd.xml diff --git a/themes/default/Gloxygen/dvd/dvd.png b/themes/Gloxygen/dvd/dvd.png similarity index 100% rename from themes/default/Gloxygen/dvd/dvd.png rename to themes/Gloxygen/dvd/dvd.png diff --git a/themes/default/Gloxygen/dvd/dvd.svg b/themes/Gloxygen/dvd/dvd.svg similarity index 100% rename from themes/default/Gloxygen/dvd/dvd.svg rename to themes/Gloxygen/dvd/dvd.svg diff --git a/themes/default/Gloxygen/main.xml b/themes/Gloxygen/main.xml similarity index 100% rename from themes/default/Gloxygen/main.xml rename to themes/Gloxygen/main.xml diff --git a/themes/default/Gloxygen/music.xml b/themes/Gloxygen/music.xml similarity index 100% rename from themes/default/Gloxygen/music.xml rename to themes/Gloxygen/music.xml diff --git a/themes/default/Gloxygen/music/default_cover.png b/themes/Gloxygen/music/default_cover.png similarity index 100% rename from themes/default/Gloxygen/music/default_cover.png rename to themes/Gloxygen/music/default_cover.png diff --git a/themes/default/Gloxygen/music/music.png b/themes/Gloxygen/music/music.png similarity index 100% rename from themes/default/Gloxygen/music/music.png rename to themes/Gloxygen/music/music.png diff --git a/themes/default/Gloxygen/music/music.svg b/themes/Gloxygen/music/music.svg similarity index 100% rename from themes/default/Gloxygen/music/music.svg rename to themes/Gloxygen/music/music.svg diff --git a/themes/default/Gloxygen/music/music_blue.svg b/themes/Gloxygen/music/music_blue.svg similarity index 100% rename from themes/default/Gloxygen/music/music_blue.svg rename to themes/Gloxygen/music/music_blue.svg diff --git a/themes/default/Gloxygen/music/songlist_off.png b/themes/Gloxygen/music/songlist_off.png similarity index 100% rename from themes/default/Gloxygen/music/songlist_off.png rename to themes/Gloxygen/music/songlist_off.png diff --git a/themes/default/Gloxygen/music_play_screen.xml b/themes/Gloxygen/music_play_screen.xml similarity index 100% rename from themes/default/Gloxygen/music_play_screen.xml rename to themes/Gloxygen/music_play_screen.xml diff --git a/themes/default/Gloxygen/osd.xml b/themes/Gloxygen/osd.xml similarity index 100% rename from themes/default/Gloxygen/osd.xml rename to themes/Gloxygen/osd.xml diff --git a/themes/default/Gloxygen/osd/osd_bar.png b/themes/Gloxygen/osd/osd_bar.png similarity index 100% rename from themes/default/Gloxygen/osd/osd_bar.png rename to themes/Gloxygen/osd/osd_bar.png diff --git a/themes/default/Gloxygen/osd/osd_bar3.png b/themes/Gloxygen/osd/osd_bar3.png similarity index 100% rename from themes/default/Gloxygen/osd/osd_bar3.png rename to themes/Gloxygen/osd/osd_bar3.png diff --git a/themes/default/Gloxygen/osd/splash_box.png b/themes/Gloxygen/osd/splash_box.png similarity index 100% rename from themes/default/Gloxygen/osd/splash_box.png rename to themes/Gloxygen/osd/splash_box.png diff --git a/themes/default/Gloxygen/osd_bar.png b/themes/Gloxygen/osd_bar.png similarity index 100% rename from themes/default/Gloxygen/osd_bar.png rename to themes/Gloxygen/osd_bar.png diff --git a/themes/default/Gloxygen/osd_bar3.png b/themes/Gloxygen/osd_bar3.png similarity index 100% rename from themes/default/Gloxygen/osd_bar3.png rename to themes/Gloxygen/osd_bar3.png diff --git a/themes/default/Gloxygen/shared/down.png b/themes/Gloxygen/shared/down.png similarity index 100% rename from themes/default/Gloxygen/shared/down.png rename to themes/Gloxygen/shared/down.png diff --git a/themes/default/Gloxygen/shared/up.png b/themes/Gloxygen/shared/up.png similarity index 100% rename from themes/default/Gloxygen/shared/up.png rename to themes/Gloxygen/shared/up.png diff --git a/themes/default/Gloxygen/slideshow.xml b/themes/Gloxygen/slideshow.xml similarity index 100% rename from themes/default/Gloxygen/slideshow.xml rename to themes/Gloxygen/slideshow.xml diff --git a/themes/default/Gloxygen/slideshow/gallery.png b/themes/Gloxygen/slideshow/gallery.png similarity index 100% rename from themes/default/Gloxygen/slideshow/gallery.png rename to themes/Gloxygen/slideshow/gallery.png diff --git a/themes/default/Gloxygen/spinner.svg b/themes/Gloxygen/spinner.svg similarity index 100% rename from themes/default/Gloxygen/spinner.svg rename to themes/Gloxygen/spinner.svg diff --git a/themes/default/Gloxygen/splash_box.png b/themes/Gloxygen/splash_box.png similarity index 100% rename from themes/default/Gloxygen/splash_box.png rename to themes/Gloxygen/splash_box.png diff --git a/themes/default/Gloxygen/tv.xml b/themes/Gloxygen/tv.xml similarity index 100% rename from themes/default/Gloxygen/tv.xml rename to themes/Gloxygen/tv.xml diff --git a/themes/default/Gloxygen/tv/tv.png b/themes/Gloxygen/tv/tv.png similarity index 100% rename from themes/default/Gloxygen/tv/tv.png rename to themes/Gloxygen/tv/tv.png diff --git a/themes/default/Gloxygen/tv/tv.svg b/themes/Gloxygen/tv/tv.svg similarity index 100% rename from themes/default/Gloxygen/tv/tv.svg rename to themes/Gloxygen/tv/tv.svg diff --git a/themes/default/Gloxygen/video.xml b/themes/Gloxygen/video.xml similarity index 100% rename from themes/default/Gloxygen/video.xml rename to themes/Gloxygen/video.xml diff --git a/themes/default/Gloxygen/video_player/cover_bg.png b/themes/Gloxygen/video_player/cover_bg.png similarity index 100% rename from themes/default/Gloxygen/video_player/cover_bg.png rename to themes/Gloxygen/video_player/cover_bg.png diff --git a/themes/default/Gloxygen/video_player/cover_bg_long.png b/themes/Gloxygen/video_player/cover_bg_long.png similarity index 100% rename from themes/default/Gloxygen/video_player/cover_bg_long.png rename to themes/Gloxygen/video_player/cover_bg_long.png diff --git a/themes/default/Gloxygen/video_player/folder-video.svg b/themes/Gloxygen/video_player/folder-video.svg similarity index 100% rename from themes/default/Gloxygen/video_player/folder-video.svg rename to themes/Gloxygen/video_player/folder-video.svg diff --git a/themes/default/Gloxygen/video_player/vid_details_bg.png b/themes/Gloxygen/video_player/vid_details_bg.png similarity index 100% rename from themes/default/Gloxygen/video_player/vid_details_bg.png rename to themes/Gloxygen/video_player/vid_details_bg.png diff --git a/themes/default/Gloxygen/video_player/vid_folders_select_box.png b/themes/Gloxygen/video_player/vid_folders_select_box.png similarity index 100% rename from themes/default/Gloxygen/video_player/vid_folders_select_box.png rename to themes/Gloxygen/video_player/vid_folders_select_box.png diff --git a/themes/default/Gloxygen/video_player/video_default.svg b/themes/Gloxygen/video_player/video_default.svg similarity index 100% rename from themes/default/Gloxygen/video_player/video_default.svg rename to themes/Gloxygen/video_player/video_default.svg diff --git a/themes/default/Gloxygen/video_player/videos.png b/themes/Gloxygen/video_player/videos.png similarity index 100% rename from themes/default/Gloxygen/video_player/videos.png rename to themes/Gloxygen/video_player/videos.png diff --git a/themes/default/Gloxygen/video_player/videos.svg b/themes/Gloxygen/video_player/videos.svg similarity index 100% rename from themes/default/Gloxygen/video_player/videos.svg rename to themes/Gloxygen/video_player/videos.svg