]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/mainwin.cpp
Remove jobq.c constraint that read and write SD must be
[bacula/bacula] / bacula / src / qt-console / mainwin.cpp
index e52342b1ab6f04ed14ffbaf8bfe16068cc2d47a3..a03e22102598e6afffd38d5ecc7db045ca44eedc 100644 (file)
@@ -20,7 +20,7 @@
    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.
@@ -74,7 +74,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    readPreferences();
    treeWidget->clear();
    treeWidget->setColumnCount(1);
-   treeWidget->setHeaderLabel("Select Page");
+   treeWidget->setHeaderLabel( tr("Select Page") );
    treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
 
    createPages();
@@ -83,6 +83,11 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
 
    createConnections();
 
+#ifndef HAVE_QWT
+   actionJobPlot->setEnabled(false);
+   actionJobPlot->setVisible(false);
+#endif
+
    this->show();
 
    readSettings();
@@ -95,7 +100,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    if (m_miscDebug) {
       QString directoryResourceName;
       m_currentConsole->getDirResName(directoryResourceName);
-      Pmsg1(000, "Setting initial window to %s\n", directoryResourceName.toUtf8().data());
+      Pmsg1(100, "Setting initial window to %s\n", directoryResourceName.toUtf8().data());
    }
 }
 
@@ -125,7 +130,7 @@ void MainWin::createPages()
 
       /* Create Tree Widget Item */
       item = new QTreeWidgetItem(topItem);
-      item->setText(0, "Console");
+      item->setText(0, tr("Console"));
       if (!m_firstItem){ m_firstItem = item; }
       item->setIcon(0,QIcon(QString::fromUtf8(":images/utilities-terminal.png")));
 
@@ -261,11 +266,6 @@ void MainWin::closeEvent(QCloseEvent *event)
 {
    m_isClosing = true;
    writeSettings();
-/*   foreach(Console *console, m_consoleHash){
-      console->writeSettings();
-      console->terminate();
-      console->closeStackPage();
-   } */
    /* close all non console pages, this will call settings in destructors */
    while (m_consoleHash.count() < m_pagehash.count()) {
       foreach(Pages *page, m_pagehash) {
@@ -453,7 +453,7 @@ void MainWin::statusPageButtonClicked()
    bool found = false;
    foreach(Pages *page, m_pagehash) {
       if (m_currentConsole == page->console()) {
-         if (page->name() == "Director Status") {
+         if (page->name() == tr("Director Status")) {
             found = true;
             page->setCurrent();
          }
@@ -468,14 +468,14 @@ void MainWin::restoreButtonClicked()
    new prerestorePage();
 }
 
-#ifdef HAVE_QWT
 void MainWin::jobPlotButtonClicked()
 {
+#ifdef HAVE_QWT
    JobPlotPass pass;
    pass.use = false;
    new JobPlot(NULL, pass);
-}
 #endif
+}
 
 /*
  * The user just finished typing a line in the command line edit box
@@ -500,10 +500,10 @@ void MainWin::input_line()
 void MainWin::about()
 {
    QMessageBox::about(this, tr("About bat"),
-      tr("<br><h2>bat " VERSION "(" BDATE "), by Dirk H Bartley and Kern Sibbald</h2>"
-         "<p>Copyright &copy; 2007-" BYEAR " Free Software Foundation Europe e.V."
+      tr("<br><h2>bat %1 (%2), by Dirk H Bartley and Kern Sibbald</h2>"
+         "<p>Copyright &copy; 2007-%3 Free Software Foundation Europe e.V."
          "<p>The <b>bat</b> is an administrative console"
-         " interface to the Director."));
+         " interface to the Director.").arg(VERSION).arg(BDATE).arg(BYEAR));
 }
 
 void MainWin::help()
@@ -687,6 +687,9 @@ void MainWin::setPreferences()
       break;
    }
    prefs.openPlotCheckBox->setCheckState(m_openPlot ? Qt::Checked : Qt::Unchecked);
+#ifndef HAVE_QWT
+   prefs.openPlotCheckBox->setVisible(false);
+#endif
    prefs.openBrowserCheckBox->setCheckState(m_openBrowser ? Qt::Checked : Qt::Unchecked);
    prefs.openDirStatCheckBox->setCheckState(m_openDirStat ? Qt::Checked : Qt::Unchecked);
    prefs.exec();
@@ -817,8 +820,8 @@ void MainWin::readPreferences()
    settings.beginGroup("Misc");
    m_longList = settings.value("longList", false).toBool();
    ItemFormatterBase::setBytesConversion(
-        (ItemFormatterBase::BYTES_CONVERSION) settings.value("byteConvert", 
-        ItemFormatterBase::BYTES_CONVERSION_IEC).toInt());
+         (ItemFormatterBase::BYTES_CONVERSION) settings.value("byteConvert", 
+         ItemFormatterBase::BYTES_CONVERSION_IEC).toInt());
    m_openPlot = settings.value("openplot", false).toBool();
    m_openBrowser = settings.value("openbrowser", false).toBool();
    m_openDirStat = settings.value("opendirstat", false).toBool();
@@ -838,5 +841,3 @@ void MainWin::readPreferences()
    m_rtRestore3Debug = settings.value("rtRestore3Debug", false).toBool();
    settings.endGroup();
 }
-
-