From: Kern Sibbald Date: Sun, 11 Mar 2007 12:51:30 +0000 (+0000) Subject: Add BNET_RUN_CMD to bat X-Git-Tag: Release-7.0.0~6769 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c8b8f15fec553a913cf0bcbc91b1375f5e34fb4c;p=bacula%2Fbacula Add BNET_RUN_CMD to bat git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4343 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/Makefile b/bacula/src/qt-console/Makefile index 299312c8a3..da4fd113c9 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 Mar 10 21:24:05 2007 +# Generated by qmake (2.01a) (Qt 4.2.1) on: Sun Mar 11 11:56:33 2007 # Project: bat.pro # Template: app # Command: /usr/bin/qmake -unix -o Makefile bat.pro diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 1594171f41..4181064220 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -50,8 +50,6 @@ Console::Console(QStackedWidget *parent) m_cursor = new QTextCursor(m_textEdit->document()); mainWin->actionConnect->setIcon(QIcon(QString::fromUtf8("images/disconnected.png"))); - - readSettings(); /* Check for messages every 5 seconds */ // m_timer = new QTimer(this); diff --git a/bacula/src/qt-console/restore/restore.cpp b/bacula/src/qt-console/restore/restore.cpp index 872dc29b29..f02aa1cd23 100644 --- a/bacula/src/qt-console/restore/restore.cpp +++ b/bacula/src/qt-console/restore/restore.cpp @@ -139,8 +139,8 @@ void restoreDialog::accept() { this->hide(); m_console->write("done"); - delete this; m_console->notify(true); + delete this; mainWin->resetFocus(); } @@ -241,7 +241,7 @@ bool restoreDialog::cwd(const char *dir) if ((stat = m_console->read()) > 0) { m_cwd = m_console->msg(); lineEdit->insert(m_cwd); - Dmsg2(000, "cwd=%s msg=%s\n", m_cwd.toUtf8().data(), m_console->msg()); + Dmsg2(100, "cwd=%s msg=%s\n", m_cwd.toUtf8().data(), m_console->msg()); } else { Dmsg1(000, "stat=%d\n", stat); QMessageBox::critical(this, "Error", "cd command failed", QMessageBox::Ok); diff --git a/bacula/src/qt-console/run/run.h b/bacula/src/qt-console/run/run.h index 14d2bbd9a6..5628331992 100644 --- a/bacula/src/qt-console/run/run.h +++ b/bacula/src/qt-console/run/run.h @@ -4,6 +4,7 @@ #include #include "ui_run.h" +#include "ui_runcmd.h" #include "console.h" class runDialog : public QDialog, public Ui::runForm @@ -23,7 +24,7 @@ private: }; -class runCmdDialog : public QDialog, public Ui::runForm +class runCmdDialog : public QDialog, public Ui::runCmdForm { Q_OBJECT @@ -35,8 +36,9 @@ public slots: void reject(); private: - Console *m_console; + void fillRunDialog(); + Console *m_console; }; diff --git a/bacula/src/qt-console/run/runcmd.cpp b/bacula/src/qt-console/run/runcmd.cpp index ab63a7e240..b038b2a15e 100644 --- a/bacula/src/qt-console/run/runcmd.cpp +++ b/bacula/src/qt-console/run/runcmd.cpp @@ -42,12 +42,68 @@ */ runCmdDialog::runCmdDialog(Console *console) { - QDateTime dt; - m_console = console; m_console->notify(false); setupUi(this); + fillRunDialog(); this->show(); + m_console->discardToPrompt(); +} + +void runCmdDialog::fillRunDialog() +{ + QString item, val; + QStringList items; + QRegExp rx("^.*:\\s*(\\S.*$)"); + + m_console->read(); + item = m_console->msg(); + items = item.split("\n"); + label->setText(items[0]); + Dmsg1(000, "Title=%s\n", items[0].toUtf8().data()); + items.removeFirst(); /* remove title */ + foreach(item, items) { + rx.indexIn(item); + val = rx.cap(1); + Dmsg1(000, "Item=%s\n", item.toUtf8().data()); + Dmsg1(000, "Value=%s\n", val.toUtf8().data()); + + if (item.startsWith("JobName:")) { + jobCombo->addItem(val); + continue; + } + if (item.startsWith("Bootstrap:")) { + bootstrap->setText(val); + continue; + } + if (item.startsWith("Client:")) { + clientCombo->addItem(val); + continue; + } + if (item.startsWith("Storage:")) { + storageCombo->addItem(val); + continue; + } + if (item.startsWith("Where:")) { + where->setText(val); + continue; + } + if (item.startsWith("When:")) { + continue; + } + if (item.startsWith("Catalog:")) { + catalogCombo->addItem(val); + continue; + } + if (item.startsWith("Fileset:")) { + filesetCombo->addItem(val); + continue; + } + if (item.startsWith("Priority:")) { +// prioritySpin->setValue(atoi(val)); + continue; + } + } } void runCmdDialog::accept()