]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/run/estimate.cpp
Add skeleton of new bat run dialogs
[bacula/bacula] / bacula / src / qt-console / run / estimate.cpp
index 39ffc39e7220cd85680db3d149402ef35e8b66a8..217155f92ff020336abab5879a645581676147d1 100644 (file)
@@ -1,26 +1,26 @@
 /*
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2007-2007 Free Software Foundation Europe e.V.
+   Copyright (C) 2007-2009 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.
+   modify it under the terms of version three of the GNU Affero General Public
+   License as published by the Free Software Foundation and included
+   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
+   You should have received a copy of the GNU Affero 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.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -31,7 +31,7 @@
  *
  *   Kern Sibbald, February MMVII
  *
- *  $Id: estimate.cpp 4856 2007-05-20 15:28:43Z bartleyd2 $
+ *  $Id$
  */ 
 
 #include "bat.h"
@@ -44,12 +44,12 @@ estimatePage::estimatePage()
 {
    QDateTime dt;
 
-   m_name = "Estimate";
+   m_name = tr("Estimate");
    pgInitialize();
    setupUi(this);
-   m_console->notify(false);
+   m_conn = m_console->notifyOff();
 
-   m_console->beginNewCommand();
+   m_console->beginNewCommand(m_conn);
    jobCombo->addItems(m_console->job_list);
    filesetCombo->addItems(m_console->fileset_list);
    levelCombo->addItems(m_console->level_list);
@@ -59,15 +59,18 @@ estimatePage::estimatePage()
    connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
    connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
    QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
-   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/estimate-job.svg")));
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/estimate-job.png")));
 
    dockPage();
    setCurrent();
    this->show();
+   m_aButtonPushed = false;
 }
 
 void estimatePage::okButtonPushed()
 {
+   if (m_aButtonPushed) return;
+   m_aButtonPushed = true;
    this->hide();
    QString cmd;
    QTextStream(&cmd) << "estimate" << 
@@ -83,8 +86,8 @@ void estimatePage::okButtonPushed()
       Pmsg1(000, "command : %s\n", cmd.toUtf8().data());
    }
 
-   consoleCommand(cmd);
-   m_console->notify(true);
+   consoleCommand(cmd, m_conn);
+   m_console->notify(m_conn, true);
    closeStackPage();
    mainWin->resetFocus();
 }
@@ -92,9 +95,11 @@ void estimatePage::okButtonPushed()
 
 void estimatePage::cancelButtonPushed()
 {
+   if (m_aButtonPushed) return;
+   m_aButtonPushed = true;
    mainWin->set_status(" Canceled");
    this->hide();
-   m_console->notify(true);
+   m_console->notify(m_conn, true);
    closeStackPage();
    mainWin->resetFocus();
 }
@@ -110,7 +115,7 @@ void estimatePage::job_name_change(int index)
 
    (void)index;
    job_defs.job_name = jobCombo->currentText();
-   if (m_console->get_job_defaults(job_defs)) {
+   if (m_console->get_job_defaults(m_conn, job_defs)) {
       filesetCombo->setCurrentIndex(filesetCombo->findText(job_defs.fileset_name, Qt::MatchExactly));
       levelCombo->setCurrentIndex(levelCombo->findText(job_defs.level, Qt::MatchExactly));
       clientCombo->setCurrentIndex(clientCombo->findText(job_defs.client_name, Qt::MatchExactly));