[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bacula-devel] patch: fix: job graphs don't work even with qwt


Hello,
this patch re-enables job graphs when qwt is present.
To have a cleaner display, all graph buttons are now hidden if qwt is missing.

Ciao,
Riccardo



Index: bacula/src/qt-console/mainwin.h
===================================================================
--- bacula/src/qt-console/mainwin.h	(revision 7013)
+++ bacula/src/qt-console/mainwin.h	(working copy)
@@ -113,9 +113,7 @@
    void estimateButtonClicked();
    void browseButtonClicked();
    void statusPageButtonClicked();
-#ifdef HAVE_QWT
    void jobPlotButtonClicked();
-#endif 
    void restoreButtonClicked();
    void undockWindowButton();
    void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
Index: bacula/src/qt-console/mainwin.cpp
===================================================================
--- bacula/src/qt-console/mainwin.cpp	(revision 7013)
+++ bacula/src/qt-console/mainwin.cpp	(working copy)
@@ -35,6 +35,7 @@
  *
  */ 
 
+#include <assert.h>
 #include "bat.h"
 #include "version.h"
 #include "joblist/joblist.h"
@@ -83,6 +84,11 @@
 
    createConnections();
 
+#ifndef HAVE_QWT
+   actionJobPlot->setEnabled(false);
+   actionJobPlot->setVisible(false);
+#endif
+
    this->show();
 
    readSettings();
@@ -468,14 +474,16 @@
    new prerestorePage();
 }
 
-#ifdef HAVE_QWT
 void MainWin::jobPlotButtonClicked()
 {
+#ifdef HAVE_QWT
    JobPlotPass pass;
    pass.use = false;
    new JobPlot(NULL, pass);
+#else
+   assert("QWT support disabled");
+#endif
 }
-#endif
 
 /*
  * The user just finished typing a line in the command line edit box
@@ -687,6 +695,9 @@
       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();
Index: bacula/src/qt-console/joblist/joblist.cpp
===================================================================
--- bacula/src/qt-console/joblist/joblist.cpp	(revision 7013)
+++ bacula/src/qt-console/joblist/joblist.cpp	(working copy)
@@ -33,6 +33,7 @@
  
 #include <QAbstractEventDispatcher>
 #include <QTableWidgetItem>
+#include <assert.h>
 #include "bat.h"
 #include "joblist.h"
 #include "restore.h"
@@ -448,6 +449,7 @@
    connect(graphButton, SIGNAL(pressed()), this, SLOT(graphTable()));
 #else
    graphButton->setEnabled(false);
+   graphButton->setVisible(false);
 #endif
    /* for the tableItemChanged to maintain m_currentJob */
    connect(mp_tableWidget, SIGNAL(
@@ -617,9 +619,9 @@
 /*
  * Graph this table
  */
-#ifdef HAVE_QWT
 void JobList::graphTable()
 {
+#ifdef HAVE_QWT
    JobPlotPass pass;
    pass.recordLimitCheck = limitCheckBox->checkState();
    pass.daysLimitCheck = daysCheckBox->checkState();
@@ -635,8 +637,10 @@
    pass.use = true;
    QTreeWidgetItem* pageSelectorTreeWidgetItem = mainWin->getFromHash(this);
    new JobPlot(pageSelectorTreeWidgetItem, pass);
+#else
+   assert("QWT support disabled");
+#endif
 }
-#endif
 
 /*
  * Save user settings associated with this page
Index: bacula/src/qt-console/joblist/joblist.h
===================================================================
--- bacula/src/qt-console/joblist/joblist.h	(revision 7013)
+++ bacula/src/qt-console/joblist/joblist.h	(working copy)
@@ -68,9 +68,7 @@
    void preRestoreFromTime();
    void showLogForJob();
    void consoleCancelJob();
-#ifdef HAVE_QWT
    void graphTable();
-#endif
 
 private:
    void createConnections();
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-devel mailing list
Bacula-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/bacula-devel


This mailing list archive is a service of Copilotco.