Skip to content
Snippets Groups Projects
Commit 2a5551f3 authored by Oliver Bock's avatar Oliver Bock
Browse files

Added help dialog using per-language HTML file resources (for offline availability)

parent 228b0f10
No related branches found
No related tags found
No related merge requests found
...@@ -21,16 +21,21 @@ TEMPLATE = app ...@@ -21,16 +21,21 @@ TEMPLATE = app
TARGET = PulsatingScience TARGET = PulsatingScience
QT += core \ QT += core \
gui \ gui \
opengl opengl \
webkit
HEADERS += src/pulsaranimationwidget.h \ HEADERS += src/pulsaranimationwidget.h \
src/pulsescopewidget.h \ src/pulsescopewidget.h \
src/pulsatingscience.h src/pulsatingscience.h \
src/pulsatingsciencehelp.h
SOURCES += src/pulsaranimationwidget.cpp \ SOURCES += src/pulsaranimationwidget.cpp \
src/pulsescopewidget.cpp \ src/pulsescopewidget.cpp \
src/pulsatingscience.cpp \ src/pulsatingscience.cpp \
src/pulsatingsciencehelp.cpp \
src/main.cpp src/main.cpp
FORMS += src/pulsatingscience.ui FORMS += src/pulsatingscience.ui \
RESOURCES += src/pulsatingscience.qrc src/pulsatingsciencehelp.ui
RESOURCES += src/pulsatingscience.qrc \
src/pulsatingsciencehelp.qrc
TS_DIR = src/resources TS_DIR = src/resources
TRANSLATIONS = src/resources/pulsatingscience_de.ts TRANSLATIONS = src/resources/pulsatingscience_de.ts
UI_DIR = src/.ui UI_DIR = src/.ui
......
...@@ -388,6 +388,12 @@ void PulsatingScience::on_dockAnimControl_topLevelChanged(bool topLevel) { ...@@ -388,6 +388,12 @@ void PulsatingScience::on_dockAnimControl_topLevelChanged(bool topLevel) {
m_animControlFloating = topLevel; m_animControlFloating = topLevel;
} }
void PulsatingScience::on_actionHelp_activated()
{
PulsatingScienceHelp help(this);
help.exec();
}
void PulsatingScience::on_actionWebsite_activated() void PulsatingScience::on_actionWebsite_activated()
{ {
QDesktopServices::openUrl(QUrl("http://www.aei.mpg.de")); QDesktopServices::openUrl(QUrl("http://www.aei.mpg.de"));
......
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <QDesktopServices> #include <QDesktopServices>
#include <QUrl> #include <QUrl>
#include "pulsatingsciencehelp.h"
#include "ui_pulsatingscience.h" #include "ui_pulsatingscience.h"
...@@ -66,6 +68,7 @@ public slots: ...@@ -66,6 +68,7 @@ public slots:
void on_dockAnimControl_visibilityChanged(bool visible); void on_dockAnimControl_visibilityChanged(bool visible);
void on_dockAnimControl_topLevelChanged(bool topLevel); void on_dockAnimControl_topLevelChanged(bool topLevel);
void on_actionHelp_activated();
void on_actionWebsite_activated(); void on_actionWebsite_activated();
void on_actionAbout_activated(); void on_actionAbout_activated();
......
/******************************************************************************
* Copyright (C) 2009 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of PulsatingScience. *
* *
* PulsatingScience is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 3 of the License. *
* *
* PulsatingScience is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/
#include "pulsatingsciencehelp.h"
PulsatingScienceHelp::PulsatingScienceHelp(QWidget *parent) : QDialog(parent), Ui::PulsatingScienceHelp()
{
setupUi(this);
if(QLocale::system().language() == QLocale::German) {
webView->setUrl(QUrl("qrc:/content/resources/help_de.html"));
}
}
PulsatingScienceHelp::~PulsatingScienceHelp()
{
}
/******************************************************************************
* Copyright (C) 2009 by Oliver Bock *
* oliver.bock[AT]aei.mpg.de *
* *
* This file is part of PulsatingScience. *
* *
* PulsatingScience is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published *
* by the Free Software Foundation, version 3 of the License. *
* *
* PulsatingScience is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with PulsatingScience. If not, see <http://www.gnu.org/licenses/>. *
* *
******************************************************************************/
#ifndef PULSATINGSCIENCEHELP_H
#define PULSATINGSCIENCEHELP_H
#include <QtGui/QDialog>
#include <QtCore/QLocale>
#include <QDebug>
#include "ui_pulsatingsciencehelp.h"
class PulsatingScienceHelp : public QDialog, private Ui::PulsatingScienceHelp
{
Q_OBJECT
public:
PulsatingScienceHelp(QWidget *parent = 0);
virtual ~PulsatingScienceHelp();
};
#endif /* PULSATINGSCIENCEHELP_H */
<RCC>
<qresource prefix="content" >
<file>resources/help_en.html</file>
<file>resources/help_de.html</file>
</qresource>
<qresource prefix="icons" >
<file>resources/aei-icon48.png</file>
</qresource>
</RCC>
<ui version="4.0" >
<class>PulsatingScienceHelp</class>
<widget class="QDialog" name="PulsatingScienceHelp" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle" >
<string>Pulsating Science - Help</string>
</property>
<property name="windowIcon" >
<iconset resource="pulsatingsciencehelp.qrc" >
<normaloff>:/icons/resources/aei-icon48.png</normaloff>:/icons/resources/aei-icon48.png</iconset>
</property>
<layout class="QGridLayout" name="gridLayout" >
<item row="1" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::Ok</set>
</property>
<property name="centerButtons" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="0" >
<widget class="QWebView" name="webView" >
<property name="url" >
<url>
<string>qrc:/content/resources/help_en.html</string>
</url>
</property>
</widget>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QWebView</class>
<extends>QWidget</extends>
<header>QtWebKit/QWebView</header>
</customwidget>
</customwidgets>
<resources>
<include location="pulsatingsciencehelp.qrc" />
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PulsatingScienceHelp</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PulsatingScienceHelp</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
<html>
<body>
<h2>Pulsierende Wissenschaft - Hilfe</h2>
Fortsetzung folgt...
</body>
</html>
<html>
<body>
<h2>Pulsating Science - Help</h2>
To be continued...
</body>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment