Exemple #1
0
    def __init__(self, controls):
        Gtk.Frame.__init__(self)
        FControl.__init__(self, controls)

        self.album_label = Gtk.Label()
        self.album_label.set_line_wrap(True)
        self.album_label.set_markup("<b></b>")
        self.set_label_widget(self.album_label)

        self.empty = TextArea()

        self.best_songs = SimpleTreeControl(_("Best Songs"), controls)
        self.best_songs.line_title = EventLabel(self.best_songs.get_title(),
                                                func=self.show_current,
                                                arg=self.best_songs,
                                                func1=self.show_best_songs)

        self.artists = SimpleTreeControl(_("Similar Artists"), controls)
        self.artists.line_title = EventLabel(self.artists.get_title(),
                                             func=self.show_current,
                                             arg=self.artists,
                                             func1=self.show_similar_artists)

        self.tracks = SimpleTreeControl(_("Similar Songs"), controls)
        self.tracks.line_title = EventLabel(self.tracks.get_title(),
                                            func=self.show_current,
                                            arg=self.tracks,
                                            func1=self.show_similar_tracks)

        self.tags = SimpleTreeControl(_("Similar Tags"), controls)
        self.tags.line_title = EventLabel(self.tags.get_title(),
                                          func=self.show_current,
                                          arg=self.tags,
                                          func1=self.show_similar_tags)

        self.lyrics = TextArea()
        lyric_title = _("Lyrics")
        self.lyrics.set_text("", lyric_title)
        self.lyrics.line_title = EventLabel(lyric_title,
                                            func=self.show_current,
                                            arg=self.lyrics,
                                            func1=self.show_similar_lyrics)
        """wiki"""
        wBox = Gtk.VBox()
        wiki_title = _("About Artist")
        self.wiki = TextArea()

        wBox.line_title = EventLabel(wiki_title,
                                     func=self.show_current,
                                     arg=wBox,
                                     func1=self.show_wiki_info)
        """info"""
        info_frame = Gtk.Frame(label=_("Info"))

        self.last_fm_label = Gtk.LinkButton("http://www.last.fm", "Last.Fm")
        self.wiki_label = Gtk.LinkButton("http://www.wikipedia.org",
                                         "Wikipedia")

        info_line = HBoxDecoratorTrue(self.last_fm_label, self.wiki_label)
        info_frame.add(info_line)
        """downloads"""
        dm_frame = Gtk.Frame(label=_("Downloads"))

        self.exua_label = Gtk.LinkButton("http://www.ex.ua", "EX.ua")
        self.rutracker_label = Gtk.LinkButton("http://rutracker.org",
                                              "Rutracker")

        dm_line = HBoxDecoratorTrue(self.exua_label, self.rutracker_label)
        dm_frame.add(dm_line)

        self.wiki = TextArea()
        self.wiki.set_text("", wiki_title)

        wBox.pack_start(HBoxDecoratorTrue(info_frame, dm_frame), False, False,
                        0)
        wBox.pack_start(self.wiki, True, True, 0)

        wBox.scroll = wBox

        self.vpaned_small = Gtk.VBox(False, 0)
        """image and similar artists"""
        ibox = Gtk.HBox(False, 0)
        self.image = ImageBase(ICON_BLANK_DISK, FC().info_panel_image_size)

        lbox = Gtk.VBox(False, 0)

        self.left_widget = [
            wBox, self.artists, self.tracks, self.tags, self.lyrics,
            self.best_songs
        ]

        for l_widget in self.left_widget:
            lbox.pack_start(l_widget.line_title, True, True, 0)

        ibox.pack_start(self.image, False, False, 0)
        ibox.pack_start(lbox, True, True, 0)
        """image and similar artists"""
        sbox = Gtk.VBox(False, 0)

        for l_widget in self.left_widget:
            sbox.pack_start(l_widget.scroll, True, True, 0)

        sbox.pack_end(self.empty.scroll, True, True, 0)

        self.vpaned_small.pack_start(ibox, False, False, 0)
        self.vpaned_small.pack_start(sbox, True, True, 0)

        self.add(self.vpaned_small)

        self.bean = None
        self.info_cache = InfoCache()
        self.update_lock = threading.Lock()
        self.clear()
Exemple #2
0
    def __init__(self, controls):
        self.controls = controls
        box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        box.hide()
        '''static_icon'''
        self.static_icon = IconBlock(_("Icon"), controls,
                                     FC().static_icon_entry)
        """dynamic icons"""
        self.play_icon = IconBlock(_("Play"), controls, FC().play_icon_entry)
        self.pause_icon = IconBlock(_("Pause"), controls,
                                    FC().pause_icon_entry)
        self.stop_icon = IconBlock(_("Stop"), controls, FC().stop_icon_entry)
        self.radio_icon = IconBlock(_("Radio"), controls,
                                    FC().radio_icon_entry)

        self.hide_in_tray_on_start = Gtk.CheckButton.new_with_label(
            _("Hide player in tray on start"))
        self.tray_icon_button = Gtk.CheckButton.new_with_label(
            _("Show tray icon"))
        #self.tray_icon_button.connect("clicked", self.on_show_tray_icon)

        self.close_button = Gtk.RadioButton.new_with_label(
            None, _("On close window - close player"))

        self.hide_button = Gtk.RadioButton.new_with_label_from_widget(
            self.close_button, _("On close window - hide player"))
        self.hide_button.connect("toggled", self.on_show_tray_icon)

        self.minimize_button = Gtk.RadioButton.new_with_label_from_widget(
            self.close_button, _("On close window - minimize player"))
        """system icon"""
        self.static_tray_icon = ChooseDecorator(
            None,
            FrameDecorator(_("System Icon Static"), self.static_icon, 0.5,
                           0.5))
        """dynamic icons"""
        line = VBoxDecorator(self.play_icon, self.pause_icon, self.stop_icon,
                             self.radio_icon)

        self.icon_controls = ChooseDecorator(
            self.static_tray_icon.get_radio_button(),
            FrameDecorator(_("System Icons Dynamic"), line, 0.5, 0.5))
        """disc image icon"""
        image = ImageBase(ICON_BLANK_DISK, 30)
        self.change_tray_icon = ChooseDecorator(
            self.static_tray_icon.get_radio_button(),
            FrameDecorator(_("Disc cover image"), image, 0.5, 0.5))

        self.notifier = Gtk.CheckButton.new_with_label(
            _("Notification pop-up"))
        self.notifier.connect("toggled", self.on_toggle)

        self.n_time = self.notify_time()

        box.pack_start(self.hide_in_tray_on_start, False, True, 0)
        box.pack_start(self.tray_icon_button, False, True, 0)
        box.pack_start(self.close_button, False, True, 0)
        box.pack_start(self.hide_button, False, True, 0)
        box.pack_start(self.minimize_button, False, True, 0)

        box.pack_start(self.static_tray_icon, True, True, 0)
        box.pack_start(self.icon_controls, True, True, 0)
        box.pack_start(self.change_tray_icon, False, False, 0)

        notifier_box = Gtk.Box.new(Gtk.Orientation.VERTICAL, 0)
        notifier_box.pack_start(self.notifier, False, False, 0)
        notifier_box.pack_start(self.n_time, False, False, 0)
        box.pack_start(
            FrameDecorator(_("Notification"), notifier_box, 0.5, 0.5), False,
            False, 0)
        self.widget = box