diff --git a/pulsatingscience.pro b/pulsatingscience.pro index cadfd705940d94b4672722c5c822c6eb2ab7bbe6..dafb5c4517c70055d815364965d81014de336c76 100644 --- a/pulsatingscience.pro +++ b/pulsatingscience.pro @@ -21,16 +21,21 @@ TEMPLATE = app TARGET = PulsatingScience QT += core \ gui \ - opengl + opengl \ + webkit HEADERS += src/pulsaranimationwidget.h \ src/pulsescopewidget.h \ - src/pulsatingscience.h + src/pulsatingscience.h \ + src/pulsatingsciencehelp.h SOURCES += src/pulsaranimationwidget.cpp \ src/pulsescopewidget.cpp \ src/pulsatingscience.cpp \ + src/pulsatingsciencehelp.cpp \ src/main.cpp -FORMS += src/pulsatingscience.ui -RESOURCES += src/pulsatingscience.qrc +FORMS += src/pulsatingscience.ui \ + src/pulsatingsciencehelp.ui +RESOURCES += src/pulsatingscience.qrc \ + src/pulsatingsciencehelp.qrc TS_DIR = src/resources TRANSLATIONS = src/resources/pulsatingscience_de.ts UI_DIR = src/.ui diff --git a/src/pulsatingscience.cpp b/src/pulsatingscience.cpp index 7a74405bcdd329a6c759f64d9a2c9a5de995a159..030e4a1f824de485889f13854060d4b187acb169 100644 --- a/src/pulsatingscience.cpp +++ b/src/pulsatingscience.cpp @@ -388,6 +388,12 @@ void PulsatingScience::on_dockAnimControl_topLevelChanged(bool topLevel) { m_animControlFloating = topLevel; } +void PulsatingScience::on_actionHelp_activated() +{ + PulsatingScienceHelp help(this); + help.exec(); +} + void PulsatingScience::on_actionWebsite_activated() { QDesktopServices::openUrl(QUrl("http://www.aei.mpg.de")); diff --git a/src/pulsatingscience.h b/src/pulsatingscience.h index 94440069d39723f3e8e96daecb52849ea323bc01..fff74d97489547d4b1abe655ead2fb2b08e1c4d8 100644 --- a/src/pulsatingscience.h +++ b/src/pulsatingscience.h @@ -27,6 +27,8 @@ #include <QDesktopServices> #include <QUrl> +#include "pulsatingsciencehelp.h" + #include "ui_pulsatingscience.h" @@ -66,6 +68,7 @@ public slots: void on_dockAnimControl_visibilityChanged(bool visible); void on_dockAnimControl_topLevelChanged(bool topLevel); + void on_actionHelp_activated(); void on_actionWebsite_activated(); void on_actionAbout_activated(); diff --git a/src/pulsatingsciencehelp.cpp b/src/pulsatingsciencehelp.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c38f3bbcdaeaa018068d731072fb2d54f591af9c --- /dev/null +++ b/src/pulsatingsciencehelp.cpp @@ -0,0 +1,35 @@ +/****************************************************************************** + * 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() +{ + +} diff --git a/src/pulsatingsciencehelp.h b/src/pulsatingsciencehelp.h new file mode 100644 index 0000000000000000000000000000000000000000..5072d37be2eaba39a237fae888a22fe22596a835 --- /dev/null +++ b/src/pulsatingsciencehelp.h @@ -0,0 +1,40 @@ +/****************************************************************************** + * 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 */ diff --git a/src/pulsatingsciencehelp.qrc b/src/pulsatingsciencehelp.qrc new file mode 100644 index 0000000000000000000000000000000000000000..04c97052c6ac423e715eaebecaaaa0f17e27b79e --- /dev/null +++ b/src/pulsatingsciencehelp.qrc @@ -0,0 +1,9 @@ +<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> diff --git a/src/pulsatingsciencehelp.ui b/src/pulsatingsciencehelp.ui new file mode 100644 index 0000000000000000000000000000000000000000..48fb4232f9f53641ea1ab0c2b3ce0ed06003eeb4 --- /dev/null +++ b/src/pulsatingsciencehelp.ui @@ -0,0 +1,88 @@ +<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> diff --git a/src/resources/help_de.html b/src/resources/help_de.html new file mode 100644 index 0000000000000000000000000000000000000000..cc085f1925cd4b6d49cd63cd2a1160f97b797807 --- /dev/null +++ b/src/resources/help_de.html @@ -0,0 +1,6 @@ +<html> +<body> +<h2>Pulsierende Wissenschaft - Hilfe</h2> +Fortsetzung folgt... +</body> +</html> diff --git a/src/resources/help_en.html b/src/resources/help_en.html new file mode 100644 index 0000000000000000000000000000000000000000..7353e5b23b4bccdc8b45f6398566dfffc4733aa4 --- /dev/null +++ b/src/resources/help_en.html @@ -0,0 +1,6 @@ +<html> +<body> +<h2>Pulsating Science - Help</h2> +To be continued... +</body> +</html>