#include "restore/restoretree.h"
#include "help/help.h"
#include "jobs/jobs.h"
+#include "jobgraphs/jobplot.h"
/*
* Daemon message callback
MainWin::MainWin(QWidget *parent) : QMainWindow(parent)
{
+ m_isClosing = false;
m_dtformat = "yyyy-MM-dd HH:mm:ss";
mainWin = this;
setupUi(this); /* Setup UI defined by main.ui (designer) */
new MediaList();
new Storage();
new restoreTree();
+ JobPlotPass pass;
+ pass.use = false;
+ new JobPlot(NULL, pass);
treeWidget->expandItem(topItem);
stackedWidget->setCurrentWidget(m_currentConsole);
connect(actionRun, SIGNAL(triggered()), this, SLOT(runButtonClicked()));
connect(actionEstimate, SIGNAL(triggered()), this, SLOT(estimateButtonClicked()));
connect(actionBrowse, SIGNAL(triggered()), this, SLOT(browseButtonClicked()));
+ connect(actionJobPlot, SIGNAL(triggered()), this, SLOT(jobPlotButtonClicked()));
connect(actionRestore, SIGNAL(triggered()), this, SLOT(restoreButtonClicked()));
connect(actionUndock, SIGNAL(triggered()), this, SLOT(undockWindowButton()));
connect(actionToggleDock, SIGNAL(triggered()), this, SLOT(toggleDockContextWindow()));
*/
void MainWin::closeEvent(QCloseEvent *event)
{
+ m_isClosing = true;
writeSettings();
+ /* close all non console pages, this will call settings in destructors */
+ foreach(Pages *page, m_pagehash) {
+ if (page != page->console()) {
+ page->console()->setCurrent();
+ page->closeStackPage();
+ }
+ }
+ /* close the console pages and terminate connection */
foreach(Console *console, m_consoleHash){
console->writeSettings();
console->terminate();
+ console->closeStackPage();
}
event->accept();
- foreach(Pages *page, m_pagehash) {
- if (!page->isDocked())
- page->close();
- }
}
void MainWin::writeSettings()
*/
void MainWin::treeItemChanged(QTreeWidgetItem *currentitem, QTreeWidgetItem *previousitem)
{
+ if (m_isClosing) return; /* if closing the application, do nothing here */
+
Pages *previousPage, *nextPage;
Console *previousConsole, *nextConsole;
void MainWin::runButtonClicked()
{
- new runPage();
+ new runPage("");
}
void MainWin::estimateButtonClicked()
new prerestorePage();
}
+void MainWin::jobPlotButtonClicked()
+{
+ JobPlotPass pass;
+ pass.use = false;
+ new JobPlot(NULL, pass);
+}
+
/*
* The user just finished typing a line in the command line edit box
*/
QString cmdStr = lineEdit->text(); /* Get the text */
lineEdit->clear(); /* clear the lineEdit box */
if (m_currentConsole->is_connected()) {
- m_currentConsole->consoleCommand(cmdStr);
+ /* Use consoleInput to allow typing anything */
+ m_currentConsole->consoleInput(cmdStr);
} else {
set_status("Director not connected. Click on connect button.");
}
*/
void MainWin::stackItemChanged(int)
{
+ if (m_isClosing) return; /* if closing the application, do nothing here */
Pages* page = (Pages*)stackedWidget->currentWidget();
/* run the virtual function in case this class overrides it */
page->currentStackItem();