]> git.sur5r.net Git - bacula/bacula/commitdiff
Joblist: change page select widget name to "JobList"
authorDirk H Bartley <dbartley@schupan.com>
Wed, 30 May 2007 14:49:52 +0000 (14:49 +0000)
committerDirk H Bartley <dbartley@schupan.com>
Wed, 30 May 2007 14:49:52 +0000 (14:49 +0000)
MediaEdit added months spin.  Not sure I like it because 365=yr but 30 days is
not always equal to a month.
JobLog: add Icon for page selector.
mainwin and others.  Move dockPage() into the class' constructors so that the
createPage functions in main win are not of benefit.
Jobs: a new page for displaying jobs and job defaults.

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

16 files changed:
bacula/src/qt-console/TODO
bacula/src/qt-console/bat.pro.in
bacula/src/qt-console/clients/clients.cpp
bacula/src/qt-console/fileset/fileset.cpp
bacula/src/qt-console/joblist/joblist.cpp
bacula/src/qt-console/joblog/joblog.cpp
bacula/src/qt-console/jobs/jobs.cpp [new file with mode: 0644]
bacula/src/qt-console/jobs/jobs.h [new file with mode: 0644]
bacula/src/qt-console/jobs/jobs.ui [new file with mode: 0644]
bacula/src/qt-console/mainwin.cpp
bacula/src/qt-console/mainwin.h
bacula/src/qt-console/mediaedit/mediaedit.cpp
bacula/src/qt-console/mediaedit/mediaedit.ui
bacula/src/qt-console/medialist/medialist.cpp
bacula/src/qt-console/restore/brestore.cpp
bacula/src/qt-console/storage/storage.cpp

index 71c4f8fcc4b7603fe2b3dd58c2f6ac4e4f914bec..16d57c796e1e21c85b3f30bdb1e438b8fe52058a 100644 (file)
@@ -1,14 +1,8 @@
 dhb
 ====================================================
 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.
-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.
@@ -53,9 +47,6 @@ loop creating pages.
 ========================================================
 This release or next:
 
-A window showing a list of jobs and defaults.  Defaults can be gotten in manner
-similar to what the first restore window does.
-
 A window showing a list of schedule resources. 
 
 A list of message resources??
@@ -97,9 +88,19 @@ global one defined in the mainWin class (if I remember right).
    I'm working on this (kes).  It is not so simple, but moving forward
    gradually ...
 
+Create edit pool interface.
+   This is done from config file
+
 ============================================================
 DONE:
 ============================================================
+A window showing a list of jobs and defaults.  Defaults can be gotten in manner
+similar to what the first restore window does.
+
+status dir on page select director item
+All items with jobid= that I thought could work from joblist are done.
+As well as many more
+update slots scan
 Preferences for the messages timer.
 
 Get the 5 second bring to bottom of console to stop
index 7dc375575a23376c28bda36027f1985be02d856a..5135732811351c83664ee585f3a214c9c42f0661 100644 (file)
@@ -39,7 +39,7 @@ FORMS += run/run.ui run/runcmd.ui run/estimate.ui run/prune.ui
 FORMS += select/select.ui
 FORMS += medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui
 FORMS += clients/clients.ui storage/storage.ui fileset/fileset.ui
-FORMS += joblog/joblog.ui
+FORMS += joblog/joblog.ui jobs/jobs.ui
 FORMS += help/help.ui
 
 HEADERS += mainwin.h bat.h bat_conf.h qstd.h
@@ -105,6 +105,10 @@ SOURCES += fileset/fileset.cpp
 HEADERS += joblog/joblog.h
 SOURCES += joblog/joblog.cpp
 
+## Jobs
+HEADERS += jobs/jobs.h
+SOURCES += jobs/jobs.cpp
+
 # Help dialog
 HEADERS += help/help.h
 SOURCES += help/help.cpp
index 657f5261cd49ae474e6dd8537878e60320f2ed56..b6d021d7123b8a8f356c4f496ed4f0aef760d196 100644 (file)
@@ -56,6 +56,8 @@ Clients::Clients()
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshClients);
+   createContextMenu();
+   dockPage();
 }
 
 Clients::~Clients()
@@ -143,7 +145,6 @@ void Clients::PgSeltreeWidgetClicked()
 {
    if(!m_populated) {
       populateTree();
-      createContextMenu();
       m_populated=true;
    }
 }
@@ -235,7 +236,6 @@ void Clients::currentStackItem()
    if(!m_populated) {
       populateTree();
       /* Create the context menu for the client tree */
-      createContextMenu();
       m_populated=true;
    }
 }
index 55d6b216b15d05070a224b2f2973d8b8f1075591..9676de3c2f98859fca0d88e94cecc675f34b009e 100644 (file)
@@ -56,6 +56,7 @@ FileSet::FileSet()
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshFileSet);
+   dockPage();
 }
 
 FileSet::~FileSet()
index b539c873caa2d654f658b5dd94b90ff15c487be4..eb0a83f3c241a428e880492ee58947dce346a163 100644 (file)
@@ -45,7 +45,7 @@ JobList::JobList(QString &mediaName, QString &clientname,
          QTreeWidgetItem *parentTreeWidgetItem)
 {
    setupUi(this);
-   m_name = "Clients";
+   m_name = ""; /* treeWidgetName has a virtual override in this class */
    m_mediaName = mediaName;
    m_clientName = clientname;
    pgInitialize(parentTreeWidgetItem);
@@ -64,6 +64,7 @@ JobList::JobList(QString &mediaName, QString &clientname,
    limitSpinBox->setValue(mainWin->m_recordLimitVal);
    daysCheckBox->setCheckState(mainWin->m_daysLimitCheck ? Qt::Checked : Qt::Unchecked);
    daysSpinBox->setValue(mainWin->m_daysLimitVal);
+   dockPage();
 }
 
 /*
@@ -315,11 +316,11 @@ void JobList::currentStackItem()
 void JobList::treeWidgetName(QString &desc)
 {
    if ((m_mediaName == "") && (m_clientName == "")) {
-      desc = "Jobs";
+      desc = "JobList";
    } else {
-      desc = "Jobs ";
+      desc = "JobList ";
       if (m_mediaName != "" ) {
-         desc += "on Volume " + m_mediaName;
+         desc += "of Volume " + m_mediaName;
       }
       if (m_clientName != "" ) {
          desc += "of Client " + m_clientName;
index f9b6539f306d70b5e760c419e02bc33284bbfbd9..a3dd9e4ab0319b30ff67cedeecb4705fe63eac14 100644 (file)
@@ -44,6 +44,8 @@ JobLog::JobLog(QString &jobId, QTreeWidgetItem *parentTreeWidgetItem)
    m_name = "JobLog";
    m_closeable = true;
    pgInitialize(parentTreeWidgetItem);
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/emblem-system.svg")));
    m_cursor = new QTextCursor(textEdit->document());
 
    m_jobId = jobId;
diff --git a/bacula/src/qt-console/jobs/jobs.cpp b/bacula/src/qt-console/jobs/jobs.cpp
new file mode 100644 (file)
index 0000000..2174a7d
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+/*
+ *   Version $Id: client.cpp 4230 2007-02-21 20:07:37Z kerns $
+ *
+ *  Jobs Class
+ *
+ *   Dirk Bartley, March 2007
+ *
+ */ 
+
+//#include <QAbstractEventDispatcher>
+//#include <QMenu>
+#include "bat.h"
+#include "jobs/jobs.h"
+
+Jobs::Jobs()
+{
+   setupUi(this);
+   m_name = "Jobs";
+   pgInitialize();
+   QTreeWidgetItem* thisitem = mainWin->getFromHash(this);
+   thisitem->setIcon(0,QIcon(QString::fromUtf8(":images/emblem-system.svg")));
+
+   /* mp_treeWidget, Storage Tree Tree Widget inherited from ui_client.h */
+   m_populated = false;
+   m_checkcurwidget = true;
+   m_closeable = false;
+   /* add context sensitive menu items specific to this classto the page
+    * selector tree. m_contextActions is QList of QActions */
+   m_contextActions.append(actionRefreshJobs);
+   createContextMenu();
+   dockPage();
+}
+
+Jobs::~Jobs()
+{
+}
+
+/*
+ * The main meat of the class!!  The function that querries the director and 
+ * creates the widgets with appropriate values.
+ */
+void Jobs::populateTree()
+{
+   QTreeWidgetItem *jobsItem, *topItem;
+
+   if (!m_console->preventInUseConnect())
+      return;
+   m_checkcurwidget = false;
+   mp_treeWidget->clear();
+   m_checkcurwidget = true;
+   QStringList headerlist = (QStringList() << "Job Name" << "Pool" << "Messages"
+      << "Client" << "Storage" << "Where" << "Level" << "Type" << "FileSet" 
+      << "Catalog" << "Enabled");
+
+   topItem = new QTreeWidgetItem(mp_treeWidget);
+   topItem->setText(0, "Jobs");
+   topItem->setData(0, Qt::UserRole, 0);
+   topItem->setExpanded(true);
+
+   mp_treeWidget->setColumnCount(headerlist.count());
+   mp_treeWidget->setHeaderLabels(headerlist);
+
+   foreach (QString jobName, m_console->job_list){
+      jobsItem = new QTreeWidgetItem(topItem);
+      jobsItem->setText(0, jobName);
+      //jobsItem->setExpanded(true);
+
+      for (int i=0; i<headerlist.count(); i++)
+         jobsItem->setData(i, Qt::UserRole, 1);
+/*struct job_defaults {
+   QString job_name;
+   QString pool_name;
+   QString messages_name;
+   QString client_name;
+   QString store_name;
+   QString where;
+   QString level;
+   QString type;
+   QString fileset_name;
+   QString catalog_name;
+   bool enabled;
+};*/
+      job_defaults job_defs;
+      job_defs.job_name = jobName;
+      if (m_console->get_job_defaults(job_defs)) {
+         int col = 1;
+         jobsItem->setText(col++, job_defs.pool_name);
+         jobsItem->setText(col++, job_defs.messages_name);
+         jobsItem->setText(col++, job_defs.client_name);
+         jobsItem->setText(col++, job_defs.store_name);
+         jobsItem->setText(col++, job_defs.where);
+         jobsItem->setText(col++, job_defs.level);
+         jobsItem->setText(col++, job_defs.type);
+         jobsItem->setText(col++, job_defs.fileset_name);
+         jobsItem->setText(col++, job_defs.catalog_name);
+         if (job_defs.enabled) {
+            jobsItem->setText(col++, "Yes");
+         } else {
+            jobsItem->setText(col++, "No");
+         }
+      }
+
+   }
+   /* Resize the columns */
+   for(int cnter=0; cnter<headerlist.size(); cnter++) {
+      mp_treeWidget->resizeColumnToContents(cnter);
+   }
+}
+
+/*
+ * When the treeWidgetItem in the page selector tree is singleclicked, Make sure
+ * The tree has been populated.
+ */
+void Jobs::PgSeltreeWidgetClicked()
+{
+   if(!m_populated) {
+      populateTree();
+      m_populated=true;
+   }
+}
+
+/*
+ * Added to set the context menu policy based on currently active treeWidgetItem
+ * signaled by currentItemChanged
+ */
+void Jobs::treeItemChanged(QTreeWidgetItem *currentwidgetitem, QTreeWidgetItem *previouswidgetitem )
+{
+   /* m_checkcurwidget checks to see if this is during a refresh, which will segfault */
+   if (m_checkcurwidget) {
+      /* The Previous item */
+      if (previouswidgetitem) { /* avoid a segfault if first time */
+         int treedepth = previouswidgetitem->data(0, Qt::UserRole).toInt();
+         if (treedepth == 1){
+            //mp_treeWidget->removeAction(actionListJobsofClient);
+         }
+      }
+
+      int treedepth = currentwidgetitem->data(0, Qt::UserRole).toInt();
+      if (treedepth == 1){
+         /* set a hold variable to the client name in case the context sensitive
+          * menu is used */
+         m_currentlyselected=currentwidgetitem->text(0);
+         //mp_treeWidget->addAction(actionListJobsofClient);
+      }
+   }
+}
+
+/* 
+ * Setup a context menu 
+ * Made separate from populate so that it would not create context menu over and
+ * over as the tree is repopulated.
+ */
+void Jobs::createContextMenu()
+{
+   mp_treeWidget->setContextMenuPolicy(Qt::ActionsContextMenu);
+   mp_treeWidget->addAction(actionRefreshJobs);
+   connect(mp_treeWidget, SIGNAL(
+           currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
+           this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
+   /* connect to the action specific to this pages class */
+   connect(actionRefreshJobs, SIGNAL(triggered()), this,
+                SLOT(populateTree()));
+}
+
+/*
+ * Virtual function which is called when this page is visible on the stack
+ */
+void Jobs::currentStackItem()
+{
+   if(!m_populated) {
+      populateTree();
+      /* Create the context menu for the client tree */
+      m_populated=true;
+   }
+}
diff --git a/bacula/src/qt-console/jobs/jobs.h b/bacula/src/qt-console/jobs/jobs.h
new file mode 100644 (file)
index 0000000..94a657f
--- /dev/null
@@ -0,0 +1,64 @@
+#ifndef _JOBS_H_
+#define _JOBS_H_
+/*
+   Bacula® - The Network Backup Solution
+
+   Copyright (C) 2000-2007 Free Software Foundation Europe e.V.
+
+   The main author of Bacula is Kern Sibbald, with contributions from
+   many others, a complete list can be found in the file AUTHORS.
+   This program is Free Software; you can redistribute it and/or
+   modify it under the terms of version two of the GNU General Public
+   License as published by the Free Software Foundation plus additions
+   that are listed in the file LICENSE.
+
+   This program is distributed in the hope that it will be useful, but
+   WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+   General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301, USA.
+
+   Bacula® is a registered trademark of John Walker.
+   The licensor of Bacula is the Free Software Foundation Europe
+   (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
+   Switzerland, email:ftf@fsfeurope.org.
+*/
+/*
+ *   Version $Id: jobs.h 4923 2007-05-28 11:51:53Z bartleyd2 $
+ *
+ *   Dirk Bartley, March 2007
+ */
+
+#include <QtGui>
+#include "ui_jobs.h"
+#include "console.h"
+#include "pages.h"
+
+class Jobs : public Pages, public Ui::jobsForm
+{
+   Q_OBJECT 
+
+public:
+   Jobs();
+   ~Jobs();
+   virtual void PgSeltreeWidgetClicked();
+   virtual void currentStackItem();
+
+public slots:
+   void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
+
+private slots:
+   void populateTree();
+
+private:
+   void createContextMenu();
+   QString m_currentlyselected;
+   bool m_populated;
+   bool m_checkcurwidget;
+};
+
+#endif /* _JOBS_H_ */
diff --git a/bacula/src/qt-console/jobs/jobs.ui b/bacula/src/qt-console/jobs/jobs.ui
new file mode 100644 (file)
index 0000000..de7876d
--- /dev/null
@@ -0,0 +1,42 @@
+<ui version="4.0" >
+ <class>jobsForm</class>
+ <widget class="QWidget" name="jobsForm" >
+  <property name="geometry" >
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>413</width>
+    <height>258</height>
+   </rect>
+  </property>
+  <property name="windowTitle" >
+   <string>Client Tree</string>
+  </property>
+  <layout class="QGridLayout" >
+   <property name="margin" >
+    <number>9</number>
+   </property>
+   <property name="spacing" >
+    <number>6</number>
+   </property>
+   <item row="0" column="0" >
+    <widget class="QTreeWidget" name="mp_treeWidget" />
+   </item>
+  </layout>
+  <action name="actionRefreshJobs" >
+   <property name="icon" >
+    <iconset resource="../main.qrc" >:/images/view-refresh.svg</iconset>
+   </property>
+   <property name="text" >
+    <string>Refresh Jobs List</string>
+   </property>
+   <property name="statusTip" >
+    <string>Requery the director for the list of clients.</string>
+   </property>
+  </action>
+ </widget>
+ <resources>
+  <include location="../main.qrc" />
+ </resources>
+ <connections/>
+</ui>
index 3f5ad3979ddec98381f84b2901647ebd25a73363..12a943221a0735b5d2ab8a81eb81d7a5fc712689 100644 (file)
@@ -47,6 +47,7 @@
 #include "joblist/joblist.h"
 #include "clients/clients.h"
 #include "help/help.h"
+#include "jobs/jobs.h"
 
 /* 
  * Daemon message callback
@@ -132,13 +133,14 @@ void MainWin::createPages()
        * Create instances in alphabetic order of the rest 
        *  of the classes that will by default exist under each Director.  
        */
-//    createPagebRestore();
-      createPageClients();
-      createPageFileSet();
+//    new new bRestore();
+      new Clients();
+      new FileSet();
+      new Jobs();
       QString emptymedia(""), emptyclient("");
       createPageJobList(emptymedia, emptyclient, NULL);
-      createPageMediaList();
-      createPageStorage();
+      new MediaList();
+      new Storage();
 
       treeWidget->expandItem(topItem);
       stackedWidget->setCurrentWidget(m_currentConsole);
@@ -146,24 +148,6 @@ void MainWin::createPages()
    UnlockRes();
 }
 
-/*
- * create an instance of the the brestore class on the stack
- */
-void MainWin::createPagebRestore()
-{
-   bRestore* brestore = new bRestore();
-   brestore->dockPage();
-}
-
-/*
- * create an instance of the the medialist class on the stack
- */
-void MainWin::createPageMediaList()
-{
-   MediaList* medialist = new MediaList();
-   medialist->dockPage();
-}
-
 /*
  * create an instance of the the joblist class on the stack
  */
@@ -175,7 +159,6 @@ void MainWin::createPageJobList(QString &media, QString &client,
    /* save current tree widget item in case query produces no results */
    holdItem = treeWidget->currentItem();
    JobList* joblist = new JobList(media, client, parentTreeWidgetItem);
-   joblist->dockPage();
    /* If this is a query of jobs on a specific media */
    if ((media != "") || (client != "")) {
       joblist->setCurrent();
@@ -187,33 +170,6 @@ void MainWin::createPageJobList(QString &media, QString &client,
    }
 }
 
-/*
- * create an instance of the the Clients class on the stack
- */
-void MainWin::createPageClients()
-{
-   Clients* clients = new Clients();
-   clients->dockPage();
-}
-
-/*
- * create an instance of the the storage class on the stack
- */
-void MainWin::createPageStorage()
-{
-   Storage* storage = new Storage();
-   storage->dockPage();
-}
-
-/*
- * create an instance of the the fileset class on the stack
- */
-void MainWin::createPageFileSet()
-{
-   FileSet* fileset = new FileSet();
-   fileset->dockPage();
-}
-
 /* Create a root Tree Widget */
 QTreeWidgetItem *MainWin::createTopPage(char *name)
 {
index c5f59cc17f696594dced71c916913c728f6bd880..b79ff405d727a56bfc6ae76e98f528a9c30d45d9 100644 (file)
@@ -110,11 +110,6 @@ private:
    void createPages();
    QTreeWidgetItem *createTopPage(char *name);
    QTreeWidgetItem *createPage(char *name, QTreeWidgetItem *parent);
-   void createPagebRestore();
-   void createPageMediaList();
-   void createPageClients();
-   void createPageStorage();
-   void createPageFileSet();
 
 private:
    Console *m_currentConsole;
index c817585ba05be24af5c83dd05086fa577efd6d23..fa6429a02d29a4f6b795c4727560cdbeae6bf52a 100644 (file)
@@ -299,10 +299,12 @@ void MediaEdit::useDurationChanged()
  */
 void MediaEdit::setSpins(int value)
 {
-   int years, days, hours, minutes, seconds, left;
+   int years, months, days, hours, minutes, seconds, left;
         
    years = abs(value / 31536000);
    left = value - years * 31536000;
+   months = abs(left / 2592000);
+   left = left - months * 2592000;
    days = abs(left / 86400);
    left = left - days * 86400;
    hours = abs(left / 3600);
@@ -311,6 +313,7 @@ void MediaEdit::setSpins(int value)
    seconds = left - minutes * 60;
    disconnectSpins();
    yearsSpin->setValue(years);
+   monthsSpin->setValue(months);
    daysSpin->setValue(days);
    hoursSpin->setValue(hours);
    minutesSpin->setValue(minutes);
@@ -337,7 +340,11 @@ void MediaEdit::durationChanged()
       daysSpin->setValue(daysSpin->value()-1);
    }
    if (daysSpin->value() == -1) {
-      daysSpin->setValue(364);
+      daysSpin->setValue(29);
+      monthsSpin->setValue(monthsSpin->value()-1);
+   }
+   if (monthsSpin->value() == -1) {
+      monthsSpin->setValue(11);
       yearsSpin->setValue(yearsSpin->value()-1);
    }
    if (yearsSpin->value() == -1) {
@@ -356,8 +363,12 @@ void MediaEdit::durationChanged()
       hoursSpin->setValue(0);
       daysSpin->setValue(daysSpin->value()+1);
    }
-   if (daysSpin->value() == 365) {
+   if (daysSpin->value() == 30) {
       daysSpin->setValue(0);
+      monthsSpin->setValue(monthsSpin->value()+1);
+   }
+   if (monthsSpin->value() == 12) {
+      monthsSpin->setValue(0);
       yearsSpin->setValue(yearsSpin->value()+1);
    }
    connectSpins();
@@ -365,6 +376,7 @@ void MediaEdit::durationChanged()
       int retention;
       retention = secondsSpin->value() + minutesSpin->value() * 60 + 
          hoursSpin->value() * 3600 + daysSpin->value() * 86400 +
+         monthsSpin->value() * 2592000 +
          yearsSpin->value() * 31536000;
       disconnect(retentionSpin, SIGNAL(valueChanged(int)), this, SLOT(retentionChanged()));
       retentionSpin->setValue(retention);
@@ -374,6 +386,7 @@ void MediaEdit::durationChanged()
       int useDuration;
       useDuration = secondsSpin->value() + minutesSpin->value() * 60 + 
          hoursSpin->value() * 3600 + daysSpin->value() * 86400 +
+         monthsSpin->value() * 2592000 +
          yearsSpin->value() * 31536000;
       disconnect(useDurationSpin, SIGNAL(valueChanged(int)), this, SLOT(useDurationChanged()));
       useDurationSpin->setValue(useDuration);
@@ -388,6 +401,7 @@ void MediaEdit::connectSpins()
    connect(minutesSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    connect(hoursSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    connect(daysSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   connect(monthsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    connect(yearsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
 }
 
@@ -398,6 +412,7 @@ void MediaEdit::disconnectSpins()
    disconnect(minutesSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    disconnect(hoursSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    disconnect(daysSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
+   disconnect(monthsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
    disconnect(yearsSpin, SIGNAL(valueChanged(int)), this, SLOT(durationChanged()));
 }
 
index 269ae9ee283a73dbb2ced747b48f1c73ca25b6e7..90277f39ef5d53e4b327e1d44ca2e8826e14a5a3 100644 (file)
@@ -5,8 +5,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>468</width>
-    <height>451</height>
+    <width>487</width>
+    <height>470</height>
    </rect>
   </property>
   <property name="windowTitle" >
    <property name="spacing" >
     <number>6</number>
    </property>
-   <item row="1" column="2" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-   <item row="1" column="0" >
-    <spacer>
-     <property name="orientation" >
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="sizeHint" >
-      <size>
-       <width>40</width>
-       <height>20</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
    <item row="1" column="1" >
     <layout class="QGridLayout" >
      <property name="margin" >
      <property name="spacing" >
       <number>6</number>
      </property>
-     <item row="8" column="1" >
-      <widget class="QSpinBox" name="maxBytesSpin" >
-       <property name="maximum" >
-        <number>2147483647</number>
+     <item row="2" column="0" >
+      <widget class="QLabel" name="label_3" >
+       <property name="text" >
+        <string>Pool:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>poolCombo</cstring>
        </property>
       </widget>
      </item>
-     <item row="1" column="0" colspan="2" >
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
-       </property>
-       <property name="spacing" >
-        <number>6</number>
+     <item row="3" column="0" >
+      <widget class="QLabel" name="label_5" >
+       <property name="text" >
+        <string>Volume Status:</string>
        </property>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="volumeLabel" >
-         <property name="maximumSize" >
-          <size>
-           <width>16777215</width>
-           <height>48</height>
-          </size>
-         </property>
-         <property name="text" >
-          <string>Volume : </string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>40</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
+      </widget>
      </item>
-     <item row="4" column="1" >
-      <widget class="QSpinBox" name="slotSpin" >
-       <property name="maximum" >
-        <number>10000</number>
+     <item row="8" column="0" >
+      <widget class="QLabel" name="label_13" >
+       <property name="text" >
+        <string>Max Volume Bytes:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
      <item row="3" column="1" >
       <widget class="QComboBox" name="statusCombo" />
      </item>
-     <item row="9" column="0" >
-      <widget class="QLabel" name="label_14" >
+     <item row="10" column="1" >
+      <widget class="QComboBox" name="recyclePoolCombo" />
+     </item>
+     <item row="4" column="0" >
+      <widget class="QLabel" name="label_4" >
        <property name="text" >
-        <string>Max Volume Files:</string>
+        <string>Slot:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="7" column="0" >
+      <widget class="QLabel" name="label_12" >
+       <property name="text" >
+        <string>Max Volume Jobs:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
+       </property>
+      </widget>
+     </item>
+     <item row="6" column="0" >
+      <widget class="QLabel" name="label_7" >
+       <property name="text" >
+        <string>Use Duration:</string>
        </property>
        <property name="buddy" >
         <cstring>slotSpin</cstring>
        </item>
       </layout>
      </item>
-     <item row="0" column="0" colspan="2" >
-      <layout class="QHBoxLayout" >
-       <property name="margin" >
-        <number>0</number>
+     <item row="8" column="1" >
+      <widget class="QSpinBox" name="maxBytesSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
        </property>
-       <property name="spacing" >
-        <number>6</number>
+      </widget>
+     </item>
+     <item row="5" column="0" >
+      <widget class="QLabel" name="label_6" >
+       <property name="text" >
+        <string>Retension:</string>
        </property>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>71</width>
-           <height>21</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-       <item>
-        <widget class="QLabel" name="label" >
-         <property name="maximumSize" >
-          <size>
-           <width>16777215</width>
-           <height>30</height>
-          </size>
-         </property>
-         <property name="text" >
-          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
-p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt; font-weight:600;">Edit a Volume&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Horizontal</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>81</width>
-           <height>20</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
+       </property>
+      </widget>
      </item>
-     <item row="3" column="0" >
-      <widget class="QLabel" name="label_5" >
+     <item row="10" column="0" >
+      <widget class="QLabel" name="label_15" >
        <property name="text" >
-        <string>Volume Status:</string>
+        <string>Recycle Pool:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
        </property>
       </widget>
      </item>
@@ -258,6 +187,23 @@ p, li { white-space: pre-wrap; }
        </item>
       </layout>
      </item>
+     <item row="9" column="1" >
+      <widget class="QSpinBox" name="maxFilesSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
+       </property>
+      </widget>
+     </item>
+     <item row="9" column="0" >
+      <widget class="QLabel" name="label_14" >
+       <property name="text" >
+        <string>Max Volume Files:</string>
+       </property>
+       <property name="buddy" >
+        <cstring>slotSpin</cstring>
+       </property>
+      </widget>
+     </item>
      <item rowspan="13" row="0" column="2" >
       <layout class="QGridLayout" >
        <property name="margin" >
@@ -266,44 +212,50 @@ p, li { white-space: pre-wrap; }
        <property name="spacing" >
         <number>6</number>
        </property>
-       <item row="6" column="0" >
-        <widget class="QLabel" name="label_10" >
-         <property name="text" >
-          <string>Minutes</string>
+       <item row="9" column="0" colspan="2" >
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Vertical</enum>
          </property>
-        </widget>
+         <property name="sizeHint" >
+          <size>
+           <width>97</width>
+           <height>21</height>
+          </size>
+         </property>
+        </spacer>
        </item>
-       <item row="5" column="1" >
-        <widget class="QSpinBox" name="hoursSpin" >
+       <item row="3" column="1" >
+        <widget class="QSpinBox" name="yearsSpin" >
          <property name="maximum" >
-          <number>24</number>
+          <number>999</number>
          </property>
          <property name="minimum" >
           <number>-1</number>
          </property>
-         <property name="value" >
-          <number>0</number>
-         </property>
         </widget>
        </item>
-       <item row="7" column="0" >
-        <widget class="QLabel" name="label_11" >
+       <item row="3" column="0" >
+        <widget class="QLabel" name="label_2" >
          <property name="text" >
-          <string>Seconds</string>
+          <string>Years</string>
          </property>
         </widget>
        </item>
-       <item row="1" column="0" colspan="2" >
-        <widget class="QRadioButton" name="retentionRadio" >
+       <item row="8" column="0" >
+        <widget class="QLabel" name="label_11" >
          <property name="text" >
-          <string>Retention</string>
+          <string>Seconds</string>
          </property>
         </widget>
        </item>
-       <item row="4" column="0" >
-        <widget class="QLabel" name="label_8" >
-         <property name="text" >
-          <string>Days</string>
+       <item row="5" column="1" >
+        <widget class="QSpinBox" name="daysSpin" >
+         <property name="maximum" >
+          <number>30</number>
+         </property>
+         <property name="minimum" >
+          <number>-1</number>
          </property>
         </widget>
        </item>
@@ -314,7 +266,7 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="8" column="0" colspan="2" >
+       <item row="0" column="0" colspan="2" >
         <spacer>
          <property name="orientation" >
           <enum>Qt::Vertical</enum>
@@ -322,30 +274,44 @@ p, li { white-space: pre-wrap; }
          <property name="sizeHint" >
           <size>
            <width>97</width>
-           <height>81</height>
+           <height>31</height>
           </size>
          </property>
         </spacer>
        </item>
-       <item row="3" column="0" >
-        <widget class="QLabel" name="label_2" >
+       <item row="5" column="0" >
+        <widget class="QLabel" name="label_8" >
          <property name="text" >
-          <string>Years</string>
+          <string>Days</string>
          </property>
         </widget>
        </item>
-       <item row="4" column="1" >
-        <widget class="QSpinBox" name="daysSpin" >
+       <item row="8" column="1" >
+        <widget class="QSpinBox" name="secondsSpin" >
          <property name="maximum" >
-          <number>365</number>
+          <number>60</number>
          </property>
          <property name="minimum" >
           <number>-1</number>
          </property>
         </widget>
        </item>
+       <item row="6" column="0" >
+        <widget class="QLabel" name="label_9" >
+         <property name="text" >
+          <string>Hours</string>
+         </property>
+        </widget>
+       </item>
+       <item row="4" column="0" >
+        <widget class="QLabel" name="label_16" >
+         <property name="text" >
+          <string>Months</string>
+         </property>
+        </widget>
+       </item>
        <item row="7" column="1" >
-        <widget class="QSpinBox" name="secondsSpin" >
+        <widget class="QSpinBox" name="minutesSpin" >
          <property name="maximum" >
           <number>60</number>
          </property>
@@ -354,50 +320,106 @@ p, li { white-space: pre-wrap; }
          </property>
         </widget>
        </item>
-       <item row="3" column="1" >
-        <widget class="QSpinBox" name="yearsSpin" >
+       <item row="6" column="1" >
+        <widget class="QSpinBox" name="hoursSpin" >
          <property name="maximum" >
-          <number>999</number>
+          <number>24</number>
          </property>
          <property name="minimum" >
           <number>-1</number>
          </property>
+         <property name="value" >
+          <number>0</number>
+         </property>
         </widget>
        </item>
-       <item row="5" column="0" >
-        <widget class="QLabel" name="label_9" >
+       <item row="1" column="0" colspan="2" >
+        <widget class="QRadioButton" name="retentionRadio" >
          <property name="text" >
-          <string>Hours</string>
+          <string>Retention</string>
          </property>
         </widget>
        </item>
-       <item row="6" column="1" >
-        <widget class="QSpinBox" name="minutesSpin" >
+       <item row="4" column="1" >
+        <widget class="QSpinBox" name="monthsSpin" >
          <property name="maximum" >
-          <number>60</number>
+          <number>12</number>
          </property>
          <property name="minimum" >
           <number>-1</number>
          </property>
         </widget>
        </item>
-       <item row="0" column="0" colspan="2" >
+       <item row="7" column="0" >
+        <widget class="QLabel" name="label_10" >
+         <property name="text" >
+          <string>Minutes</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item row="5" column="1" >
+      <widget class="QSpinBox" name="retentionSpin" >
+       <property name="maximum" >
+        <number>2147483647</number>
+       </property>
+      </widget>
+     </item>
+     <item row="1" column="0" colspan="2" >
+      <layout class="QHBoxLayout" >
+       <property name="margin" >
+        <number>0</number>
+       </property>
+       <property name="spacing" >
+        <number>6</number>
+       </property>
+       <item>
         <spacer>
          <property name="orientation" >
-          <enum>Qt::Vertical</enum>
+          <enum>Qt::Horizontal</enum>
          </property>
          <property name="sizeHint" >
           <size>
-           <width>97</width>
-           <height>71</height>
+           <width>40</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="volumeLabel" >
+         <property name="maximumSize" >
+          <size>
+           <width>16777215</width>
+           <height>48</height>
+          </size>
+         </property>
+         <property name="text" >
+          <string>Volume : </string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>40</width>
+           <height>20</height>
           </size>
          </property>
         </spacer>
        </item>
       </layout>
      </item>
-     <item row="9" column="1" >
-      <widget class="QSpinBox" name="maxFilesSpin" >
+     <item row="2" column="1" >
+      <widget class="QComboBox" name="poolCombo" />
+     </item>
+     <item row="6" column="1" >
+      <widget class="QSpinBox" name="useDurationSpin" >
        <property name="maximum" >
         <number>2147483647</number>
        </property>
@@ -436,106 +458,75 @@ p, li { white-space: pre-wrap; }
        </item>
       </layout>
      </item>
-     <item row="6" column="1" >
-      <widget class="QSpinBox" name="useDurationSpin" >
-       <property name="maximum" >
-        <number>2147483647</number>
-       </property>
-      </widget>
-     </item>
-     <item row="7" column="1" >
-      <widget class="QSpinBox" name="maxJobsSpin" >
-       <property name="maximum" >
-        <number>2147483647</number>
-       </property>
-      </widget>
-     </item>
-     <item row="6" column="0" >
-      <widget class="QLabel" name="label_7" >
-       <property name="text" >
-        <string>Use Duration:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="2" column="0" >
-      <widget class="QLabel" name="label_3" >
-       <property name="text" >
-        <string>Pool:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>poolCombo</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="10" column="1" >
-      <widget class="QComboBox" name="recyclePoolCombo" />
-     </item>
-     <item row="8" column="0" >
-      <widget class="QLabel" name="label_13" >
-       <property name="text" >
-        <string>Max Volume Bytes:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="5" column="0" >
-      <widget class="QLabel" name="label_6" >
-       <property name="text" >
-        <string>Retension:</string>
+     <item row="0" column="0" colspan="2" >
+      <layout class="QHBoxLayout" >
+       <property name="margin" >
+        <number>0</number>
        </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
+       <property name="spacing" >
+        <number>6</number>
        </property>
-      </widget>
-     </item>
-     <item row="2" column="1" >
-      <widget class="QComboBox" name="poolCombo" />
+       <item>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>71</width>
+           <height>21</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+       <item>
+        <widget class="QLabel" name="label" >
+         <property name="maximumSize" >
+          <size>
+           <width>16777215</width>
+           <height>30</height>
+          </size>
+         </property>
+         <property name="text" >
+          <string>&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+p, li { white-space: pre-wrap; }
+&lt;/style>&lt;/head>&lt;body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal; text-decoration:none;">
+&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">&lt;span style=" font-size:12pt; font-weight:600;">Edit a Volume&lt;/span>&lt;/p>&lt;/body>&lt;/html></string>
+         </property>
+        </widget>
+       </item>
+       <item>
+        <spacer>
+         <property name="orientation" >
+          <enum>Qt::Horizontal</enum>
+         </property>
+         <property name="sizeHint" >
+          <size>
+           <width>81</width>
+           <height>20</height>
+          </size>
+         </property>
+        </spacer>
+       </item>
+      </layout>
      </item>
-     <item row="4" column="0" >
-      <widget class="QLabel" name="label_4" >
-       <property name="text" >
-        <string>Slot:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
+     <item row="4" column="1" >
+      <widget class="QSpinBox" name="slotSpin" >
+       <property name="maximum" >
+        <number>10000</number>
        </property>
       </widget>
      </item>
-     <item row="5" column="1" >
-      <widget class="QSpinBox" name="retentionSpin" >
+     <item row="7" column="1" >
+      <widget class="QSpinBox" name="maxJobsSpin" >
        <property name="maximum" >
         <number>2147483647</number>
        </property>
       </widget>
      </item>
-     <item row="10" column="0" >
-      <widget class="QLabel" name="label_15" >
-       <property name="text" >
-        <string>Recycle Pool:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
-       </property>
-      </widget>
-     </item>
-     <item row="7" column="0" >
-      <widget class="QLabel" name="label_12" >
-       <property name="text" >
-        <string>Max Volume Jobs:</string>
-       </property>
-       <property name="buddy" >
-        <cstring>slotSpin</cstring>
-       </property>
-      </widget>
-     </item>
     </layout>
    </item>
-   <item row="2" column="1" >
+   <item row="0" column="1" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
@@ -548,7 +539,20 @@ p, li { white-space: pre-wrap; }
      </property>
     </spacer>
    </item>
-   <item row="0" column="1" >
+   <item row="1" column="2" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="2" column="1" >
     <spacer>
      <property name="orientation" >
       <enum>Qt::Vertical</enum>
@@ -561,6 +565,19 @@ p, li { white-space: pre-wrap; }
      </property>
     </spacer>
    </item>
+   <item row="1" column="0" >
+    <spacer>
+     <property name="orientation" >
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <property name="sizeHint" >
+      <size>
+       <width>40</width>
+       <height>20</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <resources/>
index e8d248bc90c5862ad8aa80307aa725a244e8b554..dc1e974c6f6886251c341a27606daecb2fbfadd2 100644 (file)
@@ -59,6 +59,7 @@ MediaList::MediaList()
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshMediaList);
+   dockPage();
 }
 
 MediaList::~MediaList()
index 7e2766578465e5a5d117a17bbbdca386300e49fb..aeecc278d22d47693dd3f6c8dd0be0fd01418723 100644 (file)
@@ -44,6 +44,7 @@ bRestore::bRestore()
    setupUi(this);
    pgInitialize();
    m_closeable = true;
+   dockPage();
 }
 
 bRestore::~bRestore()
index 7eafaf9ffd90b2dc26e4c3c8e9c29793c14d8470..8ebbda6e8b2132174103525cd5fa1f0ff84edeb8 100644 (file)
@@ -58,6 +58,7 @@ Storage::Storage()
    /* add context sensitive menu items specific to this classto the page
     * selector tree. m_contextActions is QList of QActions */
    m_contextActions.append(actionRefreshStorage);
+   dockPage();
 }
 
 Storage::~Storage()