Set placeholder text to original artist/album/etc

This commit is contained in:
craig
2012-02-13 21:05:19 +00:00
parent 36fffa334f
commit db36b4b0d0
3 changed files with 36 additions and 0 deletions

View File

@@ -442,6 +442,7 @@ void TagEditor::setIndex(int idx)
Song s=edited.at(!haveMultiple || idx==0 ? 0 : idx);
setSong(s);
currentSongIndex=idx;
setPlaceholderTexts();
bool isMultiple=haveMultiple && 0==idx;
title->setEnabled(!isMultiple);
@@ -496,6 +497,32 @@ void TagEditor::applyUpdates()
}
}
void TagEditor::setPlaceholderTexts()
{
bool isAll=0==currentSongIndex && original.count()>1;
if (isAll) {
Song all=original.at(0);
if (!all.artist.isEmpty()) {
artist->setPlaceholderText(all.artist);
}
if (!all.album.isEmpty()) {
album->setPlaceholderText(all.album);
}
if (!all.albumartist.isEmpty()) {
albumArtist->setPlaceholderText(all.albumartist);
}
if (!all.genre.isEmpty()) {
genre->setPlaceholderText(all.genre);
}
} else {
artist->setPlaceholderText(QString());
album->setPlaceholderText(QString());
albumArtist->setPlaceholderText(QString());
genre->setPlaceholderText(QString());
}
}
#ifdef ENABLE_KDE_SUPPORT
void TagEditor::slotButtonClicked(int button)
{