From 9e1078e511551ab223ccf975efe290b53a800c76 Mon Sep 17 00:00:00 2001 From: Dirk H Bartley Date: Fri, 19 Jun 2009 00:10:29 +0000 Subject: [PATCH] Add a boolean to console class to allow for the warning popup, except in cases where I want to prevent the popup. So far this is only for purging jobs. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@8914 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/qt-console/bcomm/dircomm.cpp | 4 +++- bacula/src/qt-console/console/console.cpp | 1 + bacula/src/qt-console/console/console.h | 1 + bacula/src/qt-console/joblist/joblist.cpp | 2 ++ 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bacula/src/qt-console/bcomm/dircomm.cpp b/bacula/src/qt-console/bcomm/dircomm.cpp index 86f52651a3..43024e7ff3 100644 --- a/bacula/src/qt-console/bcomm/dircomm.cpp +++ b/bacula/src/qt-console/bcomm/dircomm.cpp @@ -381,7 +381,9 @@ int DirComm::read() case BNET_WARNING_MSG: if (mainWin->m_commDebug) Pmsg1(000, "conn %i WARNING MSG\n", m_conn); stat = sock_read(); /* get the message */ - /* QMessageBox::critical(m_console, "Warning", msg(), QMessageBox::Ok); */ + if (!m_console->m_warningPrevent) { + QMessageBox::critical(m_console, "Warning", msg(), QMessageBox::Ok); + } break; case BNET_INFO_MSG: if (mainWin->m_commDebug) Pmsg1(000, "conn %i INFO MSG\n", m_conn); diff --git a/bacula/src/qt-console/console/console.cpp b/bacula/src/qt-console/console/console.cpp index 496f99ae55..d84feb4a13 100644 --- a/bacula/src/qt-console/console/console.cpp +++ b/bacula/src/qt-console/console/console.cpp @@ -47,6 +47,7 @@ Console::Console(QStackedWidget *parent) m_parent = parent; m_closeable = false; m_console = this; + m_warningPrevent = false; m_dircommCounter = 0; m_dircommHash.insert(m_dircommCounter, new DirComm(this, m_dircommCounter)); diff --git a/bacula/src/qt-console/console/console.h b/bacula/src/qt-console/console/console.h index 8518ea3bd7..f798748f9a 100644 --- a/bacula/src/qt-console/console/console.h +++ b/bacula/src/qt-console/console/console.h @@ -144,6 +144,7 @@ public slots: public: DIRRES *m_dir; /* so various pages can reference it */ + bool m_warningPrevent; private: QTextEdit *m_textEdit; diff --git a/bacula/src/qt-console/joblist/joblist.cpp b/bacula/src/qt-console/joblist/joblist.cpp index a753645007..2650789048 100644 --- a/bacula/src/qt-console/joblist/joblist.cpp +++ b/bacula/src/qt-console/joblist/joblist.cpp @@ -503,11 +503,13 @@ void JobList::consolePurgeFiles() QMessageBox::Ok | QMessageBox::Cancel) == QMessageBox::Cancel) { return; } + m_console->m_warningPrevent = true; foreach(QString job, m_selectedJobsList) { QString cmd("purge files jobid="); cmd += job; consoleCommand(cmd, false); } + m_console->m_warningPrevent = false; populateTable(); } -- 2.39.5