def __init__(self, config, linkcolor, on_link_click_cb, get_playing_song, TAB_INFO, on_image_activate, on_image_motion_cb, on_image_drop_cb, album_return_artist_and_tracks, add_tab): self.logger = logging.getLogger(__name__) self.config = config self.linkcolor = linkcolor self.on_link_click_cb = on_link_click_cb self.get_playing_song = get_playing_song self.album_return_artist_and_tracks = album_return_artist_and_tracks self.last_bitrate = None self.info_boxes_in_more = None self._editlabel = None self.info_left_label = None self.info_lyrics = None self._morelabel = None self._searchlabel = None self.lyrics_text = None self.album_text = None self.active = False # Info tab self.builder = ui.builder('info') self.css_provider = ui.css_provider('info') self.info_area = self.builder.get_object('info_page_scrolledwindow') self.tab_label_widget = self.builder.get_object('info_tab_eventbox') tab_label = self.builder.get_object('info_tab_label') tab_label.set_text(TAB_INFO) self.tab = add_tab(self.info_area, self.tab_label_widget, TAB_INFO, self.info_area) self._imagebox = self.builder.get_object('info_page_song_eventbox') self.image = self.builder.get_object('info_page_song_image') self.image.set_from_icon_set(ui.icon('sonata-cd-large'), -1) self._imagebox.drag_dest_set(Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, [Gtk.TargetEntry.new("text/uri-list", 0, 80), Gtk.TargetEntry.new("text/plain", 0, 80)], Gdk.DragAction.DEFAULT) self._imagebox.connect('button_press_event', on_image_activate) self._imagebox.connect('drag_motion', on_image_motion_cb) self._imagebox.connect('drag_data_received', on_image_drop_cb) self._widgets_initialize()
def __init__(self, config, linkcolor, on_link_click_cb, get_playing_song, TAB_INFO, on_image_activate, on_image_motion_cb, on_image_drop_cb, album_return_artist_and_tracks, add_tab): self.logger = logging.getLogger(__name__) self.config = config self.linkcolor = linkcolor self.on_link_click_cb = on_link_click_cb self.get_playing_song = get_playing_song self.album_return_artist_and_tracks = album_return_artist_and_tracks self.last_bitrate = None self.info_boxes_in_more = None self._editlabel = None self.info_left_label = None self.info_lyrics = None self._morelabel = None self._searchlabel = None self.lyrics_text = None self.album_text = None self.active = False # Info tab self.builder = ui.builder('info') self.css_provider = ui.css_provider('info') self.info_area = self.builder.get_object('info_page_scrolledwindow') self.tab_label_widget = self.builder.get_object('info_tab_eventbox') tab_label = self.builder.get_object('info_tab_label') tab_label.set_text(TAB_INFO) self.tab = add_tab(self.info_area, self.tab_label_widget, TAB_INFO, self.info_area) self._imagebox = self.builder.get_object('info_page_song_eventbox') self.image = self.builder.get_object('info_page_song_image') self.image.set_from_icon_set(ui.icon('sonata-cd-large'), -1) self._imagebox.drag_dest_set( Gtk.DestDefaults.HIGHLIGHT | Gtk.DestDefaults.DROP, [ Gtk.TargetEntry.new("text/uri-list", 0, 80), Gtk.TargetEntry.new("text/plain", 0, 80) ], Gdk.DragAction.DEFAULT) self._imagebox.connect('button_press_event', on_image_activate) self._imagebox.connect('drag_motion', on_image_motion_cb) self._imagebox.connect('drag_data_received', on_image_drop_cb) self._widgets_initialize()
def on_artwork_reset(self, artwork_obj): self.image.set_from_icon_set(ui.icon('sonata-cd-large'), -1)