changeset 18185:d03a6d272fee gui-release

display error message in document browser when info file is missing * webinfo.cc (constructor): display a message if info file does not exist
author Torsten <ttl@justmail.de>
date Wed, 01 Jan 2014 21:29:20 +0100
parents 5f7f58866922
children 77fa327a956d
files libgui/src/qtinfo/webinfo.cc
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libgui/src/qtinfo/webinfo.cc	Wed Jan 01 18:18:34 2014 +0100
+++ b/libgui/src/qtinfo/webinfo.cc	Wed Jan 01 21:29:20 2014 +0100
@@ -94,8 +94,22 @@
 
   resize (500, 300);
 
-  set_info_path (QString::fromStdString (Vinfo_file));
+  QFileInfo info_file = QFileInfo (QString::fromStdString (Vinfo_file));
 
+  if (info_file.exists ())
+    set_info_path (QString::fromStdString (Vinfo_file));
+  else
+    { // Info file does not exist
+      _search_check_box->setEnabled (false);
+      _search_line_edit->setEnabled (false);
+
+      QTextBrowser *msg = addNewTab (tr ("Error"));
+      QString msg_text = QString ("<html><body><br><br><center><b>%1"
+                                      "</b></center></body></html>").
+                         arg (tr ("The info file %1 does not exist").
+                              arg(info_file.absoluteFilePath ()));
+      msg->setHtml (msg_text);
+    }
 }
 
 void