Example #1
0
    def __init__(self):
        _BaseList.__init__(self)
        (self.COL_ICON, self.COL_NAME, self.COL_INFO, self.COL_ID) = range(4)
        self.__store = gtk.ListStore(gtk.gdk.Pixbuf, str, str, int)

        self.set_model(self.__store)

        icon = gtk.TreeViewColumn('Icon')
        self.append_column(icon)
        cell = gtk.CellRendererPixbuf()
        icon.pack_start(cell, True)
        icon.add_attribute(cell, 'pixbuf', self.COL_ICON)

        col = gtk.TreeViewColumn('Name')
        self.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'text', self.COL_NAME)

        col = gtk.TreeViewColumn('Info')
        self.append_column(col)
        cell = gtk.CellRendererText()
        cell.set_property('xalign', 1.0)
        col.pack_start(cell, True)
        col.add_attribute(cell, 'text', self.COL_INFO)

        self.set_search_column(self.COL_NAME)
        col.set_sort_column_id(self.COL_NAME)

        postoffice.connect('album-cover', self, self.on_album_cover)
Example #2
0
 def __init__(self):
     _Player.__init__(self)
     self.time_format = gst.Format(gst.FORMAT_TIME)
     self.player = None
     self.filesrc = None
     self.filesrc_property = None
     self.volume_control = None
     self.volume_multiplier = 1.
     self.volume_property = None
     self.eos_callback = lambda: self.stop()
     postoffice.connect('settings-changed', self, self.on_settings_changed)
Example #3
0
    def __init__(self, album):
        hildon.StackableWindow.__init__(self)
        self.set_title(album.artist_name)
        self.album = album
        self.fetcher = None

        self.connect("destroy", self.on_destroy)

        top_hbox = gtk.HBox()
        vbox1 = gtk.VBox()
        self.cover = gtk.Image()
        tmp = util.find_resource("album.png")
        if tmp:
            self.cover.set_from_file(tmp)
        self.bbox = gtk.HButtonBox()
        self.bbox.set_property("layout-style", gtk.BUTTONBOX_SPREAD)
        self.goto_artist = self.make_imagebutton("artist", self.on_goto_artist)
        self.download = self.make_imagebutton("download", self.on_download)
        self.favorite = self.make_imagebutton("favorite", self.on_favorite)
        self.license = self.make_imagebutton("license", self.on_license)

        vbox2 = gtk.VBox()
        self.albumname = gtk.Label()
        self.albumname.set_markup("<big>%s</big>" % (cgi.escape(album.name)))
        self.trackarea = hildon.PannableArea()

        self.tracks = TrackList(numbers=True)
        self.tracks.connect("row-activated", self.row_activated)

        self.tracklist = []
        # self.tracklist = jamaendo.get_tracks(album.ID)
        # for track in self.tracklist:
        # self.tracks.add_track(track)

        top_hbox.pack_start(vbox1, False)
        top_hbox.pack_start(vbox2, True)
        vbox1.pack_start(self.cover, True)
        vbox1.pack_start(self.bbox, False)
        self.bbox.add(self.goto_artist)
        self.bbox.add(self.download)
        self.bbox.add(self.favorite)
        self.bbox.add(self.license)
        vbox2.pack_start(self.albumname, False)
        vbox2.pack_start(self.trackarea, True)
        self.trackarea.add(self.tracks)

        self.add(top_hbox)

        postoffice.connect("album-cover", self, self.on_album_cover)
        postoffice.notify("request-album-cover", self.album.ID, 300)

        self.create_menu()
        self.start_track_fetcher()
Example #4
0
File: ui.py Project: krig/jamaendo
    def create_window(self):
        log.debug("Creating main window...")
        self.app = hildon.Program()
        self.window = hildon.StackableWindow()
        self.app.add_window(self.window)

        self.window.set_title("jamaendo")

        self.window.connect("destroy", self.destroy)

        self.CONFDIR = os.path.expanduser('~/MyDocs/.jamaendo')
        jamaendo.set_cache_dir(self.CONFDIR)
        settings.set_filename(os.path.join(self.CONFDIR, 'ui_settings'))
        settings.load()

        postoffice.connect('request-album-cover', self, self.on_request_cover)
        postoffice.connect('request-images', self, self.on_request_images)
        log.debug("Created main window.")
Example #5
0
    def __init__(self):
        _BaseList.__init__(self)
        (self.COL_ICON, self.COL_NAME, self.COL_ID, self.COL_IMAGE) = range(4)
        self.__store = gtk.ListStore(gtk.gdk.Pixbuf, str, int, str)
        self.set_model(self.__store)

        icon = gtk.TreeViewColumn('Icon')
        self.append_column(icon)
        cell = gtk.CellRendererPixbuf()
        icon.pack_start(cell, True)
        icon.add_attribute(cell, 'pixbuf', self.COL_ICON)

        col = gtk.TreeViewColumn('Name')
        self.append_column(col)
        cell = gtk.CellRendererText()
        col.pack_start(cell, True)
        col.add_attribute(cell, 'text', self.COL_NAME)
        self.set_search_column(self.COL_NAME)
        col.set_sort_column_id(self.COL_NAME)

        postoffice.connect('images', self, self.on_images)
Example #6
0
 def start(self):
     postoffice.connect('fetch', self, self._on_item_cb)
     postoffice.connect('fetch-ok', self, self._on_ok_cb)
     postoffice.connect('fetch-fail', self, self._on_fail_cb)
     if isinstance(self.owner, gtk.Window):
         hildon.hildon_gtk_window_set_progress_indicator(self.owner, 1)
     self.worker = _Worker(self.generator, self.owner)
     self.worker.start()
Example #7
0
    def __init__(self):
        hildon.StackableWindow.__init__(self)
        self.set_title("Playlists")
        self.connect('destroy', self.on_destroy)

        #self.deltoolbar = hildon.EditToolbar("Choose playlists to delete", "Delete")
        #self.set_edit_toolbar(self.deltoolbar)
        #self.deltoolbar.connect("button-clicked", self.on_delete_button)
        #self.deltoolbar.connect_swapped("arrow-clicked", gtk.widget_destroy, window)

        self.panarea = hildon.PannableArea()
        self.playlistlist = PlaylistList()
        self.playlistlist.loading_message = "Loading playlists"
        self.playlistlist.empty_message = "No playlists found"
        self.playlistlist.connect('row-activated', self.row_activated)
        self.panarea.add(self.playlistlist)
        self.add(self.panarea)

        self.populate()

        self.create_menu()

        postoffice.connect('settings-changed', self, self.settings_changed)
Example #8
0
    def __init__(self, plname, playlist):
        hildon.StackableWindow.__init__(self)
        self.set_title(plname)
        self.playlist_name = plname
        self.playlist = playlist
        self.fetcher = None

        self.connect('destroy', self.on_destroy)

        top_hbox = gtk.HBox()
        vbox1 = gtk.VBox()
        self.cover = gtk.Image()
        tmp = util.find_resource('album.png')
        if tmp:
            self.cover.set_from_file(tmp)

        vbox2 = gtk.VBox()
        self.trackarea = hildon.PannableArea()
        self.tracks = TrackList(numbers=True)
        self.tracks.connect('row-activated', self.row_activated)
        self.tracklist = []

        top_hbox.pack_start(vbox1, False)
        top_hbox.pack_start(vbox2, True)
        vbox1.pack_start(self.cover, True)
        vbox2.pack_start(self.trackarea, True)
        self.trackarea.add(self.tracks)

        self.add(top_hbox)

        postoffice.connect('album-cover', self, self.on_album_cover)
        if len(self.playlist) > 0:
            postoffice.notify('request-album-cover', int(self.playlist[0].album_id), 300)

        self.create_menu()
        self.start_track_fetcher()