From: Kern Sibbald Date: Mon, 29 Jan 2007 18:46:46 +0000 (+0000) Subject: Update X-Git-Tag: Release-7.0.0~6979 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=15904f62d482742ac31db98d37fe3026f226f435;p=bacula%2Fbacula Update git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4077 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/README b/bacula/src/qt-console/README index fd97dde850..e6d6d8c242 100644 --- a/bacula/src/qt-console/README +++ b/bacula/src/qt-console/README @@ -1,21 +1,75 @@ +This directory contains the Bacula Admin Tool (bat). + At the current time, the contents of this directory are under development. If you want to help, please contact Kern directly. If you want to build it, you need Qt4 loaded and setup as your default Qt or with the appropriate Qt Environment variables set. -To build the qt-console, you simply enter: +To build bat, you simply enter: qmake make then to execute it - ./qt-console + ./bat The qmake command needs to be entered only if you add a new file, in -which case, you should edit qt-console.pro and add the new filename +which case, you should edit bat.pro and add the new filename in the appropriate place. In running qmake, it will build a new -Makefile, and there after, you simply use "make". +Makefile, and there after, you simply use "make". In fact, providing +you edit bat.pro, doing a "make" will automatically call qmake to +rebuild the Makefile. + +Development status as of 29 Jan 07. + +Items implemented: +- Reads a basic bat.conf (same as documented for the gnome-console + except that the Font part is unimplemented). +- Basic main window structure +- About dialog +- Quit menu item +- Connect button (initally shows disconnected) will connect to + the first Director defined in the conf file. +- The Director name will appear in the Selection tree followed + by Console and Restore. +- Clicking on Console brings forward the console display screen + (default at startup). +- Clicking on Restore brings up a dummy two tab "restore" page. +- The command line is implemented. +- The status line (below the command line) is implemented. + +Items not implemented: +- None of the menu items except About, Quit. +- None of the tool bar icons except the connect/disconnect. +- Nothing on the restore page + +Design/implementation considerations: +- We need to have multiple Directors +- Each Director should have its own console +- The Console class needs to be a list or be attached to the + currently active Director. +- Need icons in front of the Director. +- Need indication if a director is connected or not. +- The console page should be in a DockWidget so it can be removed + from the main window. +- Need to figure out a good implementation of adding pages and even + having plugins that load as pages. Currently the page mechanism + is a bit kludged. +- Each page should in principle be a separate designer .ui file + Currently the two pages console, restore are part of main.ui, + but they should be pulled out into their own .ui files. + +Design decisions: +- If possible all windows will be created with designer and have + a name such as xxxForm i.e. the main window is MainForm and kept + in main.ui. +- If possible all code for a particular component will be kept in + and appropriate subdirectory. +- All private class variables are named "m_xxx" this makes it very + clear if one is referencing a class variable or a local. +- All signal/slots are connected by explict code (most all are + done in the MainWin constructor), rather than using designer. diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index d8d7898ea0..b2ae2e9e8b 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -66,9 +66,12 @@ Console::Console() treeWidget->setHeaderLabel("Selection"); topItem = new QTreeWidgetItem(treeWidget); topItem->setText(0, m_dir->name()); + topItem->setIcon(0, QIcon(QString::fromUtf8("images/server.png"))); item = new QTreeWidgetItem(topItem); + m_consoleItem = item; item->setText(0, "Console"); item->setText(1, "0"); + item->setIcon(0, QIcon(QString::fromUtf8("images/disconnected.png"))); item = new QTreeWidgetItem(topItem); item->setText(0, "Restore"); item->setText(1, "1"); @@ -114,6 +117,7 @@ void Console::connect() return; } else { mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/connected.png"))); + m_consoleItem->setIcon(0, QIcon(QString::fromUtf8("images/connected.png"))); } @@ -195,6 +199,7 @@ void Console::write_dir(const char *msg) } else { mainWin->set_status(" Director not connected. Click on connect button."); mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); + m_consoleItem->setIcon(0, QIcon(QString::fromUtf8("images/disconnected.png"))); } } @@ -219,6 +224,7 @@ void Console::read_dir(int fd) bnet_close(m_sock); m_sock = NULL; mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); + m_consoleItem->setIcon(0, QIcon(QString::fromUtf8("images/disconnected.png"))); m_notifier->setEnabled(false); delete m_notifier; m_notifier = NULL; diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index 394f33c1bb..1fcf095591 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -33,6 +33,7 @@ private: bool m_at_prompt; QSocketNotifier *m_notifier; QTextCursor *m_cursor; + QTreeWidgetItem *m_consoleItem; }; #endif /* _CONSOLE_H_ */ diff --git a/bacula/src/qt-console/main.ui b/bacula/src/qt-console/main.ui index 121158edaf..5dd1a13232 100644 --- a/bacula/src/qt-console/main.ui +++ b/bacula/src/qt-console/main.ui @@ -351,6 +351,9 @@ &Print + + Print + @@ -359,6 +362,9 @@ &Save + + Save (not implemented) + @@ -367,6 +373,9 @@ Connect + + Connect/disconnect + @@ -409,6 +418,9 @@ Run Job + + Run a Job +