From aa28db29c5510a2409f5dd53443d6ca0d9df3358 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 23 Feb 2009 19:03:32 +0100 Subject: Notify: add descriptions and tooltips for settings. --- nephilim/plugins/Notify.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'nephilim') diff --git a/nephilim/plugins/Notify.py b/nephilim/plugins/Notify.py index 3c25d13..ccfc393 100644 --- a/nephilim/plugins/Notify.py +++ b/nephilim/plugins/Notify.py @@ -12,7 +12,7 @@ NOTIFY_PRIORITY_VOLUME = 2 class winNotify(QtGui.QWidget): _timerID = None winMain = None - p =None + p = None _current_priority = 0 @@ -48,7 +48,7 @@ class winNotify(QtGui.QWidget): def mousePressEvent(self, event): self.hide() - def show(self, text, time = 3, priority = 0): + def show(self, text, time = 3000, priority = 0): if not priority >= self._current_priority: return self._current_priority = priority @@ -64,7 +64,7 @@ class winNotify(QtGui.QWidget): self.resize(self.layout().sizeHint()) self.centerH() self.setVisible(True) - self.timer.start(time*1000) + self.timer.start(time) def hide(self): if self._timerID: @@ -81,7 +81,7 @@ class winNotify(QtGui.QWidget): class Notify(Plugin): o=None DEFAULTS = {'songformat' : '$track - $artist - $title ($album) [$length]', - 'timer' : 3} + 'timer' : 3000} def __init__(self, winMain): Plugin.__init__(self, winMain, 'Notify') self.addListener('onSongChange', self.onSongChange) @@ -132,8 +132,10 @@ class Notify(Plugin): self.timer.setValidator(QtGui.QIntValidator(self.timer)) self.setLayout(QtGui.QVBoxLayout()) - self.layout().addWidget(self.format) - self.layout().addWidget(self.timer) + self._add_widget(self.format, 'Format', 'Format of notifications. All tags supported by MPD\n' + 'will be expanded to their values for current song,\n' + 'e.g. $track, $title, $artist, $album, $length, $date, etc.') + self._add_widget(self.timer, 'Duration', 'How long should notifications be displayed in ms.') self.settings.endGroup() def save_settings(self): -- cgit v1.2.3