diff options
author | deva <deva> | 2011-03-03 10:58:24 +0000 |
---|---|---|
committer | deva <deva> | 2011-03-03 10:58:24 +0000 |
commit | 25508b5eeffc3345c0faab80ae05a0f2c663eb66 (patch) | |
tree | 28fcf30dc55dec91e519d1bcb3f0de4319bf51b5 /client/macrowindow.cc | |
parent | dc5075774cd0e746f6d2e324c96af36806e847d4 (diff) |
Spring cleaning...
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r-- | client/macrowindow.cc | 33 |
1 files changed, 11 insertions, 22 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc index 16f86f9..f38245e 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -61,9 +61,12 @@ MacroWindow::MacroWindow(NetCom &n, QDomNode &xml_doc, QString templ, this->templ = templ; - setCollapsedWidget(new ResumeWidget(compact)); + resumewidget = new ResumeWidget(compact); + setCollapsedWidget(resumewidget); - update(xml_doc); + // update(xml_doc); + initMacro(xml_doc); + if(mainwidget) setExpandedWidget(mainwidget->qwidget()); setCollapsed(!is_static); active = true; @@ -74,11 +77,12 @@ MacroWindow::MacroWindow(NetCom &n, QDomNode &xml_doc, QString templ, MacroWindow::~MacroWindow() { clear(); - delete collapsedWidget(); + delete resumewidget; } void MacroWindow::update(QDomNode &node) { + /* if(is_static || mainwidget == NULL) { clear(); lua->clear(); @@ -88,7 +92,7 @@ void MacroWindow::update(QDomNode &node) if(mainwidget) setExpandedWidget(mainwidget->qwidget()); else setExpandedWidget(NULL); } - + */ updateResume(node); } @@ -109,7 +113,7 @@ void MacroWindow::updateResume(QDomNode &node) collapse(); } */ - ((ResumeWidget*)collapsedWidget())->setText(resume, state); + resumewidget->setText(resume, state); updateHeight(); return; @@ -137,21 +141,7 @@ void MacroWindow::initMacro(QDomNode &node) } else if(elem.tagName() == "scripts") { // Nothing to do here } else if(elem.tagName() == "resume") { - /* // Handled in updateResume - QString resume = elem.text(); - ResumeWidget::state_t state = ResumeWidget::OLD; - if(elem.hasAttribute("state")) { - if(elem.attribute("state") == "old") state = ResumeWidget::OLD; - if(elem.attribute("state") == "new") state = ResumeWidget::NEW; - if(elem.attribute("state") == "dirty") state = ResumeWidget::DIRTY; - } - - if(!mainwidget) { // Only call collapse if the macro is in resume state. - //collapse(); - } - - ((ResumeWidget*)collapsedWidget())->setText(resume, state); - */ + // Handled in updateResume } else if(elem.tagName() == "script") { lua->runScript(elem.text(), NULL, "preload"); @@ -210,9 +200,8 @@ bool MacroWindow::doCommit() qApp->processEvents(); - collapse(); + setCollapsed(true); emit updateOnCommit(); - // setCollapsed(true); return true; } else { |