- Possibly some other things I didn't think of.
+===========================================================
+NOT SURE
+===========================================================
+
+I'm not sure about this one?? Things seem to work and I did not do a
+thing to make it happen: the "dir" is a member of Console
+
+- We also must somehow make the low level I/O routines know which
+director/console to use. Currently they always use the single
+global one defined in the mainWin class (if I remember right).
+
+
+============================================================
+DONE:
+============================================================
Another idea for what you have implemented:
- I think that the dynamic pages that you create on the fly
should be nested under the item that creates them more like a
make for a cleaner user experience. I like it. It could save the
effort of getting a tabbed widget to work.
-===========================================================
-NOT SURE
-===========================================================
-
-I'm not sure about this one?? Things seem to work and I did not do a
-thing to make it happen: the "dir" is a member of Console
-
-- We also must somehow make the low level I/O routines know which
-director/console to use. Currently they always use the single
-global one defined in the mainWin class (if I remember right).
-
-
-============================================================
-DONE:
-============================================================
- I think we need to make the current Director more explicit, by
perhaps highlighting it in the page selector when it is current
void Clients::showJobs()
{
QString emptymedia("");
- mainWin->createPageJobList(emptymedia, m_currentlyselected);
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ mainWin->createPageJobList(emptymedia, m_currentlyselected, parentItem);
}
/*
/*
* Constructor for the class
*/
-JobList::JobList(QString &medianame, QString &clientname)
+JobList::JobList(QString &medianame, QString &clientname,
+ QTreeWidgetItem *parentTreeWidgetItem)
{
setupUi(this);
m_medianame = medianame;
m_clientname = clientname;
- pgInitialize();
+ pgInitialize(parentTreeWidgetItem);
m_resultCount = 0;
m_populated = false;
m_closeable = false;
Q_OBJECT
public:
- JobList(QString &medianame, QString &clientname);
+ JobList(QString &medianame, QString &clientname, QTreeWidgetItem *);
virtual void PgSeltreeWidgetClicked();
virtual void currentStackItem();
int m_resultCount;
}
m_currentConsole = (Console*)getFromHash(m_firstItem);
treeWidget->setCurrentItem(getFromHash(m_currentConsole));
- DIRRES* dirres = m_currentConsole->getDirRes();
- printf("Setting initial window to %s\n", dirres->name());
+ /*
+ * I'd like to turn this into a debug item
+ * DIRRES* dirres = m_currentConsole->getDirRes();
+ * printf("Setting initial window to %s\n", dirres->name());
+ */
}
void MainWin::createPages()
createPagebRestore();
createPageMediaList();
QString emptymedia(""), emptyclient("");
- createPageJobList(emptymedia, emptyclient);
+ createPageJobList(emptymedia, emptyclient, NULL);
createPageClients();
treeWidget->expandItem(topItem);
/*
* create an instance of the the joblist class on the stack
*/
-void MainWin::createPageJobList(QString &media, QString &client)
+void MainWin::createPageJobList(QString &media, QString &client,
+ QTreeWidgetItem *parentTreeWidgetItem)
{
QTreeWidgetItem *item, *holdItem;
/* save current tree widget item in case query produces no results */
holdItem = treeWidget->currentItem();
- JobList* joblist = new JobList(media, client);
+ JobList* joblist = new JobList(media, client, parentTreeWidgetItem);
joblist->dockPage();
/* If this is a query of jobs on a specific media */
if ((media != "") || (client != "")) {
QHash<Pages*,QTreeWidgetItem*> m_widgethash;
/* This is a list of consoles */
QHash<QTreeWidgetItem*,Console*> m_consoleHash;
- void createPageJobList(QString &, QString &);
+ void createPageJobList(QString &, QString &, QTreeWidgetItem *);
public slots:
void input_line();
void MediaList::showJobs()
{
QString emptyclient("");
- mainWin->createPageJobList(m_currentlyselected, emptyclient);
+ QTreeWidgetItem *parentItem = mainWin->getFromHash(this);
+ mainWin->createPageJobList(m_currentlyselected, emptyclient, parentItem);
}
/*
}
/*
- * Function to set members from the external mainwin
+ * Function to set members from the external mainwin and it's overload being
+ * passed a specific QTreeWidgetItem to be it's parent on the tree
*/
void Pages::pgInitialize()
+{
+ pgInitialize(NULL);
+}
+
+void Pages::pgInitialize(QTreeWidgetItem *parentTreeWidgetItem)
{
m_parent = mainWin->stackedWidget;
m_console = mainWin->currentConsole();
- QTreeWidgetItem *parentTreeWidgetItem = m_console->directorTreeItem();
+
+ if (!parentTreeWidgetItem) {
+ parentTreeWidgetItem = m_console->directorTreeItem();
+ }
QTreeWidgetItem *item = new QTreeWidgetItem(parentTreeWidgetItem);
QString name;
protected:
void pgInitialize();
+ void pgInitialize(QTreeWidgetItem *);
bool m_closeable;
bool m_docked;
virtual void treeWidgetName(QString &);