diff options
author | deva <deva> | 2010-08-13 13:53:59 +0000 |
---|---|---|
committer | deva <deva> | 2010-08-13 13:53:59 +0000 |
commit | 836ab03e9bdc442bbe8b414007dae294153a748a (patch) | |
tree | ee9035925e006bf5181e3679790708b022b80cad /client/macrowindow.cc | |
parent | 843221d0826ed0a53a94e84772f89c482f80776a (diff) |
Make validation run deep (or not).
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r-- | client/macrowindow.cc | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc index 6588416..4513483 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -42,9 +42,8 @@ extern QString user; extern QString host; extern quint16 port; -#define DEBUG(fmt...) printf("MacroWindow (%p)", this); \ - printf(fmt); fflush(stdout) -//#define DEBUG(ftm...) +//#define DEBUG(fmt...) printf("MacroWindow (%p)",this);printf(fmt);fflush(stdout) +#define DEBUG(ftm...) MacroWindow::MacroWindow(NetCom &n, QDomNode &xml_doc, QString templ, bool collapsed, bool compact) @@ -116,21 +115,21 @@ void MacroWindow::initMacro(QDomNode &node) } else if(elem.tagName() == "widgets") { if(mainwidget) { - DEBUG("ERROR!!!!!!\n\tmainwidget already exists!\n"); + DEBUG("WARNING: mainwidget already exists! Calling clear().\n"); + clear(); } Window *window = new Window(elem, this); connect(window, SIGNAL(wasChanged()), this, SLOT(macroChanged())); macrotitle = elem.attribute("caption"); - clear(); mainwidget = window; mainwidget->setValues(); if(waschanged == true) macroChanged(); - return; // No further recursion. + return; // No further recursion here. } QDomNodeList children = node.childNodes(); @@ -145,7 +144,8 @@ void MacroWindow::initMacro(QDomNode &node) bool MacroWindow::doCommit() { if(mainwidget->valid()) { - QVector< Widget* > wlist = mainwidget->widgetList(); + QVector< Widget* > wlist; + if(mainwidget) wlist = mainwidget->widgetList(); QDomDocument doc = netcom.send(wlist, templ, macro, version); QDomNodeList nl = doc.documentElement().childNodes(); @@ -223,7 +223,8 @@ void MacroWindow::expandWrapper() expand(); // Set keyboard focus on the first focusable widget in the macro. - QVector< Widget* > widgets = mainwidget->widgetList(true); + QVector< Widget* > widgets; + if(mainwidget) widgets = mainwidget->widgetList(true); QVector< Widget* >::iterator i = widgets.begin(); while (i != widgets.end()) { if(*i) { @@ -242,7 +243,7 @@ void MacroWindow::collapseWrapper() if(waschanged) { switch(MessageBox::warning(NULL, "Gem ændringerne i makroen?", - "Du har valgt at ukke makroen " + + "Du har valgt at lukke makroen " + macrotitle + ".\n" "Ønsker du at gemme inden du lukker?", MessageBox::Save | MessageBox::Close | |