--- /dev/null
+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
+
+/*
+ * Help Window class
+ *
+ * Kern Sibbald, May MMVII
+ *
+ * $Id$
+ */
+
+#include "bat.h"
+#include "help.h"
+
+Help::Help(const QString &path, const QString &file, QWidget *parent) :
+ QWidget(parent)
+{
+ setAttribute(Qt::WA_DeleteOnClose); /* Make sure we go away */
+ setAttribute(Qt::WA_GroupLeader); /* allow calling from modal dialog */
+
+ setupUi(this); /* create window */
+
+ textBrowser->setSearchPaths(QStringList() << path << ":/images");
+ textBrowser->setSource(file);
+
+ connect(textBrowser, SIGNAL(sourceChanged(const QUrl &)), this, SLOT(updateTitle()));
+ connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+ connect(homeButton, SIGNAL(clicked()), textBrowser, SLOT(home()));
+ connect(backButton, SIGNAL(clicked()), textBrowser, SLOT(backward()));
+ this->show();
+}
+
+void Help::updateTitle()
+{
+ setWindowTitle(tr("Help: %1").arg(textBrowser->documentTitle()));
+}
+
+void Help::displayFile(const QString &file)
+{
+ QString path = QApplication::applicationDirPath() + "/help";
+ new Help(path, file);
+}
--- /dev/null
+#ifndef _HELP_H_
+#define _HELP_H_
+
+/*
+ Bacula® - The Network Backup Solution
+
+ Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+
+ The main author of Bacula is Kern Sibbald, with contributions from
+ many others, a complete list can be found in the file AUTHORS.
+ This program is Free Software; you can redistribute it and/or
+ modify it under the terms of version two of the GNU General Public
+ License as published by the Free Software Foundation plus additions
+ that are listed in the file LICENSE.
+
+ This program 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 this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ 02110-1301, USA.
+
+ Bacula® is a registered trademark of John Walker.
+ The licensor of Bacula is the Free Software Foundation Europe
+ (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+ Switzerland, email:ftf@fsfeurope.org.
+*/
+
+/*
+ * Help Window class
+ *
+ * It reads an html file and displays it in a "browser" window.
+ *
+ * Kern Sibbald, May MMVII
+ *
+ * $Id$
+ */
+
+#include "bat.h"
+#include "ui_help.h"
+
+class Help : public QWidget, public Ui::helpForm
+{
+ Q_OBJECT
+
+public:
+ Help(const QString &path, const QString &file, QWidget *parent = NULL);
+ virtual ~Help() { };
+ static void displayFile(const QString &file);
+
+public slots:
+ void updateTitle();
+
+private:
+};
+
+#endif /* _HELP_H_ */