Ejemplo n.º 1
0
 def __init__(self, parent):
     icons = [
         kdeui.KIcon("go-bottom").pixmap(16, QtGui.QIcon.Active, QtGui.QIcon.Off),
         util.get_png("repeat_track_small"),
         util.get_png("repeat_playlist_small"),
     ]
     tooltips = ["Repeat: Off", "Repeat: Track", "Repeat: Playlist"]
     MultiIconLabel.__init__(self, parent, icons, tooltips)
Ejemplo n.º 2
0
 def __init__(self, parent):
     icons = [
         kdeui.KIcon('go-bottom').pixmap(
             16, QtGui.QIcon.Active, QtGui.QIcon.Off),
         util.get_png('repeat_track_small'),
         util.get_png('repeat_playlist_small'),
     ]
     tooltips = [
         'Repeat: Off',
         'Repeat: Track',
         'Repeat: Playlist',
     ]
     MultiIconLabel.__init__(self, parent, icons, tooltips)
Ejemplo n.º 3
0
 def __init__(self, parent):
     icons = [
         kdeui.KIcon('go-next').pixmap(
             16, QtGui.QIcon.Active, QtGui.QIcon.Off),
         util.get_png('random_small'),
     ]
     tooltips = [
         'Random mode: Off',
         'Random mode: On',
     ]
     MultiIconLabel.__init__(self, parent, icons, tooltips)
Ejemplo n.º 4
0
    def __init__(self, *args):
        kdeui.KStatusBar.__init__(self, *args)

        self.seek_to = None

        self.timer = util.QTimerWithPause(self)
        self.blink_timer = QtCore.QTimer(self)
        self.blink_timer_flag = True  # Used in slot_blink().

        self.repeat = RepeatLabel(self)
        self.random = RandomLabel(self)
        self.slider = QtGui.QSlider(QtCore.Qt.Horizontal, self)
        self.label1 = TimeLabel(self)
        self.label2 = NegativeTimeLabel(self)

        self.slider.setTracking(False)
        self.slider.setMaximumWidth(150)
        self.slider.setFocusPolicy(QtCore.Qt.NoFocus)

        self.setContentsMargins(0, 0, 4, 0)
        self.addPermanentWidget(self.repeat, 0)
        self.addPermanentWidget(self.random, 0)
        self.addPermanentWidget(self.label1, 0)
        self.addPermanentWidget(self.slider, 0)
        self.addPermanentWidget(self.label2, 0)

        self.slot_stop()
        self._connect_timer()

        self.connect(self.blink_timer,
                     QtCore.SIGNAL('timeout()'),
                     self.slot_blink)

        self.connect(self.slider,
                     QtCore.SIGNAL('sliderPressed()'),
                     lambda: self.handle_slider_event(self.SLIDER_PRESSED))

        self.connect(self.slider,
                     QtCore.SIGNAL('sliderMoved(int)'),
                     lambda x: self.handle_slider_event(self.SLIDER_MOVED, x))

        self.connect(self.slider,
                     QtCore.SIGNAL('sliderReleased()'),
                     lambda: self.handle_slider_event(self.SLIDER_RELEASED))

        self.connect(minirok.Globals.playlist,
                     QtCore.SIGNAL('new_track'),
                     self.slot_start)

        self.connect(minirok.Globals.engine,
                     QtCore.SIGNAL('status_changed'),
                     self.slot_engine_status_changed)

        self.connect(minirok.Globals.engine,
                     QtCore.SIGNAL('seek_finished'),
                     self.slot_engine_seek_finished)

        # Actions
        self.action_next_repeat_mode = util.create_action(
            'action_next_repeat_mode', 'Change repeat mode',
            self.repeat.mousePressEvent,
            QtGui.QIcon(util.get_png('repeat_track_small')), 'Ctrl+T')

        self.action_toggle_random_mode = util.create_action(
            'action_toggle_random_mode', 'Toggle random mode',
            self.random.mousePressEvent,
            QtGui.QIcon(util.get_png('random_small')), 'Ctrl+R')
Ejemplo n.º 5
0
 def __init__(self, parent):
     icons = [kdeui.KIcon("go-next").pixmap(16, QtGui.QIcon.Active, QtGui.QIcon.Off), util.get_png("random_small")]
     tooltips = ["Random mode: Off", "Random mode: On"]
     MultiIconLabel.__init__(self, parent, icons, tooltips)