readSettings();
m_console->connect();
- m_medialist->populateTree();
}
void MainWin::createPages()
/* Create console tree stacked widget item */
m_console = new Console(stackedWidget);
- /* Console is special needs director*/
+ /* Console is special -> needs director*/
/* Just take the first Director */
LockRes();
dir = (DIRRES *)GetNextRes(R_DIRECTOR, NULL);
/* All should be
* 1. create tree widget item
* 2. create object passing pointer to tree widget item (modified constructors to pass QTreeWidget pointers)
- * 3. append to stacklist */
+ * 3. append to stacklist
+ * And it can even be done in one line.
+ * */
/* brestore */
- item = createPage("brestore", topItem);
- m_brestore = new bRestore(stackedWidget,item);
- m_bstacklist.append(m_brestore);
+ m_bstacklist.append(new bRestore( stackedWidget, createPage("brestore", topItem) ));
/* lastly for now, the medialist */
- item = createPage("Storage Tree", topItem );
- m_medialist = new MediaList(stackedWidget, m_console, item);
- m_bstacklist.append(m_medialist);
+ m_bstacklist.append(new MediaList(stackedWidget, m_console, createPage("Storage Tree", topItem )));
/* Iterate through and add to the stack */
for ( QList<BatStack*>::iterator bstackItem = m_bstacklist.begin(); bstackItem != m_bstacklist.end(); ++bstackItem ) {
if( stackindex >= 0 ){
stackedWidget->setCurrentIndex(stackindex);
}
+ (*bstackItem)->PgSeltreeWidgetClicked();
}
++bstackItem;
}
} else {
(*bstackItem)->Togglestack();
}
+ (*bstackItem)->PgSeltreeWidgetDoubleClicked();
}
++bstackItem;
}
m_treeItem = treeItem;
createConnections();
m_popupmedia="";
+ m_populated=false;
}
void MediaList::populateTree()
JobList* joblist = new JobList(m_console, m_popupmedia);
joblist->show();
}
+
+void MediaList::PgSeltreeWidgetClicked()
+{
+ printf("PgSeltreeWidgetClicked\n");
+ if( ! m_populated ){
+ populateTree();
+ m_populated=true;
+ }
+}
+
+void MediaList::PgSeltreeWidgetDoubleClicked()
+{
+ printf("PgSeltreeWidgetDoubleClicked\n");
+ populateTree();
+}
public:
MediaList(QStackedWidget *parent,Console *console, QTreeWidgetItem *treeItem);
void populateTree();
+ virtual void PgSeltreeWidgetClicked();
+ virtual void PgSeltreeWidgetDoubleClicked();
public slots:
void treeItemClicked(QTreeWidgetItem *item, int column);
QTreeWidget *m_treeWidget;
QStringList *m_poollist;
QString m_popupmedia;
+ bool m_populated;
//QStackedWidget *m_parent;
};