|
From: Tapio V. <aa...@us...> - 2011-02-09 15:47:10
|
Module: editor
Branch: master
Commit: d63d2ba62ad96468048b41e6c155d9cd59e8167d
Author: Tapio Vierros <tap...@gm...>
Date: Wed Feb 9 17:44:12 2011 +0200
Don't ask confirmation on lyrics pasting if there's no lyrics to overwrite.
---
editorapp.cc | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/editorapp.cc b/editorapp.cc
index 3d8d6dd..6046a20 100644
--- a/editorapp.cc
+++ b/editorapp.cc
@@ -521,10 +521,12 @@ void EditorApp::on_actionLyricsFromClipboard_triggered()
if (mimeData->hasText() && !mimeData->text().isEmpty()) {
QString text = mimeData->text();
- QMessageBox::StandardButton b = QMessageBox::question(this, tr("Replace lyrics"),
- tr("Pasting lyrics from clipboard will replace the existing ones. Continue?"),
- QMessageBox::Ok | QMessageBox::Cancel);
- if (b == QMessageBox::Ok) {
+ if ((noteGraph && noteGraph->noteLabels().empty())
+ || QMessageBox::question(this, tr("Replace lyrics"),
+ tr("Pasting lyrics from clipboard will replace the existing ones. Continue?"),
+ QMessageBox::Ok | QMessageBox::Cancel)
+ == QMessageBox::Ok)
+ {
noteGraph->setLyrics(text);
}
} else {
|