Better message if qt help file is not found - fixes #2084
This commit is contained in:
parent
24e310ec57
commit
dd78ad7e72
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
#include "Assistant.h"
|
#include "Assistant.h"
|
||||||
#include <Base/Console.h>
|
#include <Base/Console.h>
|
||||||
|
#include <Base/FileInfo.h>
|
||||||
#include <App/Application.h>
|
#include <App/Application.h>
|
||||||
|
|
||||||
using namespace Gui;
|
using namespace Gui;
|
||||||
|
@ -96,13 +97,20 @@ bool Assistant::startAssistant()
|
||||||
QString exe = QString::fromUtf8(App::GetApplication().getExecutableName());
|
QString exe = QString::fromUtf8(App::GetApplication().getExecutableName());
|
||||||
QString doc = QString::fromUtf8(App::Application::getHelpDir().c_str());
|
QString doc = QString::fromUtf8(App::Application::getHelpDir().c_str());
|
||||||
QString qhc = doc + exe.toLower() + QLatin1String(".qhc");
|
QString qhc = doc + exe.toLower() + QLatin1String(".qhc");
|
||||||
|
|
||||||
|
Base::FileInfo fi ( (const char*)qhc.toUtf8() );
|
||||||
|
if (!fi.isReadable()) {
|
||||||
|
QMessageBox::critical(0, QObject::tr("%1 Help").arg(exe),
|
||||||
|
QObject::tr("FreeCAD help files not found (%1). You might need to install the FreeCAD documentation package.").arg(qhc));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static bool first = true;
|
static bool first = true;
|
||||||
if (first) {
|
if (first) {
|
||||||
Base::Console().Log("Help file at %s\n", (const char*)qhc.toUtf8());
|
Base::Console().Log("Help file at %s\n", (const char*)qhc.toUtf8());
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args;
|
QStringList args;
|
||||||
|
|
||||||
args << QLatin1String("-collectionFile") << qhc
|
args << QLatin1String("-collectionFile") << qhc
|
||||||
|
|
Loading…
Reference in New Issue
Block a user