summaryrefslogtreecommitdiff
path: root/client/macro.cc
diff options
context:
space:
mode:
authordeva <deva>2009-07-03 11:59:24 +0000
committerdeva <deva>2009-07-03 11:59:24 +0000
commit82c32c05eb4741e98736099c456b3ffc93c755af (patch)
tree4d68d0a1d79e3f1821a541c3f50060c80d89953f /client/macro.cc
parentcca848759185ced5826194a7bbf4932881aee224 (diff)
Some tweaking in the new dependency system. Mostly GUI stuff.
Diffstat (limited to 'client/macro.cc')
-rw-r--r--client/macro.cc38
1 files changed, 27 insertions, 11 deletions
diff --git a/client/macro.cc b/client/macro.cc
index 650a352..7a4cb89 100644
--- a/client/macro.cc
+++ b/client/macro.cc
@@ -29,7 +29,7 @@
#include <QDomElement>
#include <QHBoxLayout>
-
+#include <QApplication>
#include "macrodrawer.h"
Macro::Macro(QDomNode &n)
@@ -89,16 +89,30 @@ void Macro::init(QBoxLayout *layout, Macros &macros, bool initialising, NetCom &
if(window == NULL) {
window = new MacroWindow(netcom, node, course, !isstatic, iscompact);
- MacroDrawer *g = new MacroDrawer(this, xml_elem.attribute("caption", name));
- g->connect(g, SIGNAL(toggle()), window, SLOT(toggleMacro()));
- g->connect(window, SIGNAL(activationChanged(bool)), g, SLOT(activationChange(bool)));
+ /*
+ QWidget *edge = new QWidget();
+ edge->setContentsMargins(1,1,1,1);
+ edge->setAutoFillBackground(true);
+ edge->setAttribute(Qt::WA_WindowPropagation, true);
+ QHBoxLayout *edgelayout = new QHBoxLayout();
+ edgelayout->setContentsMargins(0,0,0,0);
+ edge->setLayout(edgelayout);
+ layout->addWidget(edge);
+ */
+
+ drawer = new MacroDrawer(this, xml_elem.attribute("caption", name), NULL/*edge*/);
+ drawer->connect(drawer, SIGNAL(toggle()), window, SLOT(toggleMacro()));
+ drawer->connect(window, SIGNAL(activationChanged(bool)), drawer, SLOT(activationChange(bool)));
+ //drawer->setAutoFillBackground(true);
+ //drawer->setContentsMargins(1,1,1,1);
window->setActive(false);
-
- layout->addWidget(g);
+ //drawer->setPalette(QApplication::palette());
+ //edge->layout()->addWidget(g);
+ layout->addWidget(drawer);
QHBoxLayout *l = new QHBoxLayout();
l->setContentsMargins(10,0,10,0);
- g->setLayout(l);
+ drawer->setLayout(l);
l->addWidget(window);
{
QFont f = window->font();
@@ -116,22 +130,24 @@ void Macro::init(QBoxLayout *layout, Macros &macros, bool initialising, NetCom &
}
QStringList::iterator rs = requires.begin();
+ QStringList blocking;
bool active = true;
while(rs != requires.end()) {
- printf("Testing if %s is completed...", rs->toStdString().c_str());
+ // printf("Testing if %s is completed...", rs->toStdString().c_str());
Macros::iterator ms = macros.begin();
while(ms != macros.end()) {
if(ms->name == *rs) {
- printf("Found it %d", ms->iscompleted);
+ // printf("Found it %d", ms->iscompleted);
+ if(ms->iscompleted == false) blocking.append(ms->name);
active = active && ms->iscompleted;
}
ms++;
}
- printf("\n");
+ // printf("\n");
rs++;
}
window->setActive(active);
-
+ if(!active) drawer->setToolTip(QObject::tr("Depends on: ") + blocking.join(", "));
}