def destroy(self): """ Cleanups """ self.tooltip.destroy() QueueAdapter.destroy(self) Gtk.ToggleButton.destroy(self)
def __init__(self): Gtk.ComboBox.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.formatter = TrackFormatter('') self.model = Gtk.ListStore(object) self.set_model(self.model) self.synchronize() renderer = Gtk.CellRendererText() self.pack_start(renderer, True) self.set_cell_data_func(renderer, self.data_func) self.set_size_request(200, 0) event.add_ui_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set('plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format')
def __init__(self): Gtk.ComboBox.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.formatter = TrackFormatter('') self.model = Gtk.ListStore(object) self.set_model(self.model) self.synchronize() renderer = Gtk.CellRendererText() self.pack_start(renderer, True) self.set_cell_data_func(renderer, self.data_func) self.set_size_request(200, 0) event.add_ui_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set( 'plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format' )
def __init__(self): Gtk.ToggleButton.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.set_focus_on_click(False) self.set_size_request(200, -1) box = Gtk.Box() self.arrow = Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.OUT) box.pack_start(self.arrow, False, True, 0) self.label = Gtk.Label(label='') self.label.props.ellipsize = Pango.EllipsizeMode.END box.pack_start(self.label, True, True, 0) self.add(box) self.formatter = TrackFormatter( settings.get_option('plugin/minimode/track_title_format', '$tracknumber - $title')) self.view = PlaylistView(player.QUEUE.current_playlist, player.PLAYER) self.popup = AttachedWindow(self) self.popup.set_default_size( settings.get_option( 'plugin/minimode/' 'playlist_button_popup_width', 350), settings.get_option( 'plugin/minimode/' 'playlist_button_popup_height', 400)) scrollwindow = Gtk.ScrolledWindow() scrollwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scrollwindow.set_shadow_type(Gtk.ShadowType.IN) scrollwindow.add(self.view) self.popup.add(scrollwindow) self.popup.connect('show', self.on_popup_show) self.popup.connect('hide', self.on_popup_hide) self.popup.connect('configure-event', self.on_popup_configure_event) accel_group = Gtk.AccelGroup() key, modifier = Gtk.accelerator_parse('<Control>J') accel_group.connect(key, modifier, Gtk.AccelFlags.VISIBLE, self.on_accelerator_activate) self.popup.add_accel_group(accel_group) self.tooltip = TrackToolTip(self, player.PLAYER) self.tooltip.set_auto_update(True) if player.PLAYER.current is not None: self.label.set_text(self.formatter.format(player.PLAYER.current)) self._drag_motion_timeout_id = None self._drag_leave_timeout_id = None self.drag_dest_set( Gtk.DestDefaults.ALL, self.view.targets, Gdk.DragAction.COPY | Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE) self.connect('drag-motion', self.on_drag_motion) self.connect('drag-leave', self.on_drag_leave) self.connect('drag-data-received', self.on_drag_data_received) self.view.connect('drag-motion', self.on_drag_motion) self.view.connect('drag-leave', self.on_drag_leave) event.add_ui_callback(self.on_track_tags_changed, 'track_tags_changed') event.add_ui_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set('plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format')
def destroy(self): """ Cleanups """ QueueAdapter.destroy(self) Gtk.ComboBox.destroy(self)
def __init__(self): Gtk.ToggleButton.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.set_focus_on_click(False) self.set_size_request(200, -1) box = Gtk.Box() self.arrow = Gtk.Arrow(Gtk.ArrowType.RIGHT, Gtk.ShadowType.OUT) box.pack_start(self.arrow, False, True, 0) self.label = Gtk.Label(label='') self.label.props.ellipsize = Pango.EllipsizeMode.END box.pack_start(self.label, True, True, 0) self.add(box) self.formatter = TrackFormatter( settings.get_option( 'plugin/minimode/track_title_format', '$tracknumber - $title' ) ) self.view = PlaylistView(player.QUEUE.current_playlist, player.PLAYER) self.popup = AttachedWindow(self) self.popup.set_default_size( settings.get_option('plugin/minimode/' 'playlist_button_popup_width', 350), settings.get_option('plugin/minimode/' 'playlist_button_popup_height', 400), ) scrollwindow = Gtk.ScrolledWindow() scrollwindow.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) scrollwindow.set_shadow_type(Gtk.ShadowType.IN) scrollwindow.add(self.view) self.popup.add(scrollwindow) self.popup.connect('show', self.on_popup_show) self.popup.connect('hide', self.on_popup_hide) self.popup.connect('configure-event', self.on_popup_configure_event) accel_group = Gtk.AccelGroup() key, modifier = Gtk.accelerator_parse('<Primary>J') accel_group.connect( key, modifier, Gtk.AccelFlags.VISIBLE, self.on_accelerator_activate ) self.popup.add_accel_group(accel_group) self.tooltip = TrackToolTip(self, player.PLAYER) self.tooltip.set_auto_update(True) if player.PLAYER.current is not None: self.label.set_text(self.formatter.format(player.PLAYER.current)) self._drag_motion_timeout_id = None self._drag_leave_timeout_id = None self.drag_dest_set( Gtk.DestDefaults.ALL, self.view.targets, Gdk.DragAction.COPY | Gdk.DragAction.DEFAULT | Gdk.DragAction.MOVE, ) self.connect('drag-motion', self.on_drag_motion) self.connect('drag-leave', self.on_drag_leave) self.connect('drag-data-received', self.on_drag_data_received) self.view.connect('drag-motion', self.on_drag_motion) self.view.connect('drag-leave', self.on_drag_leave) event.add_ui_callback(self.on_track_tags_changed, 'track_tags_changed') event.add_ui_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set( 'plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format' )
def __init__(self): gtk.ToggleButton.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.set_focus_on_click(False) self.set_size_request(200, -1) box = gtk.HBox() self.arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_OUT) box.pack_start(self.arrow, expand=False) self.label = gtk.Label('') self.label.props.ellipsize = pango.ELLIPSIZE_END box.pack_start(self.label) self.add(box) self.formatter = TrackFormatter( settings.get_option('plugin/minimode/track_title_format', '$tracknumber - $title')) self.view = PlaylistView(player.QUEUE.current_playlist, player.PLAYER) self.popup = AttachedWindow(self) self.popup.set_default_size( settings.get_option('plugin/minimode/' 'playlist_button_popup_width', 350), settings.get_option('plugin/minimode/' 'playlist_button_popup_height', 400) ) scrollwindow = gtk.ScrolledWindow() scrollwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwindow.set_shadow_type(gtk.SHADOW_IN) scrollwindow.add(self.view) self.popup.add(scrollwindow) self.popup.connect('configure-event', self.on_popup_configure_event) accel_group = gtk.AccelGroup() key, modifier = gtk.accelerator_parse('<Control>J') accel_group.connect_group(key, modifier, gtk.ACCEL_VISIBLE, self.on_accelerator_activate) self.popup.add_accel_group(accel_group) self.tooltip = TrackToolTip(self, player.PLAYER) self.tooltip.set_auto_update(True) if player.PLAYER.current is not None: self.label.set_text(self.formatter.format(player.PLAYER.current)) self._drag_motion_timeout_id = None self._drag_leave_timeout_id = None self._toplevel_hide_id = None self._toplevel_window_state_event_id = None self.drag_dest_set(gtk.DEST_DEFAULT_ALL, self.view.targets, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.connect('drag-motion', self.on_drag_motion) self.connect('drag-leave', self.on_drag_leave) self.connect('drag-data-received', self.on_drag_data_received) self.view.connect('drag-motion', self.on_drag_motion) self.view.connect('drag-leave', self.on_drag_leave) event.add_callback(self.on_track_tags_changed, 'track_tags_changed') event.add_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set('plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format')
def __init__(self): gtk.ToggleButton.__init__(self) BaseControl.__init__(self) QueueAdapter.__init__(self, player.QUEUE) self.set_focus_on_click(False) self.set_size_request(200, -1) box = gtk.HBox() self.arrow = gtk.Arrow(gtk.ARROW_RIGHT, gtk.SHADOW_OUT) box.pack_start(self.arrow, expand=False) self.label = gtk.Label('') self.label.props.ellipsize = pango.ELLIPSIZE_END box.pack_start(self.label) self.add(box) self.formatter = TrackFormatter( settings.get_option('plugin/minimode/track_title_format', '$tracknumber - $title')) self.view = PlaylistView(player.QUEUE.current_playlist, player.PLAYER) self.popup = AttachedWindow(self) self.popup.set_default_size( settings.get_option( 'plugin/minimode/' 'playlist_button_popup_width', 350), settings.get_option( 'plugin/minimode/' 'playlist_button_popup_height', 400)) scrollwindow = gtk.ScrolledWindow() scrollwindow.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scrollwindow.set_shadow_type(gtk.SHADOW_IN) scrollwindow.add(self.view) self.popup.add(scrollwindow) self.popup.connect('configure-event', self.on_popup_configure_event) accel_group = gtk.AccelGroup() key, modifier = gtk.accelerator_parse('<Control>J') accel_group.connect_group(key, modifier, gtk.ACCEL_VISIBLE, self.on_accelerator_activate) self.popup.add_accel_group(accel_group) self.tooltip = TrackToolTip(self, player.PLAYER) self.tooltip.set_auto_update(True) if player.PLAYER.current is not None: self.label.set_text(self.formatter.format(player.PLAYER.current)) self._drag_motion_timeout_id = None self._drag_leave_timeout_id = None self._toplevel_hide_id = None self._toplevel_window_state_event_id = None self.drag_dest_set( gtk.DEST_DEFAULT_ALL, self.view.targets, gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_DEFAULT | gtk.gdk.ACTION_MOVE) self.connect('drag-motion', self.on_drag_motion) self.connect('drag-leave', self.on_drag_leave) self.connect('drag-data-received', self.on_drag_data_received) self.view.connect('drag-motion', self.on_drag_motion) self.view.connect('drag-leave', self.on_drag_leave) event.add_callback(self.on_track_tags_changed, 'track_tags_changed') event.add_callback(self.on_option_set, 'plugin_minimode_option_set') self.on_option_set('plugin_minimode_option_set', settings, 'plugin/minimode/track_title_format')