From 3c62fa95a2f06ec70cd6ca456d0fbeb0ef37b898 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 3 Feb 2007 13:01:19 +0000 Subject: [PATCH] Add brestore page git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4092 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/Makefile | 47 +++- bacula/src/qt-console/bat.pro | 7 +- bacula/src/qt-console/console/console.cpp | 4 + bacula/src/qt-console/restore/brestore.cpp | 45 +++ bacula/src/qt-console/restore/brestore.ui | 311 +++++++++++++++++++++ bacula/src/qt-console/restore/restore.h | 21 ++ 6 files changed, 423 insertions(+), 12 deletions(-) create mode 100644 bacula/src/qt-console/restore/brestore.cpp create mode 100644 bacula/src/qt-console/restore/brestore.ui create mode 100644 bacula/src/qt-console/restore/restore.h diff --git a/bacula/src/qt-console/Makefile b/bacula/src/qt-console/Makefile index a15efb5ef1..2855bb4935 100644 --- a/bacula/src/qt-console/Makefile +++ b/bacula/src/qt-console/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: bat -# Generated by qmake (2.01a) (Qt 4.2.1) on: Sat Feb 3 11:19:57 2007 +# Generated by qmake (2.01a) (Qt 4.2.1) on: Sat Feb 3 13:49:24 2007 # Project: bat.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile bat.pro @@ -17,7 +17,7 @@ CFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) CXXFLAGS = -pipe -O2 -Wall -W -D_REENTRANT $(DEFINES) LEXFLAGS = YACCFLAGS = -d -INCPATH = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include -I. -Iconsole -I.. -I. -I. +INCPATH = -I/usr/share/qt4/mkspecs/default -I. -I/usr/include/QtCore -I/usr/include/QtCore -I/usr/include/QtGui -I/usr/include/QtGui -I/usr/include -I. -Iconsole -Irestore -I.. -I. -I. LINK = g++ LFLAGS = LIBS = $(SUBLIBS) -L/usr/lib -L../lib -lbac -lssl -lcrypto -lQtGui -L/usr/lib -L/usr/X11R6/lib -lpng -lSM -lICE -lXi -lXrender -lXrandr -lXfixes -lXcursor -lXinerama -lfreetype -lfontconfig -lXext -lX11 -lQtCore -lz -lm -ldl -lpthread @@ -49,16 +49,20 @@ SOURCES = main.cpp \ bat_conf.cpp \ mainwin.cpp \ console/authenticate.cpp \ - console/console.cpp moc_mainwin.cpp \ + console/console.cpp \ + restore/brestore.cpp moc_mainwin.cpp \ moc_console.cpp \ + moc_restore.cpp \ qrc_main.cpp OBJECTS = main.o \ bat_conf.o \ mainwin.o \ authenticate.o \ console.o \ + brestore.o \ moc_mainwin.o \ moc_console.o \ + moc_restore.o \ qrc_main.o DIST = /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/g++.conf \ @@ -105,7 +109,7 @@ first: all all: Makefile $(TARGET) -$(TARGET): ui_main.h ui_label.h ui_console.h $(OBJECTS) +$(TARGET): ui_main.h ui_label.h ui_console.h ui_brestore.h $(OBJECTS) $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS) Makefile: bat.pro /usr/share/qt4/mkspecs/default/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \ @@ -150,7 +154,7 @@ qmake: FORCE dist: @$(CHK_DIR_EXISTS) .tmp/bat1.0.0 || $(MKDIR) .tmp/bat1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h console/console.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp console/authenticate.cpp console/console.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.ui label.ui console/console.ui .tmp/bat1.0.0/ && (cd `dirname .tmp/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname .tmp/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/bat1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h console/console.h restore/restore.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp console/authenticate.cpp console/console.cpp restore/brestore.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.ui label.ui console/console.ui restore/brestore.ui .tmp/bat1.0.0/ && (cd `dirname .tmp/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname .tmp/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/bat1.0.0 yaccclean: @@ -174,18 +178,24 @@ mocclean: compiler_moc_header_clean compiler_moc_source_clean mocables: compiler_moc_header_make_all compiler_moc_source_make_all -compiler_moc_header_make_all: moc_mainwin.cpp moc_console.cpp +compiler_moc_header_make_all: moc_mainwin.cpp moc_console.cpp moc_restore.cpp compiler_moc_header_clean: - -$(DEL_FILE) moc_mainwin.cpp moc_console.cpp + -$(DEL_FILE) moc_mainwin.cpp moc_console.cpp moc_restore.cpp moc_mainwin.cpp: ui_main.h \ mainwin.h \ /usr/bin/moc /usr/bin/moc $(DEFINES) $(INCPATH) mainwin.h -o moc_mainwin.cpp -moc_console.cpp: console/console.h \ +moc_console.cpp: ui_console.h \ + console/console.h \ /usr/bin/moc /usr/bin/moc $(DEFINES) $(INCPATH) console/console.h -o moc_console.cpp +moc_restore.cpp: ui_brestore.h \ + restore/restore.h \ + /usr/bin/moc + /usr/bin/moc $(DEFINES) $(INCPATH) restore/restore.h -o moc_restore.cpp + compiler_rcc_make_all: qrc_main.cpp compiler_rcc_clean: -$(DEL_FILE) qrc_main.cpp @@ -212,9 +222,9 @@ compiler_image_collection_clean: -$(DEL_FILE) qmake_image_collection.cpp compiler_moc_source_make_all: compiler_moc_source_clean: -compiler_uic_make_all: ui_main.h ui_label.h ui_console.h +compiler_uic_make_all: ui_main.h ui_label.h ui_console.h ui_brestore.h compiler_uic_clean: - -$(DEL_FILE) ui_main.h ui_label.h ui_console.h + -$(DEL_FILE) ui_main.h ui_label.h ui_console.h ui_brestore.h ui_main.h: main.ui /usr/bin/uic main.ui -o ui_main.h @@ -224,6 +234,9 @@ ui_label.h: label.ui ui_console.h: console/console.ui /usr/bin/uic console/console.ui -o ui_console.h +ui_brestore.h: restore/brestore.ui + /usr/bin/uic restore/brestore.ui -o ui_brestore.h + compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_collection_clean compiler_moc_source_clean compiler_uic_clean ####### Compile @@ -253,15 +266,27 @@ console.o: console/console.cpp bat.h \ mainwin.h \ ui_main.h \ bat_conf.h \ - console/console.h + console/console.h \ + ui_console.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o console.o console/console.cpp +brestore.o: restore/brestore.cpp bat.h \ + mainwin.h \ + ui_main.h \ + bat_conf.h \ + restore/restore.h \ + ui_brestore.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o brestore.o restore/brestore.cpp + moc_mainwin.o: moc_mainwin.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_mainwin.o moc_mainwin.cpp moc_console.o: moc_console.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_console.o moc_console.cpp +moc_restore.o: moc_restore.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o moc_restore.o moc_restore.cpp + qrc_main.o: qrc_main.cpp $(CXX) -c $(CXXFLAGS) $(INCPATH) -o qrc_main.o qrc_main.cpp diff --git a/bacula/src/qt-console/bat.pro b/bacula/src/qt-console/bat.pro index 57f9454e26..19efb18cbf 100644 --- a/bacula/src/qt-console/bat.pro +++ b/bacula/src/qt-console/bat.pro @@ -5,7 +5,7 @@ TEMPLATE = app TARGET = bat DEPENDPATH += . -INCLUDEPATH += . ./console +INCLUDEPATH += . ./console ./restore INCLUDEPATH += .. LIBS += -L../lib LIBS += -lbac @@ -17,6 +17,7 @@ FORMS += main.ui # Label dialog FORMS += label.ui FORMS += console/console.ui +FORMS += restore/brestore.ui HEADERS += mainwin.h bat.h bat_conf.h @@ -26,4 +27,8 @@ SOURCES += main.cpp bat_conf.cpp mainwin.cpp HEADERS += console/console.h SOURCES += console/authenticate.cpp console/console.cpp +# Restore +HEADERS += restore/restore.h +SOURCES += restore/brestore.cpp + # Label dialog diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 4e210998d9..ca3eb4e62b 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -36,6 +36,7 @@ #include #include "bat.h" #include "console.h" +#include "restore.h" Console::Console(QStackedWidget *parent) { @@ -51,6 +52,9 @@ Console::Console(QStackedWidget *parent) m_cursor = new QTextCursor(m_textEdit->document()); mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); + bRestore *restore = new bRestore(parent); + restore->setupUi(restore); + parent->addWidget(restore); /* Just take the first Director */ LockRes(); diff --git a/bacula/src/qt-console/restore/brestore.cpp b/bacula/src/qt-console/restore/brestore.cpp new file mode 100644 index 0000000000..0f47d69524 --- /dev/null +++ b/bacula/src/qt-console/restore/brestore.cpp @@ -0,0 +1,45 @@ +/* + Bacula® - The Network Backup Solution + + Copyright (C) 2000-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. +*/ + +/* + * bRestore Class (Eric's brestore) + * + * Kern Sibbald, January MMVI + * + */ + +#include +#include "bat.h" +#include "restore.h" + +bRestore::bRestore(QStackedWidget *parent) +{ + setupUi(this); + parent->addWidget(this); +} + diff --git a/bacula/src/qt-console/restore/brestore.ui b/bacula/src/qt-console/restore/brestore.ui new file mode 100644 index 0000000000..f35c71be45 --- /dev/null +++ b/bacula/src/qt-console/restore/brestore.ui @@ -0,0 +1,311 @@ + + bRestoreForm + + + + 0 + 0 + 800 + 600 + + + + brestore + + + + + 70 + 30 + 582 + 533 + + + + + 9 + + + 6 + + + + + 0 + + + 6 + + + + + + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 40 + 20 + + + + + + + + Location + + + + + + + + + + + + Qt::Vertical + + + + Qt::Horizontal + + + + + 7 + 7 + 0 + 0 + + + + File list + + + + 9 + + + 6 + + + + + + 7 + 7 + 5 + 5 + + + + + Type + + + + + File Name + + + + + Size + + + + + Date + + + + + + + + + + 7 + 7 + 0 + 0 + + + + File revisions + + + + 9 + + + 6 + + + + + + 7 + 7 + 0 + 0 + + + + + InChanger + + + + + Volume + + + + + JobId + + + + + Size + + + + + Date + + + + + Chksum + + + + + + + + + + + 0 + + + 6 + + + + + 0 + + + 6 + + + + + <html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Restore items list</span></p></body></html> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Clear + + + + + + + Estimate + + + + + + + Restore + + + + + + + + + true + + + + Type + + + + + FileName + + + + + JobId + + + + + FileIndex + + + + + Nb Files + + + + + Size + + + + + + + + + + + + + + diff --git a/bacula/src/qt-console/restore/restore.h b/bacula/src/qt-console/restore/restore.h new file mode 100644 index 0000000000..682e3e6259 --- /dev/null +++ b/bacula/src/qt-console/restore/restore.h @@ -0,0 +1,21 @@ + +#ifndef _RESTORE_H_ +#define _RESTORE_H_ + +#include +#include "ui_brestore.h" + +class bRestore : public QWidget, public Ui::bRestoreForm +{ + Q_OBJECT + +public: + bRestore(QStackedWidget *parent); + +public slots: + +private: + +}; + +#endif /* _RESTORE_H_ */ -- 2.39.5