dhb
====================================================
+Must:: get page selector to follow undocked windows. Otherwise
+current console won't be current.
+
Low priority item:
move behavior of:
MainWin::setContextMenuDockText
Create list of what does not work.
-Ask Kern about bRestore and what to do with it in terms of priorities.
+Ask Kern about bRestore and what to do with it in terms of priorities. Should
+that be working before an initial release.
-Fix bug in myt box not working with .sql query="" command.
+Fix bug in myth box not working with .sql query="" command.
Create documentation for any other developers interested in creating
new classes to add more pages. Explain how to use the pages class
Think about good ways to clean up the Console creation part of the
loop creating pages.
-Remove DoubleClicking, not needed any more.
+Font is being set on a per console basis, should it be.
+Tried to get the settings to write for a second, but not coming up next time
+
========================================================
- Possibly some other things I didn't think of.
-Things to do:
-- When any director is clicked, we need to set it as the current
-director and set the current console as well.
-
- I think we need to make the current Director more explicit, by
perhaps highlighting it in the page selector when it is current
and unhighlighting it when it is not (we could use color as we do
============================================================
DONE:
============================================================
+Things to do:
+- When any director is clicked, we need to set it as the current
+director and set the current console as well.
+
+Remove DoubleClicking, From pages class not needed any more.
Broken with multiple directors:
- If you click on the second director, it will probably open, but
readSettings();
- foreach(Console *console, m_consoleList){
+ bool first = true;
+ foreach(Console *console, m_consoleHash){
console->connect();
+ if (first) {
+ m_currentConsole = console;
+ treeWidget->setCurrentItem(getFromHash(console));
+ first = false;
+ }
}
}
void MainWin::createPages()
{
DIRRES *dir;
- QTreeWidgetItem *item, *topItem;
+ QTreeWidgetItem *item, *topItem, *firstItem;
+ firstItem = NULL;
LockRes();
foreach_res(dir, R_DIRECTOR) {
/* Create console tree stacked widget item */
m_currentConsole = new Console(stackedWidget);
- m_consoleList.append(m_currentConsole);
m_currentConsole->setDirRes(dir);
+ m_currentConsole->readSettings();
/* The top tree item representing the director */
topItem = createTopPage(dir->name());
topItem->setIcon(0, QIcon(QString::fromUtf8("images/server.png")));
m_currentConsole->setDirectorTreeItem(topItem);
+ m_consoleHash.insert(topItem, m_currentConsole);
/* Create Tree Widget Item */
item = createPage("Console", topItem);
+ if (!firstItem){
+ firstItem = item;
+ }
/* insert the cosole and tree widget item into the hashes */
hashInsert(item, m_currentConsole);
stackedWidget->setCurrentWidget(m_currentConsole);
}
UnlockRes();
- m_currentConsole = m_consoleList[0];
- item = getFromHash(m_currentConsole);
- treeWidget->setCurrentItem(item);
}
/*
/* Connect signals to slots */
connect(lineEdit, SIGNAL(returnPressed()), this, SLOT(input_line()));
connect(actionAbout_bat, SIGNAL(triggered()), this, SLOT(about()));
-
-#ifdef xxx
- connect(treeWidget, SIGNAL(itemActivated(QTreeWidgetItem *, int)), this,
- SLOT(treeItemClicked(QTreeWidgetItem *, int)));
- connect(treeWidget, SIGNAL(itemPressed(QTreeWidgetItem *, int)), this,
- SLOT(treeItemClicked(QTreeWidgetItem *, int)));
-#endif
connect(treeWidget, SIGNAL(itemClicked(QTreeWidgetItem *, int)), this,
SLOT(treeItemClicked(QTreeWidgetItem *, int)));
- connect(treeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this,
- SLOT(treeItemDoubleClicked(QTreeWidgetItem *, int)));
connect(treeWidget, SIGNAL(
currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(treeItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)));
connect(stackedWidget, SIGNAL(currentChanged(int)),
this, SLOT(stackItemChanged(int)));
-
connect(actionQuit, SIGNAL(triggered()), app, SLOT(closeAllWindows()));
- foreach(Console *console, m_consoleList){
- connect(actionConnect, SIGNAL(triggered()), console, SLOT(connect()));
- connect(actionStatusDir, SIGNAL(triggered()), console, SLOT(status_dir()));
- connect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
- }
connect(actionLabel, SIGNAL(triggered()), this, SLOT(labelDialogClicked()));
connect(actionRun, SIGNAL(triggered()), this, SLOT(runDialogClicked()));
connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreDialogClicked()));
void MainWin::closeEvent(QCloseEvent *event)
{
writeSettings();
- foreach(Console *console, m_consoleList){
+ foreach(Console *console, m_consoleHash){
console->writeSettings();
console->terminate();
}
}
}
-/*
- * This subroutine is called with an item in the Page Selection window
- * is double clicked
- */
-/* This could be removed from here and from pages and from medialist
- * Do you agree dhb */
-void MainWin::treeItemDoubleClicked(QTreeWidgetItem *item, int /*column*/)
-{
- Pages* page = getFromHash(item);
- page->PgSeltreeWidgetDoubleClicked();
-}
-
/*
* Called with a change of the highlighed tree widget item in the page selector.
*/
void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *previousitem)
{
+ Pages* page;
+ Console* console;
/* The Previous item */
if (previousitem) {
+ /* knowing the treeWidgetItem, get the page from the hash */
+ page = getFromHash(previousitem);
+ console = m_consoleHash.value(previousitem);
+ if (page) {
+ console = page->console();
+ } else if (console) {
+ page = console;
+ }
+ /* make connections to the current console */
+ disconnect(actionConnect, SIGNAL(triggered()), console, SLOT(connect()));
+ disconnect(actionStatusDir, SIGNAL(triggered()), console, SLOT(status_dir()));
+ disconnect(actionSelectFont, SIGNAL(triggered()), console, SLOT(set_font()));
/* make sure the close window and toggle dock options are removed */
treeWidget->removeAction(actionClosePage);
treeWidget->removeAction(actionToggleDock);
/* Is this a page that has been inserted into the hash */
- if (getFromHash(previousitem)) {
- Pages* page = getFromHash(previousitem);
+ if (page) {
foreach(QAction* pageaction, page->m_contextActions) {
treeWidget->removeAction(pageaction);
}
}
}
+ /* knowing the treeWidgetItem, get the page from the hash */
+ page = getFromHash(currentitem);
+ console = m_consoleHash.value(currentitem);
/* Is this a page that has been inserted into the hash */
- if (getFromHash(currentitem)) {
- /* knowing the treeWidgetItem, get the page from the hash */
- Pages* page = getFromHash(currentitem);
- /* set the value for the currently active console */
+ if (page) {
m_currentConsole = page->console();
+ } else if (console) {
+ m_currentConsole = console;
+ page = console;
+ }
+ if ((page) || (console)) {
+ /* make connections to the current console */
+ connect(actionConnect, SIGNAL(triggered()), m_currentConsole, SLOT(connect()));
+ connect(actionSelectFont, SIGNAL(triggered()), m_currentConsole, SLOT(set_font()));
+ connect(actionStatusDir, SIGNAL(triggered()), m_currentConsole, SLOT(status_dir()));
+ /* set the value for the currently active console */
int stackindex = stackedWidget->indexOf(page);
/* Is this page currently on the stack */