From: Kern Sibbald Date: Sat, 26 May 2007 14:34:29 +0000 (+0000) Subject: Update X-Git-Tag: Release-7.0.0~6234 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=75280628b1c0257b0a3475a317e787936cb0ac5c;p=bacula%2Fbacula Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4911 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 26a7b21010..ab2ba3c6e8 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -103,10 +103,9 @@ void Console::terminate() } /* - * Connect to Director. If there are more than one, put up - * a modal dialog so that the user chooses one. + * Connect to Director. */ -void Console::connect() +void Console::connect_dir() { JCR jcr; utime_t heart_beat; @@ -233,7 +232,7 @@ void Console::connect() dir_cmd(".levels", level_list); mainWin->set_status(_("Connected")); - startTimer(); + startTimer(); /* start message timer */ return; } diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index df8e56e9db..3744bc1ec3 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -114,7 +114,7 @@ public: public slots: - void connect(); + void connect_dir(); void read_dir(int fd); int read(void); int write(const char *msg); diff --git a/bacula/src/qt-console/help/help.cpp b/bacula/src/qt-console/help/help.cpp new file mode 100644 index 0000000000..19ab872c50 --- /dev/null +++ b/bacula/src/qt-console/help/help.cpp @@ -0,0 +1,67 @@ +/* + 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); +} diff --git a/bacula/src/qt-console/help/help.h b/bacula/src/qt-console/help/help.h new file mode 100644 index 0000000000..3eeed47f5e --- /dev/null +++ b/bacula/src/qt-console/help/help.h @@ -0,0 +1,60 @@ +#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_ */ diff --git a/bacula/src/qt-console/mainwin.cpp b/bacula/src/qt-console/mainwin.cpp index a73b3e9636..f28778817e 100644 --- a/bacula/src/qt-console/mainwin.cpp +++ b/bacula/src/qt-console/mainwin.cpp @@ -79,7 +79,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent) readSettings(); foreach(Console *console, m_consoleHash) { - console->connect(); + console->connect_dir(); } m_currentConsole = (Console*)getFromHash(m_firstItem); m_currentConsole->setCurrent();