From 9c30cf4d0d6dc6b192060fee857ec78d2078c303 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Sat, 27 Jan 2007 18:25:23 +0000 Subject: [PATCH] Update names git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4061 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/Makefile | 25 ++++++++++--------- bacula/src/qt-console/authenticate.cpp | 2 +- bacula/src/qt-console/bat.h | 14 +++++++++++ bacula/src/qt-console/bat.pro | 4 +-- .../{console_conf.cpp => bat_conf.cpp} | 2 +- .../qt-console/{console_conf.h => bat_conf.h} | 2 +- bacula/src/qt-console/console.h | 8 ++++++ bacula/src/qt-console/main.cpp | 18 +++++++++---- bacula/src/qt-console/mainwindow.cpp | 2 +- bacula/src/qt-console/mainwindow.h | 6 ----- 10 files changed, 54 insertions(+), 29 deletions(-) create mode 100644 bacula/src/qt-console/bat.h rename bacula/src/qt-console/{console_conf.cpp => bat_conf.cpp} (99%) rename bacula/src/qt-console/{console_conf.h => bat_conf.h} (98%) diff --git a/bacula/src/qt-console/Makefile b/bacula/src/qt-console/Makefile index ac0fee30ae..856d690b3a 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 Jan 27 18:35:42 2007 +# Generated by qmake (2.01a) (Qt 4.2.1) on: Sat Jan 27 19:24:48 2007 # Project: bat.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile bat.pro @@ -47,12 +47,12 @@ OBJECTS_DIR = ./ SOURCES = main.cpp \ authenticate.cpp \ - console_conf.cpp \ + bat_conf.cpp \ mainwindow.cpp moc_mainwindow.cpp \ qrc_main.cpp OBJECTS = main.o \ authenticate.o \ - console_conf.o \ + bat_conf.o \ mainwindow.o \ moc_mainwindow.o \ qrc_main.o @@ -146,7 +146,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 mainwindow.h console_conf.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp authenticate.cpp console_conf.cpp mainwindow.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.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 mainwindow.h bat.h bat_conf.h .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.qrc .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.cpp authenticate.cpp bat_conf.cpp mainwindow.cpp .tmp/bat1.0.0/ && $(COPY_FILE) --parents main.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: @@ -207,24 +207,25 @@ compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_coll ####### Compile -main.o: main.cpp console.h \ +main.o: main.cpp bat.h \ mainwindow.h \ ui_main.h \ - console_conf.h + bat_conf.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o main.cpp -authenticate.o: authenticate.cpp mainwindow.h \ +authenticate.o: authenticate.cpp bat.h \ + mainwindow.h \ ui_main.h \ - console_conf.h + bat_conf.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o authenticate.o authenticate.cpp -console_conf.o: console_conf.cpp console_conf.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o console_conf.o console_conf.cpp +bat_conf.o: bat_conf.cpp bat_conf.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o bat_conf.o bat_conf.cpp -mainwindow.o: mainwindow.cpp console.h \ +mainwindow.o: mainwindow.cpp bat.h \ mainwindow.h \ ui_main.h \ - console_conf.h + bat_conf.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o mainwindow.o mainwindow.cpp moc_mainwindow.o: moc_mainwindow.cpp diff --git a/bacula/src/qt-console/authenticate.cpp b/bacula/src/qt-console/authenticate.cpp index 1bd0efc944..7f0be6227e 100644 --- a/bacula/src/qt-console/authenticate.cpp +++ b/bacula/src/qt-console/authenticate.cpp @@ -40,7 +40,7 @@ Switzerland, email:ftf@fsfeurope.org. */ -#include "console.h" +#include "bat.h" /* Commands sent to Director */ diff --git a/bacula/src/qt-console/bat.h b/bacula/src/qt-console/bat.h new file mode 100644 index 0000000000..186b81ad62 --- /dev/null +++ b/bacula/src/qt-console/bat.h @@ -0,0 +1,14 @@ + +#include "mainwindow.h" +#include "config.h" +#include "bacula.h" +#include "bat_conf.h" +#include "jcr.h" + +extern MainWindow *mainWin; +extern QApplication *app; + +void set_textf(const char *fmt, ...); +void set_text(const char *buf); + +int bvsnprintf(char *str, int32_t size, const char *format, va_list ap); diff --git a/bacula/src/qt-console/bat.pro b/bacula/src/qt-console/bat.pro index e31e6ba462..4b582888cc 100644 --- a/bacula/src/qt-console/bat.pro +++ b/bacula/src/qt-console/bat.pro @@ -14,6 +14,6 @@ RESOURCES = main.qrc # Input FORMS += main.ui -HEADERS += mainwindow.h console_conf.h -SOURCES += main.cpp authenticate.cpp console_conf.cpp +HEADERS += mainwindow.h bat.h bat_conf.h +SOURCES += main.cpp authenticate.cpp bat_conf.cpp SOURCES += mainwindow.cpp diff --git a/bacula/src/qt-console/console_conf.cpp b/bacula/src/qt-console/bat_conf.cpp similarity index 99% rename from bacula/src/qt-console/console_conf.cpp rename to bacula/src/qt-console/bat_conf.cpp index f1cd77ecf3..c7537b7863 100644 --- a/bacula/src/qt-console/console_conf.cpp +++ b/bacula/src/qt-console/bat_conf.cpp @@ -50,7 +50,7 @@ */ #include "bacula.h" -#include "console_conf.h" +#include "bat_conf.h" /* Define the first and last resource ID record * types. Note, these should be unique for each diff --git a/bacula/src/qt-console/console_conf.h b/bacula/src/qt-console/bat_conf.h similarity index 98% rename from bacula/src/qt-console/console_conf.h rename to bacula/src/qt-console/bat_conf.h index 7a31004436..209734aff8 100644 --- a/bacula/src/qt-console/console_conf.h +++ b/bacula/src/qt-console/bat_conf.h @@ -1,5 +1,5 @@ /* - * Bacula GNOME User Agent specific configuration and defines + * Bacula Adminstration Tool (bat) * * Kern Sibbald, March 2002 * diff --git a/bacula/src/qt-console/console.h b/bacula/src/qt-console/console.h index 8715b5fe2d..6ff13fc600 100644 --- a/bacula/src/qt-console/console.h +++ b/bacula/src/qt-console/console.h @@ -5,3 +5,11 @@ #include "console_conf.h" #include "jcr.h" +extern MainWindow *mainWin; +extern QApplication *app; + +void set_textf(const char *fmt, ...); +void set_text(const char *buf); + +int bvsnprintf(char *str, int32_t size, const char *format, va_list ap); + diff --git a/bacula/src/qt-console/main.cpp b/bacula/src/qt-console/main.cpp index bc54f0551d..91e0386a20 100644 --- a/bacula/src/qt-console/main.cpp +++ b/bacula/src/qt-console/main.cpp @@ -26,8 +26,16 @@ Switzerland, email:ftf@fsfeurope.org. */ +/* + * Main program for bat (qt-console) + * + * Kern Sibbald, January MMVI + * + */ + + #include -#include "console.h" +#include "bat.h" /* Imported functions */ @@ -44,6 +52,7 @@ static int check_resources(); static char *configfile = NULL; MainWindow *mainWin; +QApplication *app; int main(int argc, char *argv[]) { @@ -53,8 +62,8 @@ int main(int argc, char *argv[]) bool test_config = false; - QApplication app(argc, argv); - app.setQuitOnLastWindowClosed(true); + app = new QApplication(argc, argv); + app->setQuitOnLastWindowClosed(true); mainWin = new MainWindow; @@ -122,7 +131,6 @@ int main(int argc, char *argv[]) } parse_config(configfile); - set_text("Configuration read.\n"); if (init_crypto() != 0) { Emsg0(M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n")); @@ -132,7 +140,7 @@ int main(int argc, char *argv[]) Emsg1(M_ERROR_TERM, 0, _("Please correct configuration file: %s\n"), configfile); } - return app.exec(); + return app->exec(); } void terminate_console(int sig) diff --git a/bacula/src/qt-console/mainwindow.cpp b/bacula/src/qt-console/mainwindow.cpp index 7f87ec70f7..d5a45f4725 100644 --- a/bacula/src/qt-console/mainwindow.cpp +++ b/bacula/src/qt-console/mainwindow.cpp @@ -33,7 +33,7 @@ * */ -#include "console.h" +#include "bat.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { diff --git a/bacula/src/qt-console/mainwindow.h b/bacula/src/qt-console/mainwindow.h index a5d90a134c..884a28355b 100644 --- a/bacula/src/qt-console/mainwindow.h +++ b/bacula/src/qt-console/mainwindow.h @@ -52,9 +52,3 @@ private: QString m_UserInput; }; -extern MainWindow *mainWin; - -void set_textf(const char *fmt, ...); -void set_text(const char *buf); - -int bvsnprintf(char *str, int32_t size, const char *format, va_list ap); -- 2.39.5