#############################################################################
# Makefile for building: bat
-# Generated by qmake (2.01a) (Qt 4.2.1) on: Thu Mar 15 21:12:02 2007
+# Generated by qmake (2.01a) (Qt 4.2.1) on: Tue Mar 20 22:04:12 2007
# Project: bat.pro
# Template: app
# Command: /usr/bin/qmake -unix -o Makefile bat.pro
run/run.cpp \
run/runcmd.cpp \
select/select.cpp \
- medialist/medialist.cpp moc/moc_mainwin.cpp \
+ medialist/medialist.cpp \
+ mediaedit/mediaedit.cpp \
+ joblist/joblist.cpp moc/moc_mainwin.cpp \
moc/moc_console.cpp \
moc/moc_restore.cpp \
moc/moc_label.cpp \
moc/moc_run.cpp \
moc/moc_select.cpp \
moc/moc_medialist.cpp \
+ moc/moc_mediaedit.cpp \
+ moc/moc_joblist.cpp \
qrc_main.cpp
OBJECTS = obj/main.o \
obj/bat_conf.o \
obj/runcmd.o \
obj/select.o \
obj/medialist.o \
+ obj/mediaedit.o \
+ obj/joblist.o \
obj/moc_mainwin.o \
obj/moc_console.o \
obj/moc_restore.o \
obj/moc_run.o \
obj/moc_select.o \
obj/moc_medialist.o \
+ obj/moc_mediaedit.o \
+ obj/moc_joblist.o \
obj/qrc_main.o
DIST = /usr/share/qt4/mkspecs/common/unix.conf \
/usr/share/qt4/mkspecs/common/g++.conf \
all: Makefile $(TARGET)
-$(TARGET): ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h $(OBJECTS)
+$(TARGET): ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h ui/ui_mediaedit.h ui/ui_joblist.h $(OBJECTS)
$(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(OBJCOMP) $(LIBS)
Makefile: bat.pro /usr/share/qt4/mkspecs/default/qmake.conf /usr/share/qt4/mkspecs/common/unix.conf \
dist:
@$(CHK_DIR_EXISTS) obj/bat1.0.0 || $(MKDIR) obj/bat1.0.0
- $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h qstd.h console/console.h restore/restore.h label/label.h run/run.h select/select.h medialist/medialist.h obj/bat1.0.0/ && $(COPY_FILE) --parents main.qrc obj/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp qstd.cpp console/authenticate.cpp console/console.cpp restore/prerestore.cpp restore/restore.cpp restore/brestore.cpp label/label.cpp run/run.cpp run/runcmd.cpp select/select.cpp medialist/medialist.cpp obj/bat1.0.0/ && $(COPY_FILE) --parents main.ui label/label.ui console/console.ui restore/restore.ui restore/prerestore.ui restore/brestore.ui run/run.ui run/runcmd.ui select/select.ui medialist/medialist.ui obj/bat1.0.0/ && (cd `dirname obj/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname obj/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r obj/bat1.0.0
+ $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/bat1.0.0/ && $(COPY_FILE) --parents mainwin.h bat.h bat_conf.h qstd.h console/console.h restore/restore.h label/label.h run/run.h select/select.h medialist/medialist.h mediaedit/mediaedit.h joblist/joblist.h obj/bat1.0.0/ && $(COPY_FILE) --parents main.qrc obj/bat1.0.0/ && $(COPY_FILE) --parents main.cpp bat_conf.cpp mainwin.cpp qstd.cpp console/authenticate.cpp console/console.cpp restore/prerestore.cpp restore/restore.cpp restore/brestore.cpp label/label.cpp run/run.cpp run/runcmd.cpp select/select.cpp medialist/medialist.cpp mediaedit/mediaedit.cpp joblist/joblist.cpp obj/bat1.0.0/ && $(COPY_FILE) --parents main.ui label/label.ui console/console.ui restore/restore.ui restore/prerestore.ui restore/brestore.ui run/run.ui run/runcmd.ui select/select.ui medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui obj/bat1.0.0/ && (cd `dirname obj/bat1.0.0` && $(TAR) bat1.0.0.tar bat1.0.0 && $(COMPRESS) bat1.0.0.tar) && $(MOVE) `dirname obj/bat1.0.0`/bat1.0.0.tar.gz . && $(DEL_FILE) -r obj/bat1.0.0
yaccclean:
mocables: compiler_moc_header_make_all compiler_moc_source_make_all
-compiler_moc_header_make_all: moc/moc_mainwin.cpp moc/moc_console.cpp moc/moc_restore.cpp moc/moc_label.cpp moc/moc_run.cpp moc/moc_select.cpp moc/moc_medialist.cpp
+compiler_moc_header_make_all: moc/moc_mainwin.cpp moc/moc_console.cpp moc/moc_restore.cpp moc/moc_label.cpp moc/moc_run.cpp moc/moc_select.cpp moc/moc_medialist.cpp moc/moc_mediaedit.cpp moc/moc_joblist.cpp
compiler_moc_header_clean:
- -$(DEL_FILE) moc/moc_mainwin.cpp moc/moc_console.cpp moc/moc_restore.cpp moc/moc_label.cpp moc/moc_run.cpp moc/moc_select.cpp moc/moc_medialist.cpp
+ -$(DEL_FILE) moc/moc_mainwin.cpp moc/moc_console.cpp moc/moc_restore.cpp moc/moc_label.cpp moc/moc_run.cpp moc/moc_select.cpp moc/moc_medialist.cpp moc/moc_mediaedit.cpp moc/moc_joblist.cpp
moc/moc_mainwin.cpp: ui/ui_main.h \
label/label.h \
ui/ui_label.h \
/usr/bin/moc
/usr/bin/moc $(DEFINES) $(INCPATH) medialist/medialist.h -o moc/moc_medialist.cpp
+moc/moc_mediaedit.cpp: ui/ui_mediaedit.h \
+ mediaedit/mediaedit.h \
+ /usr/bin/moc
+ /usr/bin/moc $(DEFINES) $(INCPATH) mediaedit/mediaedit.h -o moc/moc_mediaedit.cpp
+
+moc/moc_joblist.cpp: ui/ui_joblist.h \
+ joblist/joblist.h \
+ /usr/bin/moc
+ /usr/bin/moc $(DEFINES) $(INCPATH) joblist/joblist.h -o moc/moc_joblist.cpp
+
compiler_rcc_make_all: qrc_main.cpp
compiler_rcc_clean:
-$(DEL_FILE) qrc_main.cpp
-$(DEL_FILE) qmake_image_collection.cpp
compiler_moc_source_make_all:
compiler_moc_source_clean:
-compiler_uic_make_all: ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h
+compiler_uic_make_all: ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h ui/ui_mediaedit.h ui/ui_joblist.h
compiler_uic_clean:
- -$(DEL_FILE) ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h
+ -$(DEL_FILE) ui/ui_main.h ui/ui_label.h ui/ui_console.h ui/ui_restore.h ui/ui_prerestore.h ui/ui_brestore.h ui/ui_run.h ui/ui_runcmd.h ui/ui_select.h ui/ui_medialist.h ui/ui_mediaedit.h ui/ui_joblist.h
ui/ui_main.h: main.ui
/usr/bin/uic main.ui -o ui/ui_main.h
ui/ui_medialist.h: medialist/medialist.ui
/usr/bin/uic medialist/medialist.ui -o ui/ui_medialist.h
+ui/ui_mediaedit.h: mediaedit/mediaedit.ui
+ /usr/bin/uic mediaedit/mediaedit.ui -o ui/ui_mediaedit.h
+
+ui/ui_joblist.h: joblist/joblist.ui
+ /usr/bin/uic joblist/joblist.ui -o ui/ui_joblist.h
+
compiler_clean: compiler_moc_header_clean compiler_rcc_clean compiler_image_collection_clean compiler_moc_source_clean compiler_uic_clean
####### Compile
qstd.h
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/medialist.o medialist/medialist.cpp
+obj/mediaedit.o: mediaedit/mediaedit.cpp bat.h \
+ mainwin.h \
+ ui/ui_main.h \
+ label/label.h \
+ ui/ui_label.h \
+ run/run.h \
+ ui/ui_run.h \
+ ui/ui_runcmd.h \
+ restore/restore.h \
+ ui/ui_brestore.h \
+ ui/ui_restore.h \
+ ui/ui_prerestore.h \
+ medialist/medialist.h \
+ ui/ui_medialist.h \
+ bat_conf.h \
+ qstd.h \
+ mediaedit/mediaedit.h \
+ ui/ui_mediaedit.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/mediaedit.o mediaedit/mediaedit.cpp
+
+obj/joblist.o: joblist/joblist.cpp bat.h \
+ mainwin.h \
+ ui/ui_main.h \
+ label/label.h \
+ ui/ui_label.h \
+ run/run.h \
+ ui/ui_run.h \
+ ui/ui_runcmd.h \
+ restore/restore.h \
+ ui/ui_brestore.h \
+ ui/ui_restore.h \
+ ui/ui_prerestore.h \
+ medialist/medialist.h \
+ ui/ui_medialist.h \
+ bat_conf.h \
+ qstd.h \
+ joblist/joblist.h \
+ ui/ui_joblist.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/joblist.o joblist/joblist.cpp
+
obj/moc_mainwin.o: moc/moc_mainwin.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_mainwin.o moc/moc_mainwin.cpp
obj/moc_medialist.o: moc/moc_medialist.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_medialist.o moc/moc_medialist.cpp
+obj/moc_mediaedit.o: moc/moc_mediaedit.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_mediaedit.o moc/moc_mediaedit.cpp
+
+obj/moc_joblist.o: moc/moc_joblist.cpp
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/moc_joblist.o moc/moc_joblist.cpp
+
obj/qrc_main.o: qrc_main.cpp
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qrc_main.o qrc_main.cpp
FORMS += restore/restore.ui restore/prerestore.ui restore/brestore.ui
FORMS += run/run.ui run/runcmd.ui
FORMS += select/select.ui
-FORMS += medialist/medialist.ui
-
+FORMS += medialist/medialist.ui mediaedit/mediaedit.ui joblist/joblist.ui
HEADERS += mainwin.h bat.h bat_conf.h qstd.h
SOURCES += main.cpp bat_conf.cpp mainwin.cpp qstd.cpp
HEADERS += select/select.h
SOURCES += select/select.cpp
-## Medialist
+## MediaList
HEADERS += medialist/medialist.h
SOURCES += medialist/medialist.cpp
+
+## MediaEdit
+HEADERS += mediaedit/mediaedit.h
+SOURCES += mediaedit/mediaedit.cpp
+
+## JobList
+HEADERS += joblist/joblist.h
+SOURCES += joblist/joblist.cpp
--- /dev/null
+/*
+ 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.
+*/
+
+#include <QAbstractEventDispatcher>
+#include "bat.h"
+#include "joblist.h"
+#include <QTableWidgetItem>
+
+JobList::JobList(Console *console, QString &medianame)
+{
+ printf("Listing Jobs on Media %s\n", medianame.toUtf8().data());
+ setupUi(this);
+ m_console = console;
+ tableWidget->clear();
+ tableWidget->setColumnCount(2);
+ tableWidget->setRowCount(5);
+ QTableWidgetItem* item = new QTableWidgetItem(medianame,1);
+ tableWidget->setItem(1, 1, item);
+}
--- /dev/null
+#ifndef _JOBLIST_H_
+#define _JOBLIST_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: joblist.h 4230 2007-02-21 20:07:37Z kerns $
+ *
+ * Kern Sibbald, January 2007
+ */
+
+#include <QtGui>
+#include "ui_joblist.h"
+#include "console.h"
+
+class JobList : public QWidget, public Ui::JobListForm
+{
+ Q_OBJECT
+
+public:
+ JobList(Console *console, QString &medianame );
+
+public slots:
+
+private:
+ Console *m_console;
+};
+
+#endif /* _JOBLIST_H_ */
--- /dev/null
+<ui version="4.0" >
+ <class>JobListForm</class>
+ <widget class="QWidget" name="JobListForm" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>621</width>
+ <height>460</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</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="QTableWidget" name="tableWidget" />
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
readSettings();
m_console->connect();
+ m_medialist->populateTree();
}
void MainWin::createPages()
bRestore *brestore = new bRestore(stackedWidget);
stackedWidget->addWidget(brestore);
- m_medialist = new MediaList(stackedWidget);
+ m_medialist = new MediaList(stackedWidget, m_console);
stackedWidget->addWidget(m_medialist);
/* Just take the first Director */
int index = item->data(column, Qt::UserRole).toInt();
if (index >= 0) {
stackedWidget->setCurrentIndex(index);
- if( index == 2 ){
- m_medialist->DoDisplay(m_console);
- }
}
}
--- /dev/null
+/*
+ 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.
+*/
+
+#include <QAbstractEventDispatcher>
+#include "bat.h"
+#include "mediaedit.h"
+#include <QTableWidgetItem>
+
+MediaEdit::MediaEdit(Console *console, QString &medianame)
+{
+ setupUi(this);
+ m_console = console;
+ tableWidget->clear();
+ tableWidget->setColumnCount(2);
+ tableWidget->setRowCount(5);
+ QTableWidgetItem* item = new QTableWidgetItem(medianame,1);
+ tableWidget->setItem(1, 1, item);
+}
--- /dev/null
+#ifndef _MEDIAEDIT_H_
+#define _MEDIAEDIT_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.
+*/
+
+#include <QtGui>
+#include "ui_mediaedit.h"
+#include "console.h"
+
+class MediaEdit : public QWidget, public Ui::MediaEdit
+{
+ Q_OBJECT
+
+public:
+ MediaEdit(Console *console, QString &medianame );
+
+public slots:
+
+private:
+ Console *m_console;
+
+};
+
+#endif /* _MEDIAEDIT_H_ */
--- /dev/null
+<ui version="4.0" >
+ <class>MediaEdit</class>
+ <widget class="QWidget" name="MediaEdit" >
+ <property name="geometry" >
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>540</width>
+ <height>421</height>
+ </rect>
+ </property>
+ <property name="windowTitle" >
+ <string>Form</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="QTableWidget" name="tableWidget" />
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
#include <QAbstractEventDispatcher>
#include "bat.h"
#include "medialist.h"
+#include "mediaedit/mediaedit.h"
+#include "joblist/joblist.h"
+#include <QMenu>
+//#include <QSize>
-MediaList::MediaList(QStackedWidget *parent)
+MediaList::MediaList(QStackedWidget *parent, Console *console)
{
setupUi(this);
parent->addWidget(this);
poollist = new QStringList();
m_treeWidget = treeWidget; /* our medialist screen */
+ m_console = console;
+ createConnections();
+ popupmedia="";
}
-void MediaList::DoDisplay(Console *console)
+void MediaList::populateTree()
{
int stat;
QTreeWidgetItem *mediatreeitem, *treeitem, *topItem;
- m_console = console;
-
m_treeWidget->clear();
m_treeWidget->setColumnCount(3);
topItem = new QTreeWidgetItem(m_treeWidget);
topItem->setText(0, "Pools");
+ topItem->setData(0, Qt::UserRole, 0);
+ topItem->setExpanded( true );
+ //topItem->setSizeHint(0,QSize(1050,50));
/* Start with a list of pools */
poollist->clear();
m_console->setTreeItem(treeitem);
poolitem->replace(QRegExp("\n"), "");
treeitem->setText(0, poolitem->toUtf8().data());
+ treeitem->setData(0, Qt::UserRole, 1);
+ treeitem->setExpanded( true );
/* iterate through the media in the pool */
QString *mcmd = new QString("sqlquery\n");
while ((stat=m_console->read()) > 0) {
*mediaread += m_console->msg();
}
+ m_console->discardToPrompt();
QStringList sqllinelist = mediaread->split("\n");
+ /* a regex todetermine if mediareadline is a line of interest. */
QRegExp regex("^\\|.*\\|$");
int recordcnter=0;
QStringList *headerlist = new QStringList();
if ( recorditemcnter == 0 ){
mediatreeitem = new QTreeWidgetItem(treeitem);
}
+ mediatreeitem->setData(recorditemcnter, Qt::UserRole, 2);
mediatreeitem->setText(recorditemcnter, trimmeditem.toUtf8().data());
}
recorditemcnter+=1;
m_treeWidget->setHeaderLabels(*headerlist);
}
}
+
+void MediaList::createConnections()
+{
+ connect(treeWidget, SIGNAL(itemPressed(QTreeWidgetItem *, int)), this,
+ SLOT(treeItemClicked(QTreeWidgetItem *, int)));
+ connect(treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this,
+ SLOT(treeItemDoubleClicked(QTreeWidgetItem *, int)));
+}
+
+void MediaList::treeItemClicked(QTreeWidgetItem *item, int column)
+{
+ int treedepth = item->data(column, Qt::UserRole).toInt();
+ QString text = item->text(0);
+ switch (treedepth){
+ case 1:
+ break;
+ case 2:
+ /* Can't figure out how to make a right button do this her Qt::LeftButton, Qt::RightButton, Qt::MidButton */
+ popupmedia = text;
+ QMenu *popup = new QMenu( m_treeWidget );
+ connect(popup->addAction("Edit Properties"), SIGNAL(triggered()), this, SLOT(editMedia()));
+ connect(popup->addAction("Show Jobs On Media"), SIGNAL(triggered()), this, SLOT(showJobs()));
+ popup->exec(QCursor::pos());
+ }
+}
+
+void MediaList::treeItemDoubleClicked(QTreeWidgetItem *item, int column)
+{
+ int treedepth = item->data(column, Qt::UserRole).toInt();
+ if (treedepth >= 0) {
+ }
+}
+
+void MediaList::editMedia()
+{
+ MediaEdit* edit = new MediaEdit(m_console, popupmedia);
+ edit->show();
+}
+
+void MediaList::showJobs()
+{
+ JobList* joblist = new JobList(m_console, popupmedia);
+ joblist->show();
+}
Q_OBJECT
public:
- MediaList(QStackedWidget *parent);
- void DoDisplay(Console *console);
+ MediaList(QStackedWidget *parent,Console *console);
+ void populateTree();
+
public slots:
+ void treeItemClicked(QTreeWidgetItem *item, int column);
+ void treeItemDoubleClicked(QTreeWidgetItem *item, int column);
+ void editMedia();
+ void showJobs();
+
+private:
+ void createConnections();
private:
Console *m_console;
QTreeWidget *m_treeWidget;
QStringList *poollist;
+ QString popupmedia;
};
#endif /* _MEDIALIST_H_ */