]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/qt-console/joblog/joblog.cpp
ebl Generated 193 translations (186 finished and 7 unfinished)
[bacula/bacula] / bacula / src / qt-console / joblog / joblog.cpp
index 6ccfd54618e051da8db94c8c6c4292e39898c6b3..065367d887a26be586990b07159e70873071f29e 100644 (file)
@@ -7,8 +7,8 @@
    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.
+   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
@@ -27,7 +27,7 @@
 */
  
 /*
- *   Version $Id: medialist.cpp 4230 2007-02-21 20:07:37Z kerns $
+ *   Version $Id$
  *
  *  JobLog Class
  *
@@ -44,6 +44,8 @@ JobLog::JobLog(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
    m_name = "JobLog";
    m_closeable = true;
    pgInitialize(parentTreeWidgetItem);
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/joblog.png")));
    m_cursor = new QTextCursor(textEdit->document());
 
    m_jobId = jobId;
@@ -69,15 +71,18 @@ void JobLog::getFont()
    textEdit->setFont(font);
 }
 
+/*
+ * Populate the text in the window
+ */
 void JobLog::populateText()
 {
    QString heading("<A href=\"#top\">Log records for job ");
    heading += m_jobId + "</A>\n";
    textEdit->insertHtml(heading);
+
+   if (!m_console->preventInUseConnect())
+       return;
    
-/*   display_text("<A href=\"#top\">Log records for job ");
-   display_text(m_jobId);
-   display_text("</A>\n");*/
    QString query("");
    query = "SELECT Time, LogText FROM Log WHERE JobId='" + m_jobId + "'";
 
@@ -85,6 +90,7 @@ void JobLog::populateText()
    if (m_console->sql_cmd(query, results)) {
       QString field;
       QStringList fieldlist;
+      int resultcount = 0;
 
       /* Iterate through the lines of results. */
       foreach (QString resultline, results) {
@@ -97,13 +103,21 @@ void JobLog::populateText()
             if (column <= 1) display_text("\n");
             column += 1;
          } /* foreach field */
+         resultcount += 1;
       } /* foreach resultline */
+      if (resultcount == 0) {
+         /* show a message about configuration item */
+         QMessageBox::warning(this, tr("Bat"),
+            tr("There were no results ??  !!!.\n"
+"It is possible you may need to add \"catalog = all\" to the Messages stanza"
+" for this job.\n"), QMessageBox::Ok);
+      }
    } /* if results from query */
    textEdit->scrollToAnchor("top");
 }
 
 /*
- * Put text into the joblog window
+ * Put text into the joblog window with an overload
  */
 void JobLog::display_text(const QString buf)
 {