Skip to content

Commit

Permalink
ticket:5778 Fixed users guide links
Browse files Browse the repository at this point in the history
  • Loading branch information
adeas31 committed Jan 16, 2020
1 parent 027cb75 commit 130bcac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 28 deletions.
32 changes: 8 additions & 24 deletions OMEdit/OMEdit/OMEditGUI/MainWindow.cpp
Expand Up @@ -2637,11 +2637,11 @@ void MainWindow::openConfigurationOptions()
void MainWindow::openUsersGuide()
{
QUrl usersGuidePath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/OpenModelicaUsersGuide/index.html"));
.append("/share/doc/omc/index.html"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand All @@ -2656,24 +2656,8 @@ void MainWindow::openUsersGuidePdf()
.append("/share/doc/omc/OpenModelicaUsersGuide-latest.pdf"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

/*!
* \brief MainWindow::openUsersGuideOldPdf
* Slot activated when mpUsersGuideOldPdfAction triggered signal is raised.\n
* Opens the old pdf versions of OpenModelica users guide.
*/
void MainWindow::openUsersGuideOldPdf()
{
QUrl usersGuidePath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/OpenModelicaUsersGuide.pdf"));
if (!QDesktopServices::openUrl(usersGuidePath)) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand All @@ -2685,11 +2669,11 @@ void MainWindow::openUsersGuideOldPdf()
void MainWindow::openSystemDocumentation()
{
QUrl systemDocumentationPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/SystemDocumentation/OpenModelicaSystem.pdf"));
.append("/share/doc/omc/OpenModelicaSystem.pdf"));
if (!QDesktopServices::openUrl(systemDocumentationPath)) {
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(systemDocumentationPath.toString()),
Helper::scriptingKind, Helper::errorLevel));
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(systemDocumentationPath.toString()),
Helper::scriptingKind, Helper::errorLevel));
}
}

Expand Down
1 change: 0 additions & 1 deletion OMEdit/OMEdit/OMEditGUI/MainWindow.h
Expand Up @@ -521,7 +521,6 @@ public slots:
void openConfigurationOptions();
void openUsersGuide();
void openUsersGuidePdf();
void openUsersGuideOldPdf();
void openSystemDocumentation();
void openOpenModelicaScriptingDocumentation();
void openModelicaDocumentation();
Expand Down
4 changes: 2 additions & 2 deletions OMEdit/OMEdit/OMEditGUI/Simulation/SimulationDialog.cpp
Expand Up @@ -2170,7 +2170,7 @@ void SimulationDialog::enableDasslIdaOptions(QString method)
void SimulationDialog::showIntegrationHelp()
{
QUrl integrationAlgorithmsPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/OpenModelicaUsersGuide/simulationflags.html#integration-methods"));
.append("/share/doc/omc/simulationflags.html#integration-methods"));
if (!QDesktopServices::openUrl(integrationAlgorithmsPath)) {
QString errorMessage = GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(integrationAlgorithmsPath.toString());
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, errorMessage, Helper::scriptingKind, Helper::errorLevel));
Expand Down Expand Up @@ -2257,7 +2257,7 @@ void SimulationDialog::browseDataReconciliationInputFile()
void SimulationDialog::showSimulationFlagsHelp()
{
QUrl integrationAlgorithmsPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/OpenModelicaUsersGuide/simulationflags.html"));
.append("/share/doc/omc/simulationflags.html"));
if (!QDesktopServices::openUrl(integrationAlgorithmsPath)) {
QString errorMessage = GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(integrationAlgorithmsPath.toString());
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, errorMessage, Helper::scriptingKind, Helper::errorLevel));
Expand Down
Expand Up @@ -247,7 +247,7 @@ void TranslationFlagsWidget::updateIndexReductionToolTip(int index)
void TranslationFlagsWidget::showTranslationFlagsHelp()
{
QUrl omcHelpTextPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
.append("/share/doc/omc/OpenModelicaUsersGuide/omchelptext.html"));
.append("/share/doc/omc/omchelptext.html"));
if (!QDesktopServices::openUrl(omcHelpTextPath)) {
QMessageBox::critical(this, QString("%1 - %2").arg(Helper::applicationName, Helper::error),
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(omcHelpTextPath.toString()), Helper::ok);
Expand Down

0 comments on commit 130bcac

Please sign in to comment.