def __init__(self, exaile): EggTrayIcon.__init__(self, 'Exaile Trayicon') self.image = gtk.image_new_from_icon_name('exaile', gtk.ICON_SIZE_MENU) self.eventbox = gtk.EventBox() self.eventbox.add(self.image) self.add(self.eventbox) builder = gtk.Builder() basedir = os.path.dirname(os.path.abspath(__file__)) builder.add_from_file(os.path.join(basedir, 'drop_target_window.ui')) self.exaile = exaile self.drop_target_window = builder.get_object('drop_target_window') self.play_target = builder.get_object('play_target') self.append_target = builder.get_object('append_target') self.new_playlist_target = builder.get_object('new_playlist_target') self.description_label = builder.get_object('description_label') self._drag_motion_id = None self._drag_leave_id = None BaseTrayIcon.__init__(self, self.exaile.gui.main) self.setup_drag_destinations() self.show_all()
def connect_events(self): """ Connects various events with callbacks """ self.connect('size-allocate', self.on_size_allocate) 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.drop_target_window.connect('drag-motion', self.on_drag_motion) self.drop_target_window.connect('drag-leave', self.on_drag_leave) self.play_target.connect('drag-motion', self.on_drag_motion) self.play_target.connect('drag-data-received', self.on_drag_data_received) self.append_target.connect('drag-motion', self.on_drag_motion) self.append_target.connect('drag-data-received', self.on_drag_data_received) self.new_playlist_target.connect('drag-motion', self.on_drag_motion) self.new_playlist_target.connect('drag-data-received', self.on_drag_data_received) BaseTrayIcon.connect_events(self)
def __init__(self, exaile): EggTrayIcon.__init__(self, 'Exaile Trayicon') self.image = gtk.image_new_from_icon_name( 'exaile', gtk.ICON_SIZE_MENU) self.eventbox = gtk.EventBox() self.eventbox.add(self.image) self.add(self.eventbox) builder = gtk.Builder() basedir = os.path.dirname(os.path.abspath(__file__)) builder.add_from_file(os.path.join(basedir, 'drop_target_window.ui')) self.exaile = exaile self.drop_target_window = builder.get_object('drop_target_window') self.play_target = builder.get_object('play_target') self.append_target = builder.get_object('append_target') self.new_playlist_target = builder.get_object('new_playlist_target') self.description_label = builder.get_object('description_label') self._drag_motion_id = None self._drag_leave_id = None BaseTrayIcon.__init__(self, self.exaile.gui.main) self.setup_drag_destinations() self.show_all()
def destroy(self): """ Hides the tray icon """ EggTrayIcon.destroy(self) BaseTrayIcon.destroy(self)