summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2013-06-02 12:00:31 +0200
committerArno <am@disconnect.de>2013-06-02 12:00:31 +0200
commit953a291517022deaf22ec682e2d0971e999508d5 (patch)
tree45e5545771f032849436ec47f8e801adc672f20a
parent721fd40222440c6e8a81f4379f894d8908772a8a (diff)
downloadSheMov-953a291517022deaf22ec682e2d0971e999508d5.tar.gz
SheMov-953a291517022deaf22ec682e2d0971e999508d5.tar.bz2
SheMov-953a291517022deaf22ec682e2d0971e999508d5.zip
Fix error message for ArchiveView
While thinking about merging items, I realized that it is not necessary. Just edit the mappings instead. However, a fallout is an error function for the TreeView.
-rw-r--r--archivemodel.cpp2
-rw-r--r--archiveview.cpp6
-rw-r--r--archiveview.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/archivemodel.cpp b/archivemodel.cpp
index 0c16c21..21ee015 100644
--- a/archivemodel.cpp
+++ b/archivemodel.cpp
@@ -97,7 +97,7 @@ bool ArchiveModel::setData(const QModelIndex &idx, const QVariant &value, int ro
QSqlError e = updateQuery.lastError();
QString databaseText = e.databaseText().isEmpty() ? tr("(none)") : e.databaseText();
QString driverText = e.driverText().isEmpty() ? tr("(none)") : e.driverText();
- QString errormsg = QString(tr("<b>Database errors:</b><br/><ul><li>driverText(): %1</li><li>databaseText(): %2</li></ul>")).arg(driverText).arg(databaseText);
+ QString errormsg = QString(tr("<b>Database error:</b><br/><ul><li>driverText(): %1</li><li>databaseText(): %2</li></ul>")).arg(driverText).arg(databaseText);
emit databaseError(errormsg);
}
return false;
diff --git a/archiveview.cpp b/archiveview.cpp
index 2e649f1..4d9e370 100644
--- a/archiveview.cpp
+++ b/archiveview.cpp
@@ -173,7 +173,7 @@ void ArchiveTree::rename(){
QModelIndex idx = currentIndex();
int nodeType = idx.data(ArchiveModel::TypeRole).toInt();
if(nodeType == ArchiveModel::SeriesPartNode){
- QMessageBox::critical(this, tr("Error"), tr("This function is not possible. Rename the Series instead!"));
+ impossible();
return;
}
QString currentName = idx.data(ArchiveModel::NameRole).toString();
@@ -185,6 +185,10 @@ void ArchiveTree::rename(){
}
}
+void ArchiveTree::impossible(const QString msg){
+ QMessageBox::critical(this, tr("Error"), msg);
+}
+
ArchiveProgressDialog::ArchiveProgressDialog(QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f){
QHBoxLayout *mainLayout = new QHBoxLayout;
mMessage = new QLabel;
diff --git a/archiveview.h b/archiveview.h
index 850794c..540db29 100644
--- a/archiveview.h
+++ b/archiveview.h
@@ -74,6 +74,7 @@ class ArchiveTree : public SmTreeView {
void rename();
private:
+ void impossible(const QString msg = tr("Unable to perform function!"));
ArchiveProxy *mProxy;
ArchiveModel *mModel;
};