--- /dev/null
+add [pool=<pool-name> storage=<storage> jobid=<JobId>]
+These are done from config files
+
+autodisplay on/off
+could be done in the context of the console
+
+automount on/off
+could be done in the context of the console, because is for after a label
+command as opposed to a property of a storage device
+
+cancel [jobid=<number> job=<job-name> ujobid=<unique-jobid>]
+To be done in the context of a status dir graphical window.
+
+create [pool=<pool-name>]
+Done in a config file
+
+delete [volume=<vol-name> pool=<pool-name> job jobid=<id>]
+not done for pool yet
+
+disable job<job-name> and enable job<job-name>
+Could be done in the context of a jobs window which is not yet created
+
+estimate
+Could be a dialog in the context of a jobs window.
+
+help
+could be in the console window
+
+label
+Done by kern before I started
+
+list
+many are done or are reproduced by having windows
+
+llist
+same as list
+
+python
+not needed from bat??
+
+prune files|jobs|volume client=<client-name> volume=<volume-name>
+Should add as a dialog box from both client and medialist
+
+purge files jobid=<jobid>|job=<job-name>|client=<client-name>
+purge jobs client=<client-name> (of all jobs)
+purge volume|volume=<vol-name> (of all jobs)
+ this one is done from media
+
+relabel
+done
+
+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
+
+setdebug
+I'd say we could choose not to implement this in bat
+
+status
+done, want to implement graphically
+
+unmount storage=<storage-name> [ drive=\lt{}num\gt{} ]
+done
+unmount [ jobid=<id> | job=<job-name> ]
+Mmmmm
+
+update media, volume, pool, slots
+media/volume still has more work, they are the same after all
+
+use
+still need to make decisions about how to handle multiple catalogs
+
+var
+Mmmmmm
+
+version
+could be done in console as long as it is explicite about that it is the version
+of the director
+
+quit
+I'd like to have a disconnect graphical option.
+
+exit
+Not really needed
+
+wait
+Mmmmmmm
--- /dev/null
+Each page should have the following in the constructor
+/* this is the text identifying the page in the tree widget */
+m_name = "Restore";
+
+/* this sets values for the class based on the extern mainWin-> it sets
+ m_parent (the stacked widget),
+ m_console (from current console)
+ creates the page selector tree widget and sets it's name and inserts
+ itself in the double direction hashes */
+pgInitialize(parentwidgetitem); or
+pgInitialize(); which will have the director as parent in page selector
+
+/* is this window always present or can the user remove it */
+m_closeable = true;
+
+/* put the page in the stack widget */
+dockPage();
+/* bring the page to the top of the widget by "selecting" the tree widget
+ item in the page selector */
+setCurrent();
+
./bat
The qmake command needs to be entered only if you add a new file, in
-which case, you should edit bat.pro and add the new filename
+which case, you should edit bat.pro.in and add the new filename
in the appropriate place. In running qmake, it will build a new
Makefile, and there after, you simply use "make". In fact, providing
you edit bat.pro, doing a "make" will automatically call qmake to
dhb
====================================================
+Resolve issue of connection during restore selection. Could go with preempt
+
+Add option to LIMIT the number of jobs shown in all jobs page for users with
+multiple hundreds to thousands of jobs.
+
+Where and bootstrap are confused in runjobs of restore.
+
+User preferences. With log to stdout options.
+
Test restore and get anything not working, working.
+ partially done.
Get restore into stack.
+ Should the jobs dialog be turned into a page as well??
-Play with includes to Make these compiles shorter.
+Update README describe bat.conf.example to bat.conf
Create list of what does not work.
From what I can tell, just the restore window on the left.
All items with jobid= that I thought could work from joblist are done.
As well as many more
update slots scan
+see COMMANDS file
preempt all connections to console with
if (!is_connectedGui())
LOW priority items:
+User configuration dialog. Include options for debugging output to stdout.
+
+Is there a way to query the director/database for whether a storage is currently
+mounted so I am not presenting both mount and unmount to the user??
+
+Is there a way to identify a slot as having a cleaning tape???
+(Kern says more work needs to be done in bacula with autochangers)
+
Get rid of "Warning: name layoutWidget is already used" when make uic's restore.ui
move behavior of:
============================================================
DONE:
============================================================
+Play with includes to Make these compiles shorter.
+ moved includes of of includes and into files only console.h should be long
+
relabel storage=DDS3 oldvolume=ddsvol003 volume=dds3vol003 slot=3 pool=dds3_hope
in label slot spinner, limit the upper to the value of slots for that storage.
+++ /dev/null
-add [pool=<pool-name> storage=<storage> jobid=<JobId>]
-These are done from config files
-
-autodisplay on/off
-could be done in the context of the console
-
-automount on/off
-could be done in the context of the console, because is for after a label
-command as opposed to a property of a storage device
-
-cancel [jobid=<number> job=<job-name> ujobid=<unique-jobid>]
-To be done in the context of a status dir graphical window.
-
-create [pool=<pool-name>]
-Done in a config file
-
-delete [volume=<vol-name> pool=<pool-name> job jobid=<id>]
-not done for pool yet
-
-disable job<job-name> and enable job<job-name>
-Could be done in the context of a jobs window which is not yet created
-
-estimate
-Could be a dialog in the context of a jobs window.
-
-help
-could be in the console window
-
-label
-Done by kern before I started
-
-list
-many are done or are reproduced by having windows
-
-llist
-same as list
-
-python
-not needed from bat??
-
-prune files|jobs|volume client=<client-name> volume=<volume-name>
-Should add as a dialog box from both client and medialist
-
-purge files jobid=<jobid>|job=<job-name>|client=<client-name>
-purge jobs client=<client-name> (of all jobs)
-purge volume|volume=<vol-name> (of all jobs)
- this one is done from media
-
-relabel
-done
-
-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
-
-setdebug
-I'd say we could choose not to implement this in bat
-
-status
-done, want to implement graphically
-
-unmount storage=<storage-name> [ drive=\lt{}num\gt{} ]
-done
-unmount [ jobid=<id> | job=<job-name> ]
-Mmmmm
-
-update media, volume, pool, slots
-media/volume still has more work, they are the same after all
-
-use
-still need to make decisions about how to handle multiple catalogs
-
-var
-Mmmmmm
-
-version
-could be done in console as long as it is explicite about that it is the version
-of the director
-
-quit
-I'd like to have a disconnect graphical option.
-
-exit
-Not really needed
-
-wait
-Mmmmmmm
#include <QAbstractEventDispatcher>
#include "bat.h"
#include "console.h"
+#include "restore.h"
+#include "select.h"
+#include "run/run.h"
Console::Console(QStackedWidget *parent)
{
#include <QtGui>
#include "pages.h"
#include "ui_console.h"
-#include "restore.h"
-#include "select.h"
#ifndef MAX_NAME_LENGTH
#define MAX_NAME_LENGTH 128
QString cmd("status fileset=");
cmd += m_currentlyselected;
consoleCommand(cmd);
-// m_console->write_dir(cmd.toUtf8().data());
-// m_console->displayToPrompt();
- /* Bring this directors console to the front of the stack */
-// mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(m_console));
}
/*
#include "joblist/joblist.h"
#include "storage/storage.h"
#include "fileset/fileset.h"
+#include "label/label.h"
+#include "run/run.h"
+#include "pages.h"
+#include "restore/restore.h"
+#include "medialist/medialist.h"
+#include "joblist/joblist.h"
+#include "clients/clients.h"
MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
{
console->connect();
}
m_currentConsole = (Console*)getFromHash(m_firstItem);
- treeWidget->setCurrentItem(getFromHash(m_currentConsole));
+ m_currentConsole->setCurrent();
/* FIXME
* I'd like to turn this into a debug item
* DIRRES* dirres = m_currentConsole->getDirRes();
void MainWin::createPageJobList(QString &media, QString &client,
QTreeWidgetItem *parentTreeWidgetItem)
{
- QTreeWidgetItem *item, *holdItem;
+ QTreeWidgetItem *holdItem;
/* save current tree widget item in case query produces no results */
holdItem = treeWidget->currentItem();
joblist->dockPage();
/* If this is a query of jobs on a specific media */
if ((media != "") || (client != "")) {
- item = getFromHash(joblist);
- treeWidget->setCurrentItem(item);
+ joblist->setCurrent();
/* did query produce results, if not close window and set back to hold */
if (joblist->m_resultCount == 0) {
joblist->closeStackPage();
connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelDialogClicked()));
connect(actionRun, SIGNAL(triggered()), this, SLOT(runDialogClicked()));
- connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreDialogClicked()));
+ connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked()));
connect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton()));
connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
connect(actionClosePage, SIGNAL(triggered()), this, SLOT(closePage()));
new runDialog(m_currentConsole);
}
-void MainWin::restoreDialogClicked()
+void MainWin::restoreButtonClicked()
{
- new prerestoreDialog(m_currentConsole);
+ new prerestorePage(m_currentConsole);
}
/*
}
m_cmd_history.append(cmdStr);
m_cmd_last = -1;
- if (treeWidget->currentItem() != getFromHash(m_currentConsole)){
- treeWidget->setCurrentItem(getFromHash(m_currentConsole));
- }
+ if (treeWidget->currentItem() != getFromHash(m_currentConsole))
+ m_currentConsole->setCurrent();
}
}
}
}
+
+/* Quick function to return the current console */
+Console *MainWin::currentConsole()
+{
+ return m_currentConsole;
+}
+/* Quick function to return the tree item for the director */
+QTreeWidgetItem *MainWin::currentTopItem()
+{
+ return m_currentConsole->directorTreeItem();
+}
#include <QtGui>
#include <QList>
#include "ui_main.h"
-#include "label/label.h"
-#include "run/run.h"
-#include "pages.h"
-#include "restore/restore.h"
-#include "medialist/medialist.h"
-#include "joblist/joblist.h"
-#include "clients/clients.h"
class Console;
+class Pages;
class MainWin : public QMainWindow, public Ui::MainForm
{
void hashInsert(QTreeWidgetItem *, Pages *);
void hashRemove(Pages *);
void hashRemove(QTreeWidgetItem *, Pages *);
- QTreeWidgetItem *currentTopItem() { return m_currentConsole->directorTreeItem(); };
- Console *currentConsole() { return m_currentConsole; };
+ Console *currentConsole();
+ QTreeWidgetItem *currentTopItem();
Pages* getFromHash(QTreeWidgetItem *);
QTreeWidgetItem* getFromHash(Pages *);
/* This hash is to get the page when the page selector widget is known */
void treeItemClicked(QTreeWidgetItem *item, int column);
void labelDialogClicked();
void runDialogClicked();
- void restoreDialogClicked();
+ void restoreButtonClicked();
void undockWindowButton();
void treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
void stackItemChanged(int);
*/
void MediaList::relabelVolume()
{
- placeConsoleOnTop();
+ setConsoleCurrent();
new relabelDialog(m_console, m_currentVolumeName);
}
/* Set the current tree widget item in the Page Selector window to the item
* which represents "this" */
- QTreeWidgetItem *item= mainWin->getFromHash(this);
- mainWin->treeWidget->setCurrentItem(item);
+ setCurrent();
}
/*
if (!m_console->is_connectedGui())
return;
/* Bring this directors console to the front of the stack */
- placeConsoleOnTop();
+ setConsoleCurrent();
m_console->display_text("Context sensitive command :\n\n");
m_console->display_text("**** ");
m_console->display_text(command + " ****\n");
void Pages::changeEvent(QEvent *event)
{
if ((event->type() == QEvent::ActivationChange) && (isActiveWindow())) {
- mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(this));
+ setCurrent();
}
}
/*
* Bring the current directors console window to the top of the stack.
*/
-void Pages::placeConsoleOnTop()
+void Pages::setConsoleCurrent()
{
mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(m_console));
}
+
+/*
+ * Bring this window to the top of the stack.
+ */
+void Pages::setCurrent()
+{
+ mainWin->treeWidget->setCurrentItem(mainWin->getFromHash(this));
+}
virtual void currentStackItem();
void closeStackPage();
Console *console() { return m_console; };
+ void setCurrent();
public slots:
/* closeEvent is a virtual function inherited from QWidget */
void consoleCommand(QString &);
virtual void treeWidgetName(QString &);
virtual void changeEvent(QEvent *event);
- void placeConsoleOnTop();
+ void setConsoleCurrent();
void setTitle();
bool m_closeable;
bool m_docked;
#include "restore.h"
-prerestoreDialog::prerestoreDialog(Console *console)
+prerestorePage::prerestorePage(Console *console)
{
- m_console = console; /* keep compiler quiet */
- m_console->notify(false);
+ console->notify(false);
+ m_name = "Pre-Restore";
setupUi(this);
+ QTreeWidgetItem *parent = mainWin->getFromHash(console);
+ if (!parent) {
+ /* ***FIXME*** */
+ printf("Error retrieving tree widget.");
+ return;
+ }
+ pgInitialize(parent);
+ m_closeable = true;
+
jobCombo->addItems(console->job_list);
filesetCombo->addItems(console->fileset_list);
clientCombo->addItems(console->client_list);
poolCombo->addItems(console->pool_list);
storageCombo->addItems(console->storage_list);
+ //beforeDateTime->setDate(QDateTime::currentDateTime().toUTC().date());
+ beforeDateTime->setDateTime(QDateTime::currentDateTime());
+ beforeDateTime->setEnabled(false);
job_name_change(0);
connect(jobCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(job_name_change(int)));
+ connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
+ connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
+ dockPage();
+ setCurrent();
this->show();
}
-void prerestoreDialog::accept()
+void prerestorePage::okButtonPushed()
{
QString cmd;
.arg(poolCombo->currentText())
.arg(storageCombo->currentText());
+ /* ***FIXME*** */
+ printf("preRestore command \"%s\"\n", cmd.toUtf8().data());
m_console->write(cmd);
m_console->display_text(cmd);
/* Note, do not turn notifier back on here ... */
- new restoreDialog(m_console);
- delete this;
+ new restorePage(m_console);
+ closeStackPage();
}
-void prerestoreDialog::reject()
+void prerestorePage::cancelButtonPushed()
{
mainWin->set_status("Canceled");
this->hide();
m_console->notify(true);
- delete this;
+ closeStackPage();
}
-void prerestoreDialog::job_name_change(int index)
+void prerestorePage::job_name_change(int index)
{
job_defaults job_defs;
<ui version="4.0" >
<class>prerestoreForm</class>
- <widget class="QDialog" name="prerestoreForm" >
- <property name="windowModality" >
- <enum>Qt::WindowModal</enum>
- </property>
+ <widget class="QWidget" name="prerestoreForm" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
- <width>366</width>
- <height>299</height>
+ <width>561</width>
+ <height>408</height>
</rect>
</property>
- <property name="maximumSize" >
- <size>
- <width>500</width>
- <height>500</height>
- </size>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::StrongFocus</enum>
- </property>
<property name="windowTitle" >
- <string>Restore Files</string>
+ <string>Form</string>
</property>
- <layout class="QVBoxLayout" >
+ <layout class="QGridLayout" >
<property name="margin" >
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
- <item>
+ <item row="3" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="0" column="1" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <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" >
<number>8</number>
</item>
</layout>
</item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox" >
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
+ <item row="2" column="1" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
</property>
- <property name="standardButtons" >
- <set>QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
+ <property name="spacing" >
+ <number>6</number>
</property>
- </widget>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>171</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
</item>
</layout>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>prerestoreForm</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel" >
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>prerestoreForm</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel" >
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
#include "bat.h"
#include "restore.h"
-restoreDialog::restoreDialog(Console *console )
+restorePage::restorePage(Console *console)
{
QStringList titles;
- m_console = console;
+ setupUi(this);
+ QTreeWidgetItem *parent = mainWin->getFromHash(console);
+ if (!parent) {
+ /* Make this a user configurable stdout msg *** FIXME ****/
+ printf("Error retrieving tree widget.");
+ return;
+ }
+ m_name = "Restore";
+ pgInitialize(parent);
m_console->notify(false); /* this should already be off */
+ m_closeable = true;
- setupUi(this);
connect(fileWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int)),
this, SLOT(fileDoubleClicked(QTreeWidgetItem *, int)));
connect(directoryWidget, SIGNAL(
connect(upButton, SIGNAL(pressed()), this, SLOT(upButtonPushed()));
connect(markButton, SIGNAL(pressed()), this, SLOT(markButtonPushed()));
connect(unmarkButton, SIGNAL(pressed()), this, SLOT(unmarkButtonPushed()));
+ connect(okButton, SIGNAL(pressed()), this, SLOT(okButtonPushed()));
+ connect(cancelButton, SIGNAL(pressed()), this, SLOT(cancelButtonPushed()));
setFont(m_console->get_font());
m_console->displayToPrompt();
-
titles << "Mark" << "File" << "Mode" << "User" << "Group" << "Size" << "Date";
fileWidget->setHeaderLabels(titles);
get_cwd();
+
+ //QString root("");
+ //addDirectory(root);
fillDirectory();
+ dockPage();
+ setCurrent();
this->show();
}
/*
* Fill the fileWidget box with the contents of the current directory
*/
-void restoreDialog::fillDirectory()
+void restorePage::fillDirectory()
{
char modes[20], user[20], group[20], size[20], date[30];
char marked[10];
* Function called from fill directory when a directory is found to see if this
* directory exists in the directory pane and then add it to the directory pane
*/
-void restoreDialog::addDirectory(QString &newdir)
+void restorePage::addDirectory(QString &newdirr)
{
- QString fullpath ;
+ QString newdir = newdirr;
+ QString fullpath = m_cwd + newdirr;
+ QRegExp regex("^/[a-z]:/$");
+ bool ok=true;
- /* if this is the base dir, strip off the leading "/" */
- if (m_cwd == "/"){
- fullpath = newdir;
- } else {
- fullpath = m_cwd + newdir;
+ //printf("In addDirectory cwd \"%s\" newdir \"%s\"\n", m_cwd.toUtf8().data(),
+ //newdir.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());
+ 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 c:/\n");
+ fullpath.replace(0,1,"");
}
+
/* is it already existent ?? */
if (!m_dirPaths.contains(fullpath)) {
QTreeWidgetItem *item = NULL;
if (m_dirPaths.empty()) {
/* this is the base widget */
item = new QTreeWidgetItem(directoryWidget);
- item->setText(0, newdir.toUtf8().data());
+ item->setText(0, fullpath.toUtf8().data());
} else {
QTreeWidgetItem *parent = m_dirPaths.value(m_cwd);
if (parent) {
item = new QTreeWidgetItem(parent);
item->setText(0, newdir.toUtf8().data());
directoryWidget->expandItem(parent);
+ } else {
+ ok=false;
+ //printf("In else of if parent cwd \"%s\" newdir \"%s\"\n",
+ //m_cwd.toUtf8().data() ,newdir.toUtf8().data());
}
}
/* insert into both forward and reverse hash */
- m_dirPaths.insert(fullpath, item);
- m_dirTreeItems.insert(item, fullpath);
+ if (ok) {
+ //printf("Inserting %s\n",fullpath.toUtf8().data());
+ m_dirPaths.insert(fullpath, item);
+ m_dirTreeItems.insert(item, fullpath);
+ }
}
}
* Executed when the tree item in the directory pane is changed. This will
* allow us to populate the file pane and make this the cwd.
*/
-void restoreDialog::directoryItemChanged(QTreeWidgetItem *currentitem,
+void restorePage::directoryItemChanged(QTreeWidgetItem *currentitem,
QTreeWidgetItem * /*previousitem*/)
{
QString fullpath = m_dirTreeItems.value(currentitem);
}
}
-void restoreDialog::accept()
+void restorePage::okButtonPushed()
{
this->hide();
m_console->write("done");
m_console->notify(true);
- delete this;
+ closeStackPage();
mainWin->resetFocus();
}
-void restoreDialog::reject()
+void restorePage::cancelButtonPushed()
{
this->hide();
m_console->write("quit");
mainWin->set_status("Canceled");
- delete this;
+ closeStackPage();
m_console->notify(true);
mainWin->resetFocus();
}
-void restoreDialog::fileDoubleClicked(QTreeWidgetItem *item, int column)
+void restorePage::fileDoubleClicked(QTreeWidgetItem *item, int column)
{
char cmd[1000];
if (column == 0) { /* mark/unmark */
*/
if (item->text(1).endsWith("/")) {
QString fullpath = m_cwd + item->text(1);
+ /* check for fullpath = "/c:/" */
+ QRegExp regex("^/[a-z]:/");
+ if (regex.indexIn(fullpath,0) == 0) /* remove leading '/' */
+ fullpath.replace(0,1,"");
QTreeWidgetItem *item = m_dirPaths.value(fullpath);
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());
}
}
}
* If up button pushed, making the parent tree widget current will call fill
* directory.
*/
-void restoreDialog::upButtonPushed()
+void restorePage::upButtonPushed()
{
cwd("..");
QTreeWidgetItem *item = m_dirPaths.value(m_cwd);
/*
* Mark selected items
*/
-void restoreDialog::markButtonPushed()
+void restorePage::markButtonPushed()
{
QList<QTreeWidgetItem *> treeItemList = fileWidget->selectedItems();
QTreeWidgetItem *item;
/*
* Unmark selected items
*/
-void restoreDialog::unmarkButtonPushed()
+void restorePage::unmarkButtonPushed()
{
QList<QTreeWidgetItem *> treeItemList = fileWidget->selectedItems();
QTreeWidgetItem *item;
/*
* Change current working directory
*/
-bool restoreDialog::cwd(const char *dir)
+bool restorePage::cwd(const char *dir)
{
int stat;
char cd_cmd[MAXSTRING];
/*
* Return cwd when in tree restore mode
*/
-char *restoreDialog::get_cwd()
+char *restorePage::get_cwd()
{
int stat;
m_console->write_dir(".pwd");
* The pre-restore dialog selects the Job/Client to be restored
* It really could use considerable enhancement.
*/
-class prerestoreDialog : public QDialog, public Ui::prerestoreForm
+class prerestorePage : public Pages, public Ui::prerestoreForm
{
Q_OBJECT
public:
- prerestoreDialog(Console *parent);
+ prerestorePage(Console *parent);
private slots:
- void accept();
- void reject();
+ void okButtonPushed();
+ void cancelButtonPushed();
void job_name_change(int index);
private:
- Console *m_console;
-
};
/*
* restore tree routines. It handles putting up a GUI tree
* representation of the files to be restored.
*/
-class restoreDialog : public QDialog, public Ui::restoreForm
+class restorePage : public Pages, public Ui::restoreForm
{
Q_OBJECT
public:
- restoreDialog(Console *parent);
+ restorePage(Console *parent);
void fillDirectory();
char *get_cwd();
bool cwd(const char *);
private slots:
- void accept();
- void reject();
+ void okButtonPushed();
+ void cancelButtonPushed();
void fileDoubleClicked(QTreeWidgetItem *item, int column);
void directoryItemChanged(QTreeWidgetItem *, QTreeWidgetItem *);
void upButtonPushed();
void addDirectory(QString &);
private:
- Console *m_console;
QString m_cwd;
QHash<QString, QTreeWidgetItem *> m_dirPaths;
QHash<QTreeWidgetItem *,QString> m_dirTreeItems;
<ui version="4.0" >
<class>restoreForm</class>
- <widget class="QDialog" name="restoreForm" >
- <property name="windowModality" >
- <enum>Qt::WindowModal</enum>
- </property>
+ <widget class="QWidget" name="restoreForm" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
- <width>1285</width>
- <height>759</height>
+ <width>824</width>
+ <height>660</height>
</rect>
</property>
<property name="windowTitle" >
- <string>Restore File Selection</string>
+ <string>Form</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>6</number>
</property>
<item row="1" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Current Dir:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>lineEdit</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLineEdit" name="lineEdit" >
+ <property name="minimumSize" >
+ <size>
+ <width>100</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>30</width>
+ <height>32</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="cancelButton" >
+ <property name="text" >
+ <string>Cancel</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="okButton" >
+ <property name="text" >
+ <string>OK</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="2" column="0" >
+ <layout class="QHBoxLayout" >
+ <property name="margin" >
+ <number>0</number>
+ </property>
+ <property name="spacing" >
+ <number>6</number>
+ </property>
+ <item>
+ <widget class="QLabel" name="label_4" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string>Status:</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="statusLine" >
+ <property name="sizePolicy" >
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text" >
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item row="0" column="0" >
<widget class="QSplitter" name="splitter" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QWidget" name="layoutWidget" >
+ <widget class="QWidget" name="layoutWidget_2" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</item>
</layout>
</widget>
- <widget class="QWidget" name="layoutWidget" >
+ <widget class="QWidget" name="layoutWidget_3" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="sizeHint" >
<size>
- <width>261</width>
+ <width>100</width>
<height>30</height>
</size>
</property>
</widget>
</widget>
</item>
- <item row="0" column="0" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Vertical</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>16</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="2" column="0" >
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>5</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Current Dir:</string>
- </property>
- <property name="buddy" >
- <cstring>lineEdit</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLineEdit" name="lineEdit" >
- <property name="minimumSize" >
- <size>
- <width>100</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- <item>
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeType" >
- <enum>QSizePolicy::Fixed</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>30</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item>
- <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>
- </layout>
- </item>
- <item row="3" column="0" >
- <layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="label_4" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string>Status:</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QLabel" name="statusLine" >
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text" >
- <string/>
- </property>
- </widget>
- </item>
- </layout>
- </item>
</layout>
- <action name="actionUp" >
- <property name="icon" >
- <iconset>:images/up.png</iconset>
- </property>
- <property name="text" >
- <string>Up</string>
- </property>
- </action>
- <action name="actionMark" >
- <property name="icon" >
- <iconset>:images/mark.png</iconset>
- </property>
- <property name="text" >
- <string>Mark</string>
- </property>
- </action>
- <action name="actionUnmark" >
- <property name="icon" >
- <iconset>:images/unmark.png</iconset>
- </property>
- <property name="text" >
- <string>Unmark</string>
- </property>
- </action>
</widget>
<resources/>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>restoreForm</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>955</x>
- <y>719</y>
- </hint>
- <hint type="destinationlabel" >
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>restoreForm</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel" >
- <x>1023</x>
- <y>719</y>
- </hint>
- <hint type="destinationlabel" >
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
+ <connections/>
</ui>
#include <QMenu>
#include "bat.h"
#include "storage.h"
+#include "label/label.h"
#include "../mount/mount.h"
Storage::Storage()
cmd += m_currentStorage;
consoleCommand(cmd);
}
+
+/* Label Media populating current storage by default */
void Storage::consoleLabelStorage()
{
new labelDialog(m_console, m_currentStorage);
}
+
+/* Mount currently selected storage */
void Storage::consoleMountStorage()
{
if (m_currentAutoChanger == 0){
cmd += m_currentStorage;
consoleCommand(cmd);
} else {
- placeConsoleOnTop();
+ setConsoleCurrent();
/* if this storage is an autochanger, lets ask for the slot */
new mountDialog(m_console, m_currentStorage);
}
}
+
+/* Unmount Currently selected storage */
void Storage::consoleUnMountStorage()
{
QString cmd("umount storage=");