Set placeholder text to original artist/album/etc
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user