disabling the cd lookup when no cd device is specified

This commit is contained in:
Will
2008-01-11 23:00:26 +01:00
committed by Lukáš Lalinský
parent 60a892c21f
commit 8cdec789f1
2 changed files with 6 additions and 1 deletions

View File

@@ -372,6 +372,9 @@ class MainWindow(QtGui.QMainWindow):
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonTextUnderIcon)
else:
self.toolbar.setToolButtonStyle(QtCore.Qt.ToolButtonIconOnly)
self.cd_lookup_action.setEnabled(len(get_cdrom_drives()) > 0)
def create_toolbar(self):
self.toolbar = toolbar = self.addToolBar(_(u"&Toolbar"))

View File

@@ -38,4 +38,6 @@ else:
def get_cdrom_drives():
from picard.tagger import Tagger
tagger = Tagger.instance()
return [d.strip() for d in tagger.config.setting["cd_lookup_device"].split(",")]
# Need to filter out empty strings, particularly if the device list is empty
return filter(lambda string: (string != u''),
[d.strip() for d in tagger.config.setting["cd_lookup_device"].split(",")])