From: Dirk H Bartley Date: Mon, 14 May 2007 00:22:33 +0000 (+0000) Subject: Add some comments, a little cleanup. Show a message if no log message found X-Git-Tag: Release-7.0.0~6356 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=66428745d8fa73237c0f5d3336b8cd075cbf90e8;p=bacula%2Fbacula Add some comments, a little cleanup. Show a message if no log message found in the database. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4775 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/qt-console/joblog/joblog.cpp b/bacula/src/qt-console/joblog/joblog.cpp index 6ccfd54618..3bc966f366 100644 --- a/bacula/src/qt-console/joblog/joblog.cpp +++ b/bacula/src/qt-console/joblog/joblog.cpp @@ -27,7 +27,7 @@ */ /* - * Version $Id: medialist.cpp 4230 2007-02-21 20:07:37Z kerns $ + * Version $Id: joblog.cpp 4230 2007-02-21 20:07:37Z kerns $ * * JobLog Class * @@ -69,15 +69,15 @@ void JobLog::getFont() textEdit->setFont(font); } +/* + * Populate the text in the window + */ void JobLog::populateText() { QString heading("Log records for job "); heading += m_jobId + "\n"; textEdit->insertHtml(heading); -/* display_text("Log records for job "); - display_text(m_jobId); - display_text("\n");*/ QString query(""); query = "SELECT Time, LogText FROM Log WHERE JobId='" + m_jobId + "'"; @@ -85,6 +85,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 +98,22 @@ 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 */ + printf("go here\n"); + 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) {