Skip to content

Commit 43c8902

Browse files
committed
Updated the documentation paths
1 parent 7820bc2 commit 43c8902

File tree

14 files changed

+48
-60
lines changed

14 files changed

+48
-60
lines changed

OMEdit/OMEditLIB/MainWindow.cpp

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2693,11 +2693,9 @@ void MainWindow::runOMSensPlugin()
26932693
*/
26942694
void MainWindow::openUsersGuide()
26952695
{
2696-
QUrl usersGuidePath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2697-
.append("/share/doc/omc/index.html"));
2696+
QUrl usersGuidePath (QString("file:///%1/share/doc/omc/OpenModelicaUsersGuide/index.html").arg(Helper::OpenModelicaHome));
26982697
if (!QDesktopServices::openUrl(usersGuidePath)) {
2699-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
2700-
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
2698+
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
27012699
Helper::scriptingKind, Helper::errorLevel));
27022700
}
27032701
}
@@ -2709,11 +2707,9 @@ void MainWindow::openUsersGuide()
27092707
*/
27102708
void MainWindow::openUsersGuidePdf()
27112709
{
2712-
QUrl usersGuidePath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2713-
.append("/share/doc/omc/OpenModelicaUsersGuide-latest.pdf"));
2710+
QUrl usersGuidePath (QString("file:///%1/share/doc/omc/OpenModelicaUsersGuide-latest.pdf").arg(Helper::OpenModelicaHome));
27142711
if (!QDesktopServices::openUrl(usersGuidePath)) {
2715-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
2716-
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
2712+
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(usersGuidePath.toString()),
27172713
Helper::scriptingKind, Helper::errorLevel));
27182714
}
27192715
}
@@ -2725,11 +2721,9 @@ void MainWindow::openUsersGuidePdf()
27252721
*/
27262722
void MainWindow::openSystemDocumentation()
27272723
{
2728-
QUrl systemDocumentationPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2729-
.append("/share/doc/omc/OpenModelicaSystem.pdf"));
2724+
QUrl systemDocumentationPath (QString("file:///%1/share/doc/omc/SystemDocumentation/OpenModelicaSystem.pdf").arg(Helper::OpenModelicaHome));
27302725
if (!QDesktopServices::openUrl(systemDocumentationPath)) {
2731-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
2732-
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(systemDocumentationPath.toString()),
2726+
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(systemDocumentationPath.toString()),
27332727
Helper::scriptingKind, Helper::errorLevel));
27342728
}
27352729
}
@@ -2782,13 +2776,10 @@ void MainWindow::openOMSimulatorUsersGuide()
27822776
*/
27832777
void MainWindow::openOpenModelicaTLMSimulatorDocumentation()
27842778
{
2785-
QUrl openModelicaTLMSimulatorDocumentation (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2786-
.append("/OMTLMSimulator/Documentation/OMTLMSimulator.pdf"));
2779+
QUrl openModelicaTLMSimulatorDocumentation (QString("file:///%1/OMTLMSimulator/Documentation/OMTLMSimulator.pdf").arg(Helper::OpenModelicaHome));
27872780
if (!QDesktopServices::openUrl(openModelicaTLMSimulatorDocumentation)) {
2788-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica,
2789-
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE)
2790-
.arg(openModelicaTLMSimulatorDocumentation.toString()),
2791-
Helper::scriptingKind, Helper::errorLevel));
2781+
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE)
2782+
.arg(openModelicaTLMSimulatorDocumentation.toString()), Helper::scriptingKind, Helper::errorLevel));
27922783
}
27932784
}
27942785

OMEdit/OMEditLIB/OMC/OMCProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ bool OMCProxy::initializeOMC(threadData_t *threadData)
251251
// get OpenModelica version
252252
Helper::OpenModelicaVersion = getVersion();
253253
// set OpenModelicaHome variable
254-
Helper::OpenModelicaHome = mpOMCInterface->getInstallationDirectoryPath();
254+
Helper::OpenModelicaHome = mpOMCInterface->getInstallationDirectoryPath().replace("\\", "/");
255255
#ifdef WIN32
256256
MMC_TRY_TOP_INTERNAL()
257257
omc_Main_setWindowsPaths(threadData, mmc_mk_scon(Helper::OpenModelicaHome.toUtf8().constData()));

OMEdit/OMEditLIB/Simulation/SimulationDialog.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,11 +2165,10 @@ void SimulationDialog::enableDasslIdaOptions(QString method)
21652165
*/
21662166
void SimulationDialog::showIntegrationHelp()
21672167
{
2168-
QUrl integrationAlgorithmsPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2169-
.append("/share/doc/omc/simulationflags.html#integration-methods"));
2168+
QUrl integrationAlgorithmsPath (QString("file:///%1/share/doc/omc/OpenModelicaUsersGuide/simulationflags.html#integration-methods").arg(Helper::OpenModelicaHome));
21702169
if (!QDesktopServices::openUrl(integrationAlgorithmsPath)) {
2171-
QString errorMessage = GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(integrationAlgorithmsPath.toString());
2172-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, errorMessage, Helper::scriptingKind, Helper::errorLevel));
2170+
QMessageBox::critical(this, QString("%1 - %2").arg(Helper::applicationName, Helper::error),
2171+
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(integrationAlgorithmsPath.toString()), Helper::ok);
21732172
}
21742173
}
21752174

@@ -2252,11 +2251,10 @@ void SimulationDialog::browseDataReconciliationInputFile()
22522251
*/
22532252
void SimulationDialog::showSimulationFlagsHelp()
22542253
{
2255-
QUrl integrationAlgorithmsPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
2256-
.append("/share/doc/omc/simulationflags.html"));
2257-
if (!QDesktopServices::openUrl(integrationAlgorithmsPath)) {
2258-
QString errorMessage = GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(integrationAlgorithmsPath.toString());
2259-
MessagesWidget::instance()->addGUIMessage(MessageItem(MessageItem::Modelica, errorMessage, Helper::scriptingKind, Helper::errorLevel));
2254+
QUrl simulationflagsPath (QString("file:///%1/share/doc/omc/OpenModelicaUsersGuide/simulationflags.html").arg(Helper::OpenModelicaHome));
2255+
if (!QDesktopServices::openUrl(simulationflagsPath)) {
2256+
QMessageBox::critical(this, QString("%1 - %2").arg(Helper::applicationName, Helper::error),
2257+
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(simulationflagsPath.toString()), Helper::ok);
22602258
}
22612259
}
22622260

OMEdit/OMEditLIB/Simulation/TranslationFlagsWidget.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,7 @@ void TranslationFlagsWidget::updateIndexReductionToolTip(int index)
246246
*/
247247
void TranslationFlagsWidget::showTranslationFlagsHelp()
248248
{
249-
QUrl omcHelpTextPath (QString("file:///").append(QString(Helper::OpenModelicaHome).replace("\\", "/"))
250-
.append("/share/doc/omc/omchelptext.html"));
249+
QUrl omcHelpTextPath (QString("file:///%1/share/doc/omc/OpenModelicaUsersGuide/omchelptext.html").arg(Helper::OpenModelicaHome));
251250
if (!QDesktopServices::openUrl(omcHelpTextPath)) {
252251
QMessageBox::critical(this, QString("%1 - %2").arg(Helper::applicationName, Helper::error),
253252
GUIMessages::getMessage(GUIMessages::UNABLE_TO_OPEN_FILE).arg(omcHelpTextPath.toString()), Helper::ok);

OMEdit/Testsuite/BrowseMSL/Test.cpp renamed to OMEdit/Testsuite/BrowseMSL/BrowseMSL.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @author Adeel Asghar <adeel.asghar@liu.se>
3333
*/
3434

35-
#include "Test.h"
35+
#include "BrowseMSL.h"
3636
#include "Util.h"
3737
#include "OMEditApplication.h"
3838
#include "MainWindow.h"
@@ -43,13 +43,13 @@ extern "C" {
4343
#include "meta/meta_modelica.h"
4444
}
4545

46-
OMEDITTEST_MAIN(Test)
46+
OMEDITTEST_MAIN(BrowseMSL)
4747

4848
/*!
4949
* \brief Test::electricalAnalogBasic
5050
* Browses the Modelica.Electrical.Analog.Basic
5151
*/
52-
void Test::electricalAnalogBasic()
52+
void BrowseMSL::electricalAnalogBasic()
5353
{
5454
if (!Util::expandLibraryTreeItemParentHierarchy(MainWindow::instance()->getLibraryWidget()->getLibraryTreeModel()->findLibraryTreeItem("Modelica.Electrical.Analog.Basic"))) {
5555
QFAIL("Expanding to Modelica.Electrical.Analog.Basic failed.");
@@ -61,7 +61,7 @@ void Test::electricalAnalogBasic()
6161
* \brief Test::mediaAir
6262
* Browses the Modelica.Media.Air
6363
*/
64-
void Test::mediaAir()
64+
void BrowseMSL::mediaAir()
6565
{
6666
OMEDITTEST_SKIP("Enable this testcase by removing this line once the ticket#5669 (https://trac.openmodelica.org/OpenModelica/ticket/5669) is fixed.");
6767
if (!Util::expandLibraryTreeItemParentHierarchy(MainWindow::instance()->getLibraryWidget()->getLibraryTreeModel()->findLibraryTreeItem("Modelica.Media.Air"))) {

OMEdit/Testsuite/BrowseMSL/Test.h renamed to OMEdit/Testsuite/BrowseMSL/BrowseMSL.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@
3232
* @author Adeel Asghar <adeel.asghar@liu.se>
3333
*/
3434

35-
#ifndef TESTGUI_H
36-
#define TESTGUI_H
35+
#ifndef BROWSEMSL_H
36+
#define BROWSEMSL_H
3737

3838
#include <QObject>
3939

40-
class Test: public QObject
40+
class BrowseMSL: public QObject
4141
{
4242
Q_OBJECT
4343

@@ -46,4 +46,4 @@ private slots:
4646
void mediaAir();
4747
};
4848

49-
#endif // TESTGUI_H
49+
#endif // BROWSEMSL_H

OMEdit/Testsuite/BrowseMSL/BrowseMSL.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ include(../Common/Testsuite.pri)
3333
TARGET = BrowseMSL
3434

3535
SOURCES += ../Common/Util.cpp \
36-
Test.cpp
36+
BrowseMSL.cpp
3737

3838
HEADERS += ../Common/Util.h \
39-
Test.h
39+
BrowseMSL.h

OMEdit/Testsuite/Diagram/Test.cpp renamed to OMEdit/Testsuite/Diagram/Diagram.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @author Adeel Asghar <adeel.asghar@liu.se>
3333
*/
3434

35-
#include "Test.h"
35+
#include "Diagram.h"
3636
#include "Util.h"
3737
#include "OMEditApplication.h"
3838
#include "MainWindow.h"
@@ -43,13 +43,13 @@ extern "C" {
4343
#include "meta/meta_modelica.h"
4444
}
4545

46-
OMEDITTEST_MAIN(Test)
46+
OMEDITTEST_MAIN(Diagram)
4747

4848
/*!
4949
* \brief Test::chuaCircuit
5050
* Browses to Modelica.Electrical.Analog.Examples.ChuaCircuit and loads it diagram view.
5151
*/
52-
void Test::chuaCircuit()
52+
void Diagram::chuaCircuit()
5353
{
5454
LibraryTreeItem *pLibraryTreeItem = MainWindow::instance()->getLibraryWidget()->getLibraryTreeModel()->findLibraryTreeItem("Modelica.Electrical.Analog.Examples.ChuaCircuit");
5555
if (!pLibraryTreeItem) {

OMEdit/Testsuite/Diagram/Test.h renamed to OMEdit/Testsuite/Diagram/Diagram.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@
3232
* @author Adeel Asghar <adeel.asghar@liu.se>
3333
*/
3434

35-
#ifndef TESTGUI_H
36-
#define TESTGUI_H
35+
#ifndef DIAGRAM_H
36+
#define DIAGRAM_H
3737

3838
#include <QObject>
3939

40-
class Test: public QObject
40+
class Diagram: public QObject
4141
{
4242
Q_OBJECT
4343

4444
private slots:
4545
void chuaCircuit();
4646
};
4747

48-
#endif // TESTGUI_H
48+
#endif // DIAGRAM_H

OMEdit/Testsuite/Diagram/Diagram.pro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ include(../Common/Testsuite.pri)
3333
TARGET = Diagram
3434

3535
SOURCES += ../Common/Util.cpp \
36-
Test.cpp
36+
Diagram.cpp
3737

3838
HEADERS += ../Common/Util.h \
39-
Test.h
39+
Diagram.h

0 commit comments

Comments
 (0)