From 442385376dc9c105814aa0a139e52c0338cfe26c Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 4 May 2012 10:56:48 +0200 Subject: [PATCH] GUI: add error dialog from spell_w when db cant be opened --- src/qtgui/main.cpp | 5 +++-- src/qtgui/spell_w.cpp | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/qtgui/main.cpp b/src/qtgui/main.cpp index aa0fc192..2e358ca9 100644 --- a/src/qtgui/main.cpp +++ b/src/qtgui/main.cpp @@ -122,9 +122,10 @@ bool maybeOpenDb(string &reason, bool force, bool *maindberror) } Rcl::Db::OpenError error; if (!rcldb->isopen() && !rcldb->open(Rcl::Db::DbRO, &error)) { - reason = "Could not open database in " + - theconfig->getDbDir() + " wait for indexing to complete?"; + reason = "Could not open database"; if (maindberror) { + reason += " in " + theconfig->getDbDir() + + " wait for indexing to complete?"; *maindberror = (error == Rcl::Db::DbOpenMainDb) ? true : false; } return false; diff --git a/src/qtgui/spell_w.cpp b/src/qtgui/spell_w.cpp index 0a4b826d..62020a37 100644 --- a/src/qtgui/spell_w.cpp +++ b/src/qtgui/spell_w.cpp @@ -115,6 +115,7 @@ void SpellW::doExpand() string reason; if (!maybeOpenDb(reason)) { + QMessageBox::critical(0, "Recoll", QString(reason.c_str())); LOGDEB(("SpellW::doExpand: db error: %s\n", reason.c_str())); return; }