]> git.sur5r.net Git - bacula/bacula/commitdiff
This commit puts prefences for debuggin output and prefences for the joblist
authorDirk H Bartley <dbartley@schupan.com>
Sat, 19 May 2007 20:03:10 +0000 (20:03 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Sat, 19 May 2007 20:03:10 +0000 (20:03 +0000)
with the 2 checkboxes and 2 spinboxes for limiting the output from the sql
statement.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4841 91ce42f0-d328-0410-95d8-f526ca767f89

19 files changed:
bacula/src/qt-console/TODO
bacula/src/qt-console/bat.h
bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/console/console.cpp
bacula/src/qt-console/fileset/fileset.cpp
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/label/label.cpp
bacula/src/qt-console/main.cpp
bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h
bacula/src/qt-console/mediaedit/mediaedit.cpp
bacula/src/qt-console/medialist/medialist.cpp
bacula/src/qt-console/mount/mount.cpp
bacula/src/qt-console/prefs.ui
bacula/src/qt-console/relabel/relabel.cpp
bacula/src/qt-console/restore/prerestore.cpp
bacula/src/qt-console/restore/restore.cpp
bacula/src/qt-console/storage/storage.cpp

index af88907e4a7f2bc206a6354fd245b67f4666706e..31857521ec2c588262d83e0591c2667ad4b7e068 100644 (file)
@@ -1,16 +1,11 @@
 dhb
 ====================================================
-Further testing of restore with .mod
-
-User preferences.  With log to stdout options.
-Have settings for defaults of limits on joblist
-
-Add fileset to joblist.
-
 joblist cancel a running job.
 
 Set default for replace in run restore job to "always"??????
 
+Fixes to final restore widgets.
+
 Add context sensitive options for most commands
 status dir on page select director item
 All items with jobid= that I thought could work from joblist are done.
@@ -18,14 +13,8 @@ As well as many more
 update slots scan
 see COMMANDS file
 
-Option in joblist like with restore from jobid but restore populating timestamp
-of the selected job.
-
 Get the 5 second bring to bottom of console to stop
 
-Resolve issue of connection during restore selection.  Could go with preempt of
-connections.  (Kern is to work on)
-
 ========LOW priority items:
 Human readable in joblist for purged, joblevel and job type.
 
@@ -86,6 +75,20 @@ global one defined in the mainWin class (if I remember right).
 ============================================================
 DONE:
 ============================================================
+Option in joblist like with restore from jobid but restore populating timestamp
+of the selected job.
+
+User preferences.  With log to stdout options.
+Have settings for defaults of limits on joblist
+
+Resolve issue of connection during restore selection.  Could go with preempt of
+connections.  Temporary resolution is in.  (Kern is to work on)
+
+Further testing of restore with .mod
+   Tested a few things, not all.
+
+Add fileset to joblist.
+
 Test left pane of restore with 2 windows drives in one backup job.
    Yup, id didn't work, now it does.
 
index c1d8f5d9bc3feb901a01ca70830358008a086f3f..606077e658ee2cb0841ea5163f85898894e2b3b1 100644 (file)
@@ -46,8 +46,6 @@ using namespace qstd;
 
 extern MainWin *mainWin;
 extern QApplication *app;
-extern bool g_commDebug;
-extern bool g_displayAll;
 
 int bvsnprintf(char *str, int32_t size, const char *format, va_list ap);
 
index 77c646baca530e66f608a22d3e62188acb913310..c2d2dad52ee73a932d4aa618c6cbdabcfed11496 100644 (file)
@@ -80,8 +80,6 @@ void Clients::populateTree()
 
    mp_treeWidget->setColumnCount(headerlist.count());
    mp_treeWidget->setHeaderLabels(headerlist);
-   /* This could be a log item */
-   //printf("In Clients::populateTree()\n");
 
    foreach (QString clientName, m_console->client_list){
       clientItem = new QTreeWidgetItem(topItem);
@@ -99,7 +97,9 @@ void Clients::populateTree()
 
       QStringList results;
       /* This could be a log item */
-      //printf("Clients query cmd : %s\n",query.toUtf8().data());
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "Clients query cmd : %s\n",query.toUtf8().data());
+      }
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount == 1){
index d7ebbef4ecde8ec9b1bd6ed1182e4f317274e890..3e5eb4af4b977208b5d795d88b4f34e1ba05c6f3 100644 (file)
@@ -190,7 +190,7 @@ bool Console::dir_cmd(const char *cmd, QStringList &results)
    notify(false);
    write(cmd);
    while ((stat = read()) > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
       strip_trailing_junk(msg());
       results << msg();
    }
@@ -222,7 +222,7 @@ bool Console::sql_cmd(const char *query, QStringList &results)
    pm_strcat(cmd, "\"");
    write(cmd.c_str());
    while ((stat = read()) > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
       strip_trailing_junk(msg());
       results << msg();
    }
@@ -247,7 +247,7 @@ bool Console::get_job_defaults(struct job_defaults &job_defs)
    scmd = QString(".defaults job=\"%1\"").arg(job_defs.job_name);
    write(scmd);
    while ((stat = read()) > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
       def = strchr(msg(), '=');
       if (!def) {
          continue;
@@ -474,7 +474,7 @@ int Console::write(const char *msg)
    m_sock->msglen = pm_strcpy(m_sock->msg, msg);
    m_at_prompt = false;
    m_at_main_prompt = false;
-   if (g_commDebug) Pmsg1(000, "send: %s\n", msg);
+   if (mainWin->m_commDebug) Pmsg1(000, "send: %s\n", msg);
    return m_sock->send();
 }
 
@@ -485,15 +485,15 @@ void Console::beginNewCommand()
 {
    write(".\n");
    while (read() > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
    }
    write(".\n");
    while (read() > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
    }
    write(".\n");
    while (read() > 0) {
-      if (g_displayAll) display_text(msg());
+      if (mainWin->m_displayAll) display_text(msg());
    }
    display_text("\n");
 }
@@ -501,25 +501,25 @@ void Console::beginNewCommand()
 void Console::displayToPrompt()
 { 
    int stat;
-   if (g_commDebug) Pmsg0(000, "DisplaytoPrompt\n");
+   if (mainWin->m_commDebug) Pmsg0(000, "DisplaytoPrompt\n");
    while (!m_at_prompt) {
       if ((stat=read()) > 0) {
          display_text(msg());
       }
    }
-   if (g_commDebug) Pmsg1(000, "endDisplaytoPrompt=%d\n", stat);
+   if (mainWin->m_commDebug) Pmsg1(000, "endDisplaytoPrompt=%d\n", stat);
 }
 
 void Console::discardToPrompt()
 { 
    int stat;
-   if (g_commDebug) Pmsg0(000, "discardToPrompt\n");
+   if (mainWin->m_commDebug) Pmsg0(000, "discardToPrompt\n");
    while (!m_at_prompt) {
       if ((stat=read()) > 0) {
-         if (g_displayAll) display_text(msg());
+         if (mainWin->m_displayAll) display_text(msg());
       }
    }
-   if (g_commDebug) Pmsg1(000, "endDisplayToPrompt=%d\n", stat);
+   if (mainWin->m_commDebug) Pmsg1(000, "endDisplayToPrompt=%d\n", stat);
 }
 
 
@@ -548,27 +548,27 @@ int Console::read()
             m_at_prompt = false;
             m_at_main_prompt = false;
          }
-         if (g_commDebug) Pmsg1(000, "got: %s", m_sock->msg);
+         if (mainWin->m_commDebug) Pmsg1(000, "got: %s", m_sock->msg);
       }
       switch (m_sock->msglen) {
       case BNET_MSGS_PENDING:
-         if (g_commDebug) Pmsg0(000, "MSGS PENDING\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "MSGS PENDING\n");
          write_dir(".messages");
          displayToPrompt();
          m_messages_pending = false;
          continue;
       case BNET_CMD_OK:
-         if (g_commDebug) Pmsg0(000, "CMD OK\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "CMD OK\n");
          m_at_prompt = false;
          m_at_main_prompt = false;
          continue;
       case BNET_CMD_BEGIN:
-         if (g_commDebug) Pmsg0(000, "CMD BEGIN\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "CMD BEGIN\n");
          m_at_prompt = false;
          m_at_main_prompt = false;
          continue;
       case BNET_MAIN_PROMPT:
-         if (g_commDebug) Pmsg0(000, "PROMPT\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "PROMPT\n");
          m_at_prompt = true;
          m_at_main_prompt = true;
          mainWin->set_status(_("At prompt waiting for input ..."));
@@ -576,7 +576,7 @@ int Console::read()
          QApplication::restoreOverrideCursor();
          break;
       case BNET_PROMPT:
-         if (g_commDebug) Pmsg0(000, "PROMPT\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "PROMPT\n");
          m_at_prompt = true;
          m_at_main_prompt = false;
          mainWin->set_status(_("At prompt waiting for input ..."));
@@ -584,14 +584,14 @@ int Console::read()
          QApplication::restoreOverrideCursor();
          break;
       case BNET_CMD_FAILED:
-         if (g_commDebug) Pmsg0(000, "CMD FAIL\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "CMD FAIL\n");
          mainWin->set_status(_("Command failed. At prompt waiting for input ..."));
          update_cursor();
          QApplication::restoreOverrideCursor();
          break;
       /* We should not get this one */
       case BNET_EOD:
-         if (g_commDebug) Pmsg0(000, "EOD\n");
+         if (mainWin->m_commDebug) Pmsg0(000, "EOD\n");
          mainWin->set_status_ready();
          update_cursor();
          QApplication::restoreOverrideCursor();
@@ -646,7 +646,7 @@ void Console::read_dir(int fd)
    int stat;
    (void)fd;
 
-   if (g_commDebug) Pmsg0(000, "read_dir\n");
+   if (mainWin->m_commDebug) Pmsg0(000, "read_dir\n");
    while ((stat = read()) >= 0) {
       display_text(msg());
    }
index deb2743daca3e46954befa780adc7b22d4e47147..1aeb9a1bb052d20c20a7a9055b39f6641032d133 100644 (file)
@@ -81,8 +81,6 @@ void FileSet::populateTree()
 
    mp_treeWidget->setColumnCount(headerlist.count());
    mp_treeWidget->setHeaderLabels(headerlist);
-   /* This could be a log item */
-   //printf("In FileSet::populateTree()\n");
 
    foreach(QString filesetName, m_console->fileset_list) {
       filesetItem = new QTreeWidgetItem(topItem);
@@ -99,8 +97,9 @@ void FileSet::populateTree()
       query += " ORDER BY FileSet";
 
       QStringList results;
-      /* This could be a log item */
-      //printf("FileSet query cmd : %s\n",query.toUtf8().data());
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "FileSet query cmd : %s\n",query.toUtf8().data());
+      }
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount == 1){
index ec02dfdf0c6ebb5957168aa95d94fc553ca46a58..d31043709dc1d9794f43c36c710bbb8b05487eb9 100644 (file)
@@ -57,10 +57,10 @@ JobList::JobList(QString &mediaName, QString &clientname,
    createConnections();
 
    /* Set Defaults for check and spin for limits */
-   limitCheckBox->setCheckState(Qt::Checked);
-   limitSpinBox->setValue(150);
-   daysCheckBox->setCheckState(Qt::Unchecked);
-   daysSpinBox->setValue(30);
+   limitCheckBox->setCheckState(mainWin->m_recordLimitCheck ? Qt::Checked : Qt::Unchecked);
+   limitSpinBox->setValue(mainWin->m_recordLimitVal);
+   daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
+   daysSpinBox->setValue(mainWin->m_daysLimitVal);
 }
 
 /*
@@ -86,8 +86,10 @@ void JobList::populateTable()
       if (clientIndex != -1)
          clientsComboBox->setCurrentIndex(clientIndex);
 
-      /* Not m_console->volume_list will query database */
       QString query("SELECT VolumeName AS Media FROM Media ORDER BY Media");
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data());
+      }
       QStringList results, volumeList;
       if (m_console->sql_cmd(query, results)) {
          QString field;
@@ -114,6 +116,9 @@ void JobList::populateTable()
       fileSetComboBox->addItem("Any");
       fileSetComboBox->addItems(m_console->fileset_list);
       QString statusQuery("SELECT JobStatusLong FROM Status");
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data());
+      }
       QStringList statusResults, statusLongList;
       if (m_console->sql_cmd(statusQuery, statusResults)) {
          QString field;
@@ -213,8 +218,9 @@ void JobList::populateTable()
    mp_tableWidget->setColumnCount(headerlist.size());
    mp_tableWidget->setHorizontalHeaderLabels(headerlist);
 
-   /*  This could be a user preference debug message?? */
-   printf("Query cmd : %s\n",query.toUtf8().data());
+   if (mainWin->m_sqlDebug) {
+      Pmsg1(000, "Query cmd : %s\n",query.toUtf8().data());
+   }
    if (m_console->sql_cmd(query, results)) {
       m_resultCount = results.count();
 
index 95abf3e00f006b49196ca96d7cbf43d0962cda7e..fd67d053e18cedd47fc3fc6945f57dbd9be22723 100644 (file)
          <item>
           <widget class="QSpinBox" name="daysSpinBox" >
            <property name="singleStep" >
-            <number>10</number>
+            <number>7</number>
            </property>
           </widget>
          </item>
   </layout>
   <action name="actionRefreshJobList" >
    <property name="icon" >
-    <iconset>:images/run.png</iconset>
+    <iconset>../../../../../../../:images/run.png</iconset>
    </property>
    <property name="text" >
     <string>Refresh Job List</string>
   </action>
   <action name="actionListJobid" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListJobid</string>
   </action>
   <action name="actionListFilesOnJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>List Files On Job</string>
   </action>
   <action name="actionListJobMedia" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListJobMedia</string>
   </action>
   <action name="actionListVolumes" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>ListVolumes</string>
   </action>
   <action name="actionLongListJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>LongListJob</string>
   </action>
   <action name="actionDeleteJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>DeleteJob</string>
   </action>
   <action name="actionPurgeFiles" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>PurgeFiles</string>
   </action>
   <action name="actionRestoreFromJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>Restore From Job</string>
   </action>
   <action name="actionRestoreFromTime" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>Restore From Time</string>
   </action>
   <action name="actionShowLogForJob" >
    <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
+    <iconset>../../../../../../../:images/unmark.png</iconset>
    </property>
    <property name="text" >
     <string>Show Log for Job</string>
index 6185c5ba6216984368371c62d6382a7ab1ab4dc9..b4c0ad83659fdcba4a549854d0a4abc71753b881 100644 (file)
@@ -92,8 +92,9 @@ void labelPage::okButtonPushed()
                   .arg(poolCombo->currentText())
                   .arg(storageCombo->currentText()) 
                   .arg(slotSpin->value());
-   /* FIXME Make this a user configurable logging action and dont use printf */
-   //printf("sending command : %s\n",scmd.toUtf8().data());
+   if (mainWin->m_commandDebug) {
+      Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
+   }
    m_console->write_dir(scmd.toUtf8().data());
    m_console->displayToPrompt();
    m_console->notify(true);
index 43eeaf6a872df04a601ba5be2dec217d70148ed0..e5d81457262d0bc58e86bc8f0f3c17ef0587ed73 100644 (file)
 MainWin *mainWin;
 QApplication *app;
 
-/*
- * ***FIXME*** move the following two into the MainWin class or
- *   the Console class.
- */
-bool g_commDebug = false;
-bool g_displayAll = false;
-
-
 /* Forward referenced functions */
 void terminate_console(int sig);                                
 static void usage();
index 561bd75f199b6d048bec53f61a88d9f9ce390d5d..0e23313aa4003289f47f47648d5b619fc84c27bb 100644 (file)
@@ -52,6 +52,7 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
 
    mainWin = this;
    setupUi(this);                     /* Setup UI defined by main.ui (designer) */
+   readPreferences();
    treeWidget->clear();
    treeWidget->setColumnCount(1);
    treeWidget->setHeaderLabel("Select Page");
@@ -72,11 +73,11 @@ MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
    }
    m_currentConsole = (Console*)getFromHash(m_firstItem);
    m_currentConsole->setCurrent();
-   /*  FIXME
-    *  I'd like to turn this into a debug item
-    *  DIRRES* dirres = m_currentConsole->getDirRes();
-    *  printf("Setting initial window to %s\n", dirres->name());
-    */
+   if (m_miscDebug) {
+      QString directoryResourceName;
+      m_currentConsole->getDirResName(directoryResourceName);
+      Pmsg1(000, "Setting initial window to %s\n", directoryResourceName.toUtf8().data());
+   }
 }
 
 void MainWin::createPages()
@@ -608,8 +609,15 @@ QTreeWidgetItem *MainWin::currentTopItem()
 void MainWin::setPreferences()
 {
    prefsDialog prefs;
-   prefs.commDebug->setCheckState(g_commDebug ? Qt::Checked : Qt::Unchecked);
-   prefs.displayAll->setCheckState(g_displayAll ? Qt::Checked : Qt::Unchecked);
+   prefs.commDebug->setCheckState(m_commDebug ? Qt::Checked : Qt::Unchecked);
+   prefs.displayAll->setCheckState(m_displayAll ? Qt::Checked : Qt::Unchecked);
+   prefs.sqlDebug->setCheckState(m_sqlDebug ? Qt::Checked : Qt::Unchecked);
+   prefs.commandDebug->setCheckState(m_commandDebug ? Qt::Checked : Qt::Unchecked);
+   prefs.miscDebug->setCheckState(m_miscDebug ? Qt::Checked : Qt::Unchecked);
+   prefs.recordLimit->setCheckState(m_recordLimitCheck ? Qt::Checked : Qt::Unchecked);
+   prefs.recordSpinBox->setValue(m_recordLimitVal);
+   prefs.daysLimit->setCheckState(m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
+   prefs.daysSpinBox->setValue(m_daysLimitVal);
    prefs.exec();
 }
 
@@ -622,8 +630,27 @@ prefsDialog::prefsDialog()
 void prefsDialog::accept()
 {
    this->hide();
-   g_commDebug = this->commDebug->checkState() == Qt::Checked;
-   g_displayAll = this->displayAll->checkState() == Qt::Checked;
+   mainWin->m_commDebug = this->commDebug->checkState() == Qt::Checked;
+   mainWin->m_displayAll = this->displayAll->checkState() == Qt::Checked;
+   mainWin->m_sqlDebug = this->sqlDebug->checkState() == Qt::Checked;
+   mainWin->m_commandDebug = this->commandDebug->checkState() == Qt::Checked;
+   mainWin->m_miscDebug = this->miscDebug->checkState() == Qt::Checked;
+   mainWin->m_recordLimitCheck = this->recordLimit->checkState() == Qt::Checked;
+   mainWin->m_recordLimitVal = this->recordSpinBox->value();
+   mainWin->m_daysLimitCheck = this->daysLimit->checkState() == Qt::Checked;
+   mainWin->m_daysLimitVal = this->daysSpinBox->value();
+   QSettings settings("www.bacula.org", "bat");
+   settings.beginGroup("Messages");
+   settings.setValue("commDebug", mainWin->m_commDebug);
+   settings.setValue("displayAll", mainWin->m_displayAll);
+   settings.setValue("sqlDebug", mainWin->m_sqlDebug);
+   settings.setValue("commandDebug", mainWin->m_commandDebug);
+   settings.setValue("miscDebug", mainWin->m_miscDebug);
+   settings.setValue("recordLimitCheck", mainWin->m_recordLimitCheck);
+   settings.setValue("recordLimitVal", mainWin->m_recordLimitVal);
+   settings.setValue("daysLimitCheck", mainWin->m_daysLimitCheck);
+   settings.setValue("daysLimitVal", mainWin->m_daysLimitVal);
+   settings.endGroup();
 }
 
 void prefsDialog::reject()
@@ -631,3 +658,20 @@ void prefsDialog::reject()
    this->hide();
    mainWin->set_status("Canceled");
 }
+
+/* read preferences for the prefences dialog box */
+void MainWin::readPreferences()
+{
+   QSettings settings("www.bacula.org", "bat");
+   settings.beginGroup("Messages");
+   m_commDebug = settings.value("commDebug", false).toBool();
+   m_displayAll = settings.value("displayAll", false).toBool();
+   m_sqlDebug = settings.value("sqlDebug", false).toBool();
+   m_commandDebug = settings.value("commandDebug", false).toBool();
+   m_miscDebug = settings.value("miscDebug", false).toBool();
+   m_recordLimitCheck = settings.value("recordLimitCheck", true).toBool();
+   m_recordLimitVal = settings.value("recordLimitVal", 150).toInt();
+   m_daysLimitCheck = settings.value("daysLimitCheck", false).toBool();
+   m_daysLimitVal = settings.value("daysLimitVal", 28).toInt();
+   settings.endGroup();
+}
index 814b1889e8abfb8cfcf84fa43856def83616d51d..0e965c6b8c71b03286cc84530d8c26615b1a6246 100644 (file)
@@ -69,6 +69,16 @@ public:
    /* This is a list of consoles */
    QHash<QTreeWidgetItem*,Console*> m_consoleHash;
    void createPageJobList(QString &, QString &, QTreeWidgetItem *);
+   bool m_commDebug;
+   bool m_displayAll;
+   bool m_sqlDebug;
+   bool m_commandDebug;
+   bool m_miscDebug;
+   bool m_recordLimitCheck;
+   int m_recordLimitVal;
+   bool m_daysLimitCheck;
+   int m_daysLimitVal;
+
 
 public slots:
    void input_line();
@@ -83,6 +93,7 @@ public slots:
    void toggleDockContextWindow();
    void closePage();
    void setPreferences();
+   void readPreferences();
 
 protected:
    void closeEvent(QCloseEvent *event);
index ee0bdb987cd0b2e8c0bf2b11d09e6aa57f9f5780..d846463f5a083f005657dfa85c6390b3ab6191b0 100644 (file)
@@ -78,8 +78,9 @@ MediaEdit::MediaEdit(Console *console, QString &mediaId)
    query += " AND Media.MediaId='" + mediaId + "'";
    query += " ORDER BY Pool.Name";
 
-   /* FIXME Make this a user configurable logging action and dont use printf */
-   //printf("MediaList query cmd : %s\n",query.toUtf8().data());
+   if (mainWin->m_sqlDebug) {
+      Pmsg1(000, "MediaList query cmd : %s\n",query.toUtf8().data());
+   }
    QStringList results;
    if (m_console->sql_cmd(query, results)) {
       QString field;
@@ -157,8 +158,9 @@ void MediaEdit::accept()
        docmd = true;
    }
    if (docmd) {
-      /* FIXME Make this a user configurable logging action and dont use printf */
-      //printf("sending command : %s\n",scmd.toUtf8().data());
+      if (mainWin->m_commandDebug) {
+         Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
+      }
       m_console->write_dir(scmd.toUtf8().data());
       m_console->displayToPrompt();
       m_console->notify(true);
index 894c937dc49c57a08bf2d5b506dd93a920f09b13..544f0c91f1aee20e5254771e2e9eb7c42fbc9cb0 100644 (file)
@@ -106,8 +106,9 @@ void MediaList::populateTree()
       query += " AND Pool.Name='" + pool_listItem + "'";
       query += " ORDER BY Media";
    
-      /* FIXME Make this a user configurable loggin action and dont use printf */
-      //printf("MediaList query cmd : %s\n",query.toUtf8().data());
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "MediaList query cmd : %s\n",query.toUtf8().data());
+      }
       QStringList results;
       if (m_console->sql_cmd(query, results)) {
          QString field;
index 53dc9a919e49288ca39312bd8f740254d4c0ab0f..6e430ba0f616d176b34acad0ac331ad34b7c6b3a 100644 (file)
@@ -65,8 +65,9 @@ void mountDialog::accept()
    scmd = QString("mount storage=\"%1\" slot=%2")
                   .arg(m_storageName)
                   .arg(slotSpin->value());
-   /* FIXME Make this a user configurable logging action and dont use printf */
-   //printf("sending command : %s\n",scmd.toUtf8().data());
+   if (mainWin->m_commandDebug) {
+      Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
+   }
 
    m_console->display_text("Context sensitive command :\n\n");
    m_console->display_text("****    ");
index 492e8585a9be3332b0d86f7f30dd01a3ef71a95d..1ad81c84668a5dc096fe983d535e155653fb32cd 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>277</width>
-    <height>224</height>
+    <width>384</width>
+    <height>378</height>
    </rect>
   </property>
   <property name="sizePolicy" >
   <property name="windowIcon" >
    <iconset>images/bat.png</iconset>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
-    <number>9</number>
+  <widget class="QDialogButtonBox" name="buttonBox" >
+   <property name="geometry" >
+    <rect>
+     <x>9</x>
+     <y>343</y>
+     <width>366</width>
+     <height>26</height>
+    </rect>
    </property>
-   <property name="spacing" >
-    <number>6</number>
+   <property name="orientation" >
+    <enum>Qt::Horizontal</enum>
    </property>
-   <item row="1" column="0" >
+   <property name="standardButtons" >
+    <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+   </property>
+  </widget>
+  <widget class="QWidget" name="layoutWidget" >
+   <property name="geometry" >
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>310</width>
+     <height>25</height>
+    </rect>
+   </property>
+   <layout class="QHBoxLayout" >
+    <property name="margin" >
+     <number>0</number>
+    </property>
+    <property name="spacing" >
+     <number>6</number>
+    </property>
+    <item>
+     <spacer>
+      <property name="orientation" >
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="sizeHint" >
+       <size>
+        <width>81</width>
+        <height>20</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+    <item>
+     <widget class="QLabel" name="label" >
+      <property name="sizePolicy" >
+       <sizepolicy>
+        <hsizetype>5</hsizetype>
+        <vsizetype>0</vsizetype>
+        <horstretch>0</horstretch>
+        <verstretch>0</verstretch>
+       </sizepolicy>
+      </property>
+      <property name="text" >
+       <string>&lt;h2>Preferences&lt;/h2></string>
+      </property>
+     </widget>
+    </item>
+    <item>
+     <spacer>
+      <property name="orientation" >
+       <enum>Qt::Horizontal</enum>
+      </property>
+      <property name="sizeHint" >
+       <size>
+        <width>101</width>
+        <height>20</height>
+       </size>
+      </property>
+     </spacer>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QTabWidget" name="tabWidget" >
+   <property name="geometry" >
+    <rect>
+     <x>9</x>
+     <y>40</y>
+     <width>366</width>
+     <height>297</height>
+    </rect>
+   </property>
+   <property name="currentIndex" >
+    <number>1</number>
+   </property>
+   <widget class="QWidget" name="tab" >
+    <attribute name="title" >
+     <string>Messages</string>
+    </attribute>
     <widget class="QGroupBox" name="groupBox" >
+     <property name="geometry" >
+      <rect>
+       <x>10</x>
+       <y>30</y>
+       <width>271</width>
+       <height>181</height>
+      </rect>
+     </property>
      <property name="sizePolicy" >
       <sizepolicy>
        <hsizetype>5</hsizetype>
      <property name="title" >
       <string>Debugging Options</string>
      </property>
-     <layout class="QHBoxLayout" >
+     <widget class="QWidget" name="layoutWidget" >
+      <property name="geometry" >
+       <rect>
+        <x>10</x>
+        <y>21</y>
+        <width>241</width>
+        <height>131</height>
+       </rect>
+      </property>
+      <layout class="QGridLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item row="0" column="0" >
+        <widget class="QCheckBox" name="commDebug" >
+         <property name="text" >
+          <string>Debug comm</string>
+         </property>
+        </widget>
+       </item>
+       <item row="1" column="0" >
+        <widget class="QCheckBox" name="displayAll" >
+         <property name="text" >
+          <string>Display all messages in console</string>
+         </property>
+        </widget>
+       </item>
+       <item row="3" column="0" >
+        <widget class="QCheckBox" name="commandDebug" >
+         <property name="text" >
+          <string>Debug Commands</string>
+         </property>
+        </widget>
+       </item>
+       <item row="2" column="0" >
+        <widget class="QCheckBox" name="sqlDebug" >
+         <property name="text" >
+          <string>Debug Sql queries</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0" >
+        <widget class="QCheckBox" name="miscDebug" >
+         <property name="text" >
+          <string>Debug Miscelaneous Items</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </widget>
+    </widget>
+   </widget>
+   <widget class="QWidget" name="tab_2" >
+    <attribute name="title" >
+     <string>Joblist</string>
+    </attribute>
+    <widget class="QGroupBox" name="groupBox_2" >
+     <property name="geometry" >
+      <rect>
+       <x>9</x>
+       <y>62</y>
+       <width>301</width>
+       <height>146</height>
+      </rect>
+     </property>
+     <property name="sizePolicy" >
+      <sizepolicy>
+       <hsizetype>5</hsizetype>
+       <vsizetype>0</vsizetype>
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="title" >
+      <string>Jolist Limit Options</string>
+     </property>
+     <layout class="QGridLayout" >
       <property name="margin" >
        <number>9</number>
       </property>
       <property name="spacing" >
        <number>6</number>
       </property>
-      <item>
+      <item row="0" column="0" >
        <layout class="QGridLayout" >
         <property name="margin" >
          <number>0</number>
         <property name="spacing" >
          <number>6</number>
         </property>
-        <item row="1" column="0" >
-         <widget class="QCheckBox" name="displayAll" >
+        <item row="2" column="0" >
+         <widget class="QCheckBox" name="daysLimit" >
           <property name="text" >
-           <string>Display all messages</string>
+           <string>Days Limit</string>
+          </property>
+         </widget>
+        </item>
+        <item row="3" column="0" >
+         <widget class="QSpinBox" name="daysSpinBox" >
+          <property name="maximum" >
+           <number>10000</number>
+          </property>
+          <property name="minimum" >
+           <number>1</number>
+          </property>
+          <property name="singleStep" >
+           <number>7</number>
+          </property>
+         </widget>
+        </item>
+        <item row="1" column="0" >
+         <widget class="QSpinBox" name="recordSpinBox" >
+          <property name="maximum" >
+           <number>10000</number>
+          </property>
+          <property name="minimum" >
+           <number>1</number>
+          </property>
+          <property name="singleStep" >
+           <number>25</number>
           </property>
          </widget>
         </item>
         <item row="0" column="0" >
-         <widget class="QCheckBox" name="commDebug" >
+         <widget class="QCheckBox" name="recordLimit" >
           <property name="text" >
-           <string>Debug comm</string>
+           <string>Record Limit</string>
           </property>
          </widget>
         </item>
       </item>
      </layout>
     </widget>
-   </item>
-   <item row="2" column="0" >
-    <widget class="QDialogButtonBox" name="buttonBox" >
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons" >
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="0" >
-    <layout class="QHBoxLayout" >
-     <property name="margin" >
-      <number>0</number>
-     </property>
-     <property name="spacing" >
-      <number>6</number>
-     </property>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>81</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-     <item>
-      <widget class="QLabel" name="label" >
-       <property name="sizePolicy" >
-        <sizepolicy>
-         <hsizetype>5</hsizetype>
-         <vsizetype>0</vsizetype>
-         <horstretch>0</horstretch>
-         <verstretch>0</verstretch>
-        </sizepolicy>
-       </property>
-       <property name="text" >
-        <string>&lt;h2>Preferences&lt;/h2></string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <spacer>
-       <property name="orientation" >
-        <enum>Qt::Horizontal</enum>
-       </property>
-       <property name="sizeHint" >
-        <size>
-         <width>101</width>
-         <height>20</height>
-        </size>
-       </property>
-      </spacer>
-     </item>
-    </layout>
-   </item>
-  </layout>
+   </widget>
+  </widget>
  </widget>
  <resources/>
  <connections>
index 27d1e3b7e24201641f4148d11993aeac6a701151..78e32c47b0087583b0e4264fa3e5db216fff4004 100644 (file)
@@ -78,8 +78,9 @@ void relabelDialog::accept()
                   .arg(volumeName->text())
                   .arg(poolCombo->currentText())
                   .arg(slotSpin->value());
-   /* FIXME Make this a user configurable logging action and dont use printf */
-   //printf("sending command : %s\n",scmd.toUtf8().data());
+   if (mainWin->m_commandDebug) {
+      Pmsg1(000, "sending command : %s\n",scmd.toUtf8().data());
+   }
    m_console->write_dir(scmd.toUtf8().data());
    m_console->displayToPrompt();
    m_console->notify(true);
index 7a6829261fbc210c6dfd65f9105043d528d3d9c1..9b065762a33449119f331a5404d90691ea99f33a 100644 (file)
@@ -166,8 +166,9 @@ void prerestorePage::okButtonPushed()
       cmd += " all done";
    }
 
-   /* ***FIXME*** */
-   //printf("preRestore command \'%s\'\n", cmd.toUtf8().data());
+   if (mainWin->m_commandDebug) {
+      Pmsg1(000, "preRestore command \'%s\'\n", cmd.toUtf8().data());
+   }
    consoleCommand(cmd);
    /* Note, do not turn notifier back on here ... */
    if (selectFilesRadio->isChecked()) {
@@ -239,7 +240,7 @@ int prerestorePage::jobdefsFromJob(QStringList &fieldlist, QString &jobId)
    " From Job, Client, FileSet"
    " WHERE Job.FileSetId=FileSet.FileSetId AND Job.ClientId=Client.ClientId"
    " AND JobId=\'" + jobId + "\'";
-   //printf("query = %s\n", query.toUtf8().data());
+   if (mainWin->m_sqlDebug) { Pmsg1(000, "query = %s\n", query.toUtf8().data()); }
    QStringList results;
    if (m_console->sql_cmd(query, results)) {
       QString field;
index 0f5e75dbe6d7866eb74fe38f5cb673aa9256dd40..0b3d2526612a62ab288cc289bd3022a6f726d41d 100644 (file)
@@ -162,22 +162,30 @@ void restorePage::addDirectory(QString &newdirr)
    bool ok = true;
    bool windrive = false;
 
-   //printf("In addDirectory cwd \"%s\" newdir \"%s\"\n", m_cwd.toUtf8().data(),
-        //newdir.toUtf8().data());
+   if (mainWin->m_miscDebug) {
+      QString msg = QString("In addDirectory cwd \"%1\" newdir \"%2\"\n")
+                    .arg(m_cwd)
+                    .arg(newdir);
+      Pmsg0(000, msg.toUtf8().data());
+   }
 
    /* add unix '/' directory first */
    if (m_dirPaths.empty() && (regex.indexIn(fullpath,0) == -1)) {
       QTreeWidgetItem *item = new QTreeWidgetItem(directoryWidget);
       QString text("/");
       item->setText(0, text.toUtf8().data());
-      //printf("Pre Inserting %s\n",text.toUtf8().data());
+      if (mainWin->m_miscDebug) {
+         Pmsg1(000, "Pre Inserting %s\n",text.toUtf8().data());
+      }
       m_dirPaths.insert(text, item);
       m_dirTreeItems.insert(item, text);
    }
 
    if (regex.indexIn(fullpath,0) == 0) {
       /* this is a windows drive */
-      //printf("Need to do windows \"letter\":/\n");
+      if (mainWin->m_miscDebug) {
+         printf("Need to do windows \"letter\":/\n");
+      }
       fullpath.replace(0,1,"");
       windrive = true;
    }
@@ -198,13 +206,19 @@ void restorePage::addDirectory(QString &newdirr)
             directoryWidget->expandItem(parent);
          } else {
             ok = false;
-            //printf("In else of if parent cwd \"%s\" newdir \"%s\"\n", 
-               //m_cwd.toUtf8().data() ,newdir.toUtf8().data());
+            if (mainWin->m_miscDebug) {
+               QString msg = QString("In else of if parent cwd \"%1\" newdir \"%2\"\n")
+                    .arg(m_cwd)
+                    .arg(newdir);
+               Pmsg0(000, msg.toUtf8().data());
+            }
          }
       }
       /* insert into both forward and reverse hash */
       if (ok) {
-         //printf("Inserting %s\n",fullpath.toUtf8().data());
+         if (mainWin->m_miscDebug) {
+            Pmsg1(000, "Inserting %s\n",fullpath.toUtf8().data());
+         }
          m_dirPaths.insert(fullpath, item);
          m_dirTreeItems.insert(item, fullpath);
       }
@@ -280,8 +294,10 @@ void restorePage::fileDoubleClicked(QTreeWidgetItem *item, int column)
       if (item) {
          directoryWidget->setCurrentItem(item);
       } else {
-         /* FIXME ***** Create an error log */
-         //printf("DoubleClick else of item column %i fullpath %s\n", column, fullpath.toUtf8().data());
+         QString msg = QString("DoubleClick else of item column %1 fullpath %2\n")
+              .arg(column,10)
+              .arg(fullpath);
+         Pmsg0(000, msg.toUtf8().data());
       }
    }
 }
index 4a5e32ac4820f8a2f56534fd8fdf61cba7d3fc61..8dd41a89e6f897e24dfaa753ab16ab07e003c1fb 100644 (file)
@@ -84,8 +84,6 @@ void Storage::populateTree()
 
    mp_treeWidget->setColumnCount(headerlist.count());
    mp_treeWidget->setHeaderLabels(headerlist);
-   /* This could be a log item */
-   //printf("In Storage::populateTree()\n");
 
    foreach(QString storageName, m_console->storage_list){
       storageItem = new QTreeWidgetItem(topItem);
@@ -101,7 +99,9 @@ void Storage::populateTree()
 
       QStringList results;
       /* This could be a log item */
-      //printf("Storage query cmd : %s\n",query.toUtf8().data());
+      if (mainWin->m_sqlDebug) {
+         Pmsg1(000, "Storage query cmd : %s\n",query.toUtf8().data());
+      }
       if (m_console->sql_cmd(query, results)) {
          int resultCount = results.count();
          if (resultCount == 1){