]> git.sur5r.net Git - bacula/bacula/commitdiff
Add preference for longlist or short list when context sensitive list command is
authorDirk H Bartley <dbartley@schupan.com>
Mon, 28 May 2007 00:52:41 +0000 (00:52 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Mon, 28 May 2007 00:52:41 +0000 (00:52 +0000)
executed.  Use this instead of doubling for list and long list.  Used for now in
joblist.
Use consoleCommand when running command from user command input so that it
displays blue.
Add reload command from page selector console widget.
Add list job totals from page selector joblist widget.

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

12 files changed:
bacula/src/qt-console/COMMANDS
bacula/src/qt-console/TODO
bacula/src/qt-console/console/console.cpp
bacula/src/qt-console/console/console.h
bacula/src/qt-console/console/console.ui
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblist/joblist.h
bacula/src/qt-console/joblist/joblist.ui
bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h
bacula/src/qt-console/pages.h
bacula/src/qt-console/prefs.ui

index f2ffca09dbde2248ef9bb2d4a9a735c1f0d2d2d8..f70f2e1408d45e12acc734894df4a49cb35c2740 100644 (file)
@@ -1,4 +1,4 @@
-cancel [jobid=<number> job=<job-name> ujobid=<unique-jobid>]
+cancel [job=<job-name> ujobid=<unique-jobid>]
 To be done in the context of a status dir graphical window.
 Also in a "job resources window for job-name".
 
@@ -9,24 +9,21 @@ delete pool=<pool-name>
 disable job<job-name>     and     enable job<job-name>
 Could be done in the context of a jobs resource window which is not yet created
 
-estimate
-Could be a dialog in the context of a jobs window.
-
 list
-many are done or are reproduced by having windows
-
-llist
-same as list
+   list ujobid<unique job name> (list job with unique name)
+   list files job=<job-name>
+  do this as a context option on page selector on joblist
+   list volumes job=<job-name>
+   list nextvolume job=<job-name>
+   list nextvol job=<job-name>
+   list nextvol job=<job-name> days=nnn
 
 prune files|jobs|volume client=<client-name> volume=<volume-name>
-Should add as a dialog box from both client and medialist
+could add as a dialog box from both client and medialist
 
 release storage=<storage-name>
 Would need to explain what this does in bat with a dialog
 
-reload
-could be done in console or on director's page selector widget
-
 run
 done
 
@@ -86,10 +83,34 @@ DONE
 automount on/off
 Added buttons to the label dialog box to execute automount command
 
+cancel jobid=<number>
+
 delete [volume=<vol-name> job jobid=<id>]
 
+estimate
+Could be a dialog in the context of a jobs window.
+
+list
+   list jobid=<id>           (list jobid id)
+   list files jobid=<id>
+   list jobmedia jobid=<id>
+   list volumes jobid=<id>
+   list jobtotals (from page selector on joblist widget)
+   The next few are accomplishable graphically with joblist class
+     list jobs
+     list job=<job-name>   (list all jobs with "job-name")
+     list jobname=<job-name>  (same as above)
+     list jobmedia
+     list jobmedia job=<job-name>
+   The next few are accomplishable graphically with the medialist class
+     list volumes
+     list volumes pool=<pool-name>
+     list volume=<volume-name>  
+     list pools
+   Accomplishable with the clients class graphically
+     list clients
 help
-could be in the console window
+  context sensitive from page selector console
 
 label
 Done by kern before I started
@@ -100,3 +121,6 @@ purge jobs client=<client-name> (of all jobs)
 
 relabel
 done
+
+reload
+could be done in console or on director's page selector widget
index 2a05252b75ac7e6c79a4ab74ff3b105b54851398..71c4f8fcc4b7603fe2b3dd58c2f6ac4e4f914bec 100644 (file)
@@ -7,6 +7,8 @@ As well as many more
 update slots scan
 see COMMANDS file
 
+Create edit pool interface.
+
 ========LOW priority items:
 Use settings object to size the restore window.  Similar to the saving of the
 state of the main window.
index f9f96a7cf4f1caec0eb5dd5b04cd39bc69f80256..e09239ed63b051c3c7ae012da5d481240ecd038c 100644 (file)
@@ -63,8 +63,10 @@ Console::Console(QStackedWidget *parent)
    m_contextActions.append(actionStatusDir);
    m_contextActions.append(actionConsoleHelp);
    m_contextActions.append(actionRequestMessages);
+   m_contextActions.append(actionConsoleReload);
    connect(actionStatusDir, SIGNAL(triggered()), this, SLOT(status_dir()));
    connect(actionConsoleHelp, SIGNAL(triggered()), this, SLOT(consoleHelp()));
+   connect(actionConsoleReload, SIGNAL(triggered()), this, SLOT(consoleReload()));
    connect(actionRequestMessages, SIGNAL(triggered()), this, SLOT(messages()));
 }
 
@@ -829,3 +831,10 @@ void Console::consoleHelp()
    QString cmd("help");
    consoleCommand(cmd);
 }
+
+/* Slot for responding to page selectors reload bacula-dir.conf */
+void Console::consoleReload()
+{
+   QString cmd("reload");
+   consoleCommand(cmd);
+}
index 295ebfeabb77fffe17aa42c8c89d8078c49907fe..03361028eeca453a74f05c8e628a6899c4c02d84 100644 (file)
@@ -124,6 +124,7 @@ public slots:
    void set_font(void);
    void poll_messages(void);
    void consoleHelp();
+   void consoleReload();
 
 public:
    DIRRES *m_dir;                  /* so various pages can reference it */
index d4b9c4bc1a540af0beda5c34defd0dec0f79d8d5..c43facec2e7ced2ed2ec7152118e4abfeb6f483f 100644 (file)
@@ -87,7 +87,7 @@
   </action>
   <action name="actionConsoleHelp" >
    <property name="text" >
-    <string>ConsoleHelp</string>
+    <string>Console Help</string>
    </property>
   </action>
   <action name="actionRequestMessages" >
     <string>Request Messages</string>
    </property>
   </action>
+  <action name="actionConsoleReload" >
+   <property name="text" >
+    <string>Reload bacula-dir.conf</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections/>
index 698e763be1560e7806d3a5b39d38d27cbe81a7b0..0fdd0b57a76df7f1dcfe2c81d350f3dac499dc82 100644 (file)
@@ -305,7 +305,6 @@ void JobList::currentStackItem()
 {
    populateTable();
    if (!m_populated) {
-      m_contextActions.append(actionRefreshJobList);
       m_populated=true;
    }
 }
@@ -389,7 +388,6 @@ void JobList::createConnections()
 
    /* Add Actions */
    mp_tableWidget->addAction(actionRefreshJobList);
-   mp_tableWidget->addAction(actionLongListJob);
    mp_tableWidget->addAction(actionListJobid);
    mp_tableWidget->addAction(actionListFilesOnJob);
    mp_tableWidget->addAction(actionListJobMedia);
@@ -401,8 +399,6 @@ void JobList::createConnections()
    mp_tableWidget->addAction(actionShowLogForJob);
 
    /* Make Connections */
-   connect(actionLongListJob, SIGNAL(triggered()), this,
-                SLOT(consoleLongListJob()));
    connect(actionListJobid, SIGNAL(triggered()), this,
                 SLOT(consoleListJobid()));
    connect(actionListFilesOnJob, SIGNAL(triggered()), this,
@@ -423,40 +419,50 @@ void JobList::createConnections()
                 SLOT(showLogForJob()));
    connect(actionCancelJob, SIGNAL(triggered()), this,
                 SLOT(consoleCancelJob()));
+   connect(actionListJobTotals, SIGNAL(triggered()), this,
+                SLOT(consoleListJobTotals()));
+
+   m_contextActions.append(actionRefreshJobList);
+   m_contextActions.append(actionListJobTotals);
 }
 
 /*
  * Functions to respond to local context sensitive menu sending console commands
  * If I could figure out how to make these one function passing a string, Yaaaaaa
  */
-void JobList::consoleLongListJob()
-{
-   QString cmd("llist jobid=");
-   cmd += m_currentJob;
-   consoleCommand(cmd);
-}
 void JobList::consoleListJobid()
 {
    QString cmd("list jobid=");
    cmd += m_currentJob;
+   if (mainWin->m_longList) { cmd.prepend("l"); }
    consoleCommand(cmd);
 }
 void JobList::consoleListFilesOnJob()
 {
    QString cmd("list files jobid=");
    cmd += m_currentJob;
+   if (mainWin->m_longList) { cmd.prepend("l"); }
    consoleCommand(cmd);
 }
 void JobList::consoleListJobMedia()
 {
    QString cmd("list jobmedia jobid=");
    cmd += m_currentJob;
+   if (mainWin->m_longList) { cmd.prepend("l"); }
    consoleCommand(cmd);
 }
 void JobList::consoleListVolumes()
 {
    QString cmd("list volumes jobid=");
    cmd += m_currentJob;
+   if (mainWin->m_longList) { cmd.prepend("l"); }
+   consoleCommand(cmd);
+}
+void JobList::consoleListJobTotals()
+{
+   QString cmd("list jobtotals");
+   cmd += m_currentJob;
+   if (mainWin->m_longList) { cmd.prepend("l"); }
    consoleCommand(cmd);
 }
 void JobList::consoleDeleteJob()
index 4a37a4be69c404305b1de4458ddbfac9ba34e8ea..ed1e7bc7c8758d6ae0f4cdd82dba28a289b7e224 100644 (file)
@@ -54,11 +54,11 @@ public slots:
    void tableItemChanged(QTableWidgetItem *, QTableWidgetItem *);
 
 private slots:
-   void consoleLongListJob();
    void consoleListJobid();
    void consoleListFilesOnJob();
    void consoleListJobMedia();
    void consoleListVolumes();
+   void consoleListJobTotals();
    void consoleDeleteJob();
    void consolePurgeFiles();
    void preRestoreFromJob();
index 9dd5637e31f382e65be90eb3d71d76ba89d814ac..ef8e02eab07cff0956f443c6a1cbdcee2b579891 100644 (file)
     <string>ListVolumes</string>
    </property>
   </action>
-  <action name="actionLongListJob" >
-   <property name="icon" >
-    <iconset>:images/unmark.png</iconset>
-   </property>
-   <property name="text" >
-    <string>LongListJob</string>
-   </property>
-  </action>
   <action name="actionDeleteJob" >
    <property name="icon" >
     <iconset>:images/unmark.png</iconset>
     <string>Cancel Currently Running Job</string>
    </property>
   </action>
+  <action name="actionListJobTotals" >
+   <property name="icon" >
+    <iconset>:images/unmark.png</iconset>
+   </property>
+   <property name="text" >
+    <string>List Job Totals in Console</string>
+   </property>
+  </action>
  </widget>
  <resources/>
  <connections/>
index 4ba65496d0041433957052e5471effa5956c0abd..9380768d8399183bd211ee188e6704441a567f1f 100644 (file)
@@ -478,8 +478,7 @@ void MainWin::input_line()
    QString cmdStr = lineEdit->text();    /* Get the text */
    lineEdit->clear();                    /* clear the lineEdit box */
    if (m_currentConsole->is_connected()) {
-      m_currentConsole->display_text(cmdStr + "\n");
-      m_currentConsole->write_dir(cmdStr.toUtf8().data());         /* send to dir */
+      m_currentConsole->consoleCommand(cmdStr);
    } else {
       set_status("Director not connected. Click on connect button.");
    }
@@ -647,6 +646,8 @@ void MainWin::setPreferences()
    prefs.daysSpinBox->setValue(m_daysLimitVal);
    prefs.checkMessages->setCheckState(m_checkMessages ? Qt::Checked : Qt::Unchecked);
    prefs.checkMessagesSpin->setValue(m_checkMessagesInterval);
+   prefs.executeLongCheckBox->setCheckState(m_longList ? Qt::Checked : Qt::Unchecked);
+
    prefs.exec();
 }
 
@@ -670,6 +671,7 @@ void prefsDialog::accept()
    mainWin->m_daysLimitVal = this->daysSpinBox->value();
    mainWin->m_checkMessages = this->checkMessages->checkState() == Qt::Checked;
    mainWin->m_checkMessagesInterval = this->checkMessagesSpin->value();
+   mainWin->m_longList = this->executeLongCheckBox->checkState() == Qt::Checked;
    QSettings settings("www.bacula.org", "bat");
    settings.beginGroup("Debug");
    settings.setValue("commDebug", mainWin->m_commDebug);
@@ -688,6 +690,9 @@ void prefsDialog::accept()
    settings.setValue("checkMessages", mainWin->m_checkMessages);
    settings.setValue("checkMessagesInterval", mainWin->m_checkMessagesInterval);
    settings.endGroup();
+   settings.beginGroup("Misc");
+   settings.setValue("longList", mainWin->m_longList);
+   settings.endGroup();
    foreach(Console *console, mainWin->m_consoleHash) {
       console->startTimer();
    }
@@ -720,4 +725,7 @@ void MainWin::readPreferences()
    m_checkMessages = settings.value("checkMessages", false).toBool();
    m_checkMessagesInterval = settings.value("checkMessagesInterval", 28).toInt();
    settings.endGroup();
+   settings.beginGroup("Misc");
+   m_longList = settings.value("longList", false).toBool();
+   settings.endGroup();
 }
index a134210c5f11d6254cbcf9b3cb3618561ee1e0a6..c5f59cc17f696594dced71c916913c728f6bd880 100644 (file)
@@ -82,6 +82,7 @@ public:
    int m_daysLimitVal;
    bool m_checkMessages;
    int m_checkMessagesInterval;
+   bool m_longList;
 
 public slots:
    void input_line();
index c7e7d1a1f19d917b3b9770cd83ef69287bb7c21f..108724fcecf2bc6b633d51c1c97bf8e450b6410b 100644 (file)
@@ -69,6 +69,7 @@ public:
    void setCurrent();
    void setContextMenuDockText();
    void setTreeWidgetItemDockColor();
+   void consoleCommand(QString &);
 
 public slots:
    /* closeEvent is a virtual function inherited from QWidget */
@@ -77,7 +78,6 @@ public slots:
 protected:
    void pgInitialize();
    void pgInitialize(QTreeWidgetItem *);
-   void consoleCommand(QString &);
    virtual void treeWidgetName(QString &);
    virtual void changeEvent(QEvent *event);
    void setConsoleCurrent();
index 8d675c353df5c592f2e859e2f15b692b3ff33f0a..b14febd5e8decf6b558f8fea2922fc4e25351b65 100644 (file)
          </widget>
         </item>
         <item row="1" column="0" >
-         <widget class="QSpinBox" name="checkMessagesSpin" />
+         <widget class="QSpinBox" name="checkMessagesSpin" >
+          <property name="maximum" >
+           <number>3600</number>
+          </property>
+         </widget>
         </item>
        </layout>
       </widget>
        </layout>
       </widget>
      </widget>
+     <widget class="QWidget" name="tab_4" >
+      <attribute name="title" >
+       <string>Misc</string>
+      </attribute>
+      <widget class="QGroupBox" name="groupBox_4" >
+       <property name="geometry" >
+        <rect>
+         <x>30</x>
+         <y>50</y>
+         <width>201</width>
+         <height>81</height>
+        </rect>
+       </property>
+       <property name="title" >
+        <string>Context Sensitive List Commands</string>
+       </property>
+       <widget class="QCheckBox" name="executeLongCheckBox" >
+        <property name="geometry" >
+         <rect>
+          <x>10</x>
+          <y>20</y>
+          <width>161</width>
+          <height>19</height>
+         </rect>
+        </property>
+        <property name="text" >
+         <string>Execute Long List</string>
+        </property>
+       </widget>
+      </widget>
+     </widget>
      <widget class="QWidget" name="tab_3" >
       <attribute name="title" >
        <string>Debug</string>