In Qt-builds, if we failt to update files (tag editor, replaygain) then show the list of failures in the 'detailed text' section.

This commit is contained in:
craig.p.drummond@gmail.com
2012-08-10 11:16:51 +00:00
parent 8cad9d1960
commit 3137da2bc2
5 changed files with 20 additions and 9 deletions

View File

@@ -17,6 +17,8 @@
9. If we loose MPD connection, then show error widget.
10. Reset status when connection lost.
11. Dont attempt to send commands if not connected.
12. In Qt-builds, if we failt to update files (tag editor, replaygain) then
show the list of failures in the 'detailed text' section.
0.8.2
-----

View File

@@ -680,11 +680,12 @@ void TagEditor::applyUpdates()
if (failed.count()) {
#ifdef ENABLE_KDE_SUPPORT
KMessageBox::errorList(this, i18n("Failed to update the tags of the following tracks:"), failed);
MessageBox::errorList(this, i18n("Failed to update the tags of the following tracks:"), failed);
#else
QMessageBox::warning(this, tr("Warning"), 1==failed.count()
? tr("Failed to update the tags of %1").arg(failed.at(0))
: tr("Failed to update the tags of %2 tracks").arg(failed.count()));
MessageBox::errorList(this, 1==failed.count()
? tr("Failed to update the tags of 1 track")
: tr("Failed to update the tags of %2 tracks").arg(failed.count()),
failed);
#endif
}

View File

@@ -391,11 +391,12 @@ void RgDialog::saveTags()
if (failed.count()) {
#ifdef ENABLE_KDE_SUPPORT
KMessageBox::errorList(this, i18n("Failed to update the tags of the following tracks:"), failed);
MessageBox::errorList(this, i18n("Failed to update the tags of the following tracks:"), failed);
#else
QMessageBox::warning(this, tr("Warning"), 1==failed.count()
? tr("Failed to update the tags of %1").arg(failed.at(0))
: tr("Failed to update the tags of %2 tracks").arg(failed.count()));
MessageBox::errorList(this, 1==failed.count()
? tr("Failed to update the tags of 1 track")
: tr("Failed to update the tags of %2 tracks").arg(failed.count()),
failed);
#endif
}
}

View File

@@ -67,3 +67,10 @@ MessageBox::ButtonCode MessageBox::questionYesNoCancel(QWidget *parent, const QS
return -1==box.exec() ? Cancel : map(box.standardButton(box.clickedButton()));
}
}
void MessageBox::errorList(QWidget *parent, const QString &message, const QStringList &strlist, const QString &title)
{
QMessageBox box(QMessageBox::Critical, title.isEmpty() ? QObject::tr("Error") : title, message, QMessageBox::Ok, parent);
box.setDetailedText(strlist.join("\n"));
box.exec();
}

View File

@@ -52,7 +52,7 @@ namespace MessageBox {
inline void error(QWidget *parent, const QString &message, const QString &title=QString()) {
QMessageBox::warning(parent, title.isEmpty() ? QObject::tr("Error") : title, message);
}
void errorList(QWidget *parent, const QString &message, const QStringList &strlist, const QString &title=QString());
};
#endif