summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <wyskas@gmail.com>2009-02-22 19:56:50 +0100
committerAnton Khirnov <wyskas@gmail.com>2009-02-22 19:56:50 +0100
commit8572742ece1f09e37281dfe260b293f5ee28678e (patch)
tree5ff70cbcb692cc92206839b8ff87d5aeaaef142f
parent48c4b4d88e762575c8a835570af374ea8e7a9037 (diff)
Add descriptions and tooltip to some settings.
-rw-r--r--nephilim/clPlugin.py8
-rw-r--r--nephilim/plugins/AlbumCover.py8
-rw-r--r--nephilim/winSettings.py15
3 files changed, 17 insertions, 14 deletions
diff --git a/nephilim/clPlugin.py b/nephilim/clPlugin.py
index efbd502..ed1ed69 100644
--- a/nephilim/clPlugin.py
+++ b/nephilim/clPlugin.py
@@ -12,7 +12,7 @@ class Plugin:
winMain = None
loaded = None
listeners = None
- mpclient = None
+ mpclient = None
DEFAULTS = {}
def __init__(self, winMain, name):
@@ -83,17 +83,17 @@ class Plugin:
class SettingsWidget(QtGui.QWidget):
""" plugins should subclass this"""
- plugin = None
+ plugin = None
settings = None
def __init__(self, plugin):
QtGui.QWidget.__init__(self)
- self.plugin = plugin
+ self.plugin = plugin
self.settings = QtCore.QSettings(ORGNAME, APPNAME)
def save_settings(self):
""" reimplement this"""
- self.plugin.saveSettings()
+ pass
def _add_widget(self, widget, label = '', tooltip = ''):
"""adds a widget with label"""
diff --git a/nephilim/plugins/AlbumCover.py b/nephilim/plugins/AlbumCover.py
index e8dd38d..27ab6df 100644
--- a/nephilim/plugins/AlbumCover.py
+++ b/nephilim/plugins/AlbumCover.py
@@ -231,9 +231,13 @@ class AlbumCover(Plugin):
self._add_widget(self.coverdir, 'Cover directory',
'Where should %s store covers.\n'
'$musicdir will be expanded to path to MPD music library\n'
- '$songdir will be expanded to path to the song (relative to $musicdir'
+ '$songdir will be expanded to path to the song (relative to $musicdir\n'
+ 'other tags same as in covername'
%APPNAME)
- self._add_widget(self.covername, 'Cover filename', 'Filename for %s cover files.'%APPNAME)
+ self._add_widget(self.covername, 'Cover filename', 'Filename for %s cover files.\n'
+ 'All tags supported by MPD will be expanded to their\n'
+ 'values for current song, e.g. $title, $track, $artist,\n'
+ '$album, $genre etc.'%APPNAME)
self.settings.endGroup()
def save_settings(self):
diff --git a/nephilim/winSettings.py b/nephilim/winSettings.py
index 4265918..9f4d804 100644
--- a/nephilim/winSettings.py
+++ b/nephilim/winSettings.py
@@ -4,6 +4,7 @@ import os
from misc import ORGNAME, APPNAME, Button, appIcon
import plugins
+import clPlugin
class winSettings(QtGui.QWidget):
@@ -15,9 +16,8 @@ class winSettings(QtGui.QWidget):
settings = None
settings_wg = []
- class SettingsWidgetMPD(QtGui.QWidget):
- mpclient = None
- settings = None
+ class SettingsWidgetMPD(clPlugin.Plugin.SettingsWidget):
+ mpclient = None
host_txt = None
port_txt = None
lib_txt = None
@@ -25,8 +25,7 @@ class winSettings(QtGui.QWidget):
outputs = None
def __init__(self, mpclient):
- QtGui.QWidget.__init__(self)
- self.settings = QtCore.QSettings(ORGNAME, APPNAME)
+ clPlugin.Plugin.SettingsWidget.__init__(self, None)
self.mpclient = mpclient
self.settings.beginGroup('MPD')
@@ -58,9 +57,9 @@ class winSettings(QtGui.QWidget):
self.outputs.layout().addWidget(box)
self.setLayout(QtGui.QVBoxLayout())
- self.layout().addWidget(self.host_txt)
- self.layout().addWidget(self.port_txt)
- self.layout().addWidget(self.lib_txt)
+ self._add_widget(self.host_txt, 'Host', 'Host or socket to connect to')
+ self._add_widget(self.port_txt, 'Port', 'Port to use (empty when using sockets)')
+ self._add_widget(self.lib_txt, 'Music library', 'Path to music library')
self.layout().addWidget(self.update)
self.layout().addWidget(self.outputs)