FORMS += medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui
 FORMS += clients/clients.ui storage/storage.ui fileset/fileset.ui
 FORMS += joblog/joblog.ui
+FORMS += help/help.ui
 
 HEADERS += mainwin.h bat.h bat_conf.h qstd.h
 SOURCES += main.cpp bat_conf.cpp mainwin.cpp qstd.cpp
 HEADERS += joblog/joblog.h
 SOURCES += joblog/joblog.cpp
 
+# Help dialog
+HEADERS += help/help.h
+SOURCES += help/help.cpp
+
 INSTALLS += bins
 INSTALLS += confs
 
 
       tls_ctx = director->tls_ctx;
    }
    /* Timeout Hello after 15 secs */
-   btimer_t *tid = start_bsock_timer(dir, 15);
+   dir->start_timer(15);
    dir->fsend(hello, bashed_name);
 
    /* respond to Dir challenge */
 
    Dmsg1(6, ">dird: %s", dir->msg);
    if (dir->recv() <= 0) {
-      stop_bsock_timer(tid);
+      dir->stop_timer();
       bsnprintf(msg, msglen, _("Bad response to Hello command: ERR=%s\n"
                       "The Director at \"%s:%d\" is probably not running.\n"),
                     dir->bstrerror(), dir->host(), dir->port());
       return false;
    }
 
-  stop_bsock_timer(tid);
+   dir->stop_timer();
    Dmsg1(10, "<dird: %s", dir->msg);
    if (strncmp(dir->msg, OKhello, sizeof(OKhello)-1) != 0) {
       bsnprintf(msg, msglen, _("Director at \"%s:%d\" rejected Hello command\n"),
    return true;
 
 bail_out:
-   stop_bsock_timer(tid);
+   dir->stop_timer();
    bsnprintf(msg, msglen, _("Authorization problem with Director at \"%s:%d\"\n"
              "Most likely the passwords do not agree.\n"
              "If you are using TLS, there may have been a certificate validation error during the TLS handshake.\n"
 
--- /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::showFile(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 showFile(const QString &file);
+
+public slots:
+   void updateTitle();
+
+private:
+};
+
+#endif /* _HELP_H_ */
 
--- /dev/null
+<ui version="4.0" >
+ <class>helpForm</class>
+ <widget class="QWidget" name="helpForm" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>762</width>
+    <height>497</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item row="1" column="0" >
+    <widget class="QTextBrowser" name="textBrowser" />
+   </item>
+   <item row="0" column="0" >
+    <layout class="QHBoxLayout" >
+     <property name="margin" >
+      <number>0</number>
+     </property>
+     <property name="spacing" >
+      <number>6</number>
+     </property>
+     <item>
+      <widget class="QPushButton" name="homeButton" >
+       <property name="text" >
+        <string>&Home</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="backButton" >
+       <property name="text" >
+        <string>&Back</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <spacer>
+       <property name="orientation" >
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" >
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <widget class="QPushButton" name="closeButton" >
+       <property name="text" >
+        <string>Close</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
 
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<HTML>
+<HEAD>
+<TITLE>Bat User's Guide</TITLE>
+<META NAME="description" CONTENT="Bat User's Guide">
+<META NAME="keywords" CONTENT="bacula">
+<META NAME="resource-type" CONTENT="document">
+<META NAME="distribution" CONTENT="global">
+<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
+</HEAD>
+
+<BODY>
+<h1 align="center">Bat User's Guide</h1>
+<br>
+Test Bacula Administration Tool (bat) User's guide.
+<br>
+
+<br>
+Sorry no contents yet. Maybe someone would like to write this?
+
+</BODY>
+</HTML>
 
      <height>28</height>
     </rect>
    </property>
-   <widget class="QMenu" name="menuHelp" >
-    <property name="title" >
-     <string>&Help</string>
-    </property>
-    <addaction name="actionAbout_bat" />
-   </widget>
    <widget class="QMenu" name="menuEdit" >
     <property name="title" >
      <string>&Edit</string>
     <addaction name="actionPreferences" />
     <addaction name="actionSelectFont" />
    </widget>
+   <widget class="QMenu" name="menuHelp" >
+    <property name="title" >
+     <string>&Help</string>
+    </property>
+    <addaction name="actionBat_Help" />
+    <addaction name="actionAbout_bat" />
+   </widget>
    <addaction name="menuFile" />
    <addaction name="menuEdit" />
    <addaction name="menuSettings" />
     <string>Set Preferences</string>
    </property>
   </action>
+  <action name="actionBat_Help" >
+   <property name="text" >
+    <string>bat &Help</string>
+   </property>
+  </action>
  </widget>
  <resources>
   <include location="main.qrc" />
 
 #include "medialist/medialist.h"
 #include "joblist/joblist.h"
 #include "clients/clients.h"
+#include "help/help.h"
 
 /* 
  * Daemon message callback
    /* Connect signals to slots */
    connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
    connect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
+   connect(actionBat_Help, SIGNAL(triggered()), this, SLOT(help()));
    connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, 
            SLOT(treeItemClicked(QTreeWidgetItem *, int)));
    connect(treeWidget, SIGNAL(
          " interface to the Director."));
 }
 
+void MainWin::help()
+{
+   Help::showFile("index.html");
+}
+
 void MainWin::set_statusf(const char *fmt, ...)
 {
    va_list arg_ptr;
 
 public slots:
    void input_line();
    void about();
+   void help();
    void treeItemClicked(QTreeWidgetItem *item, int column);
    void labelButtonClicked();
    void runButtonClicked();
 
 
 General:
 26May07
+kes  Implement Help Browser window for bat.
 kes  Fix reload bug that reset StorageId to zero.
 25May07
 kes  Fix TLS #ifdefing when TLS turned off.