summaryrefslogtreecommitdiff
path: root/client/mainwindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r--client/mainwindow.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/client/mainwindow.cc b/client/mainwindow.cc
index 50ca8a9..efd4c31 100644
--- a/client/mainwindow.cc
+++ b/client/mainwindow.cc
@@ -80,20 +80,24 @@ void MainWindow::update()
if(xml_elem.hasAttribute("name")) macroname = xml_elem.attribute("name");
if(macros.find(macroname) == macros.end()) {
- macros[macroname] = new MacroWindow(netcom, macronode, course);
-
+ bool isstatic = false;
+ if(xml_elem.attribute("static", "false") == "true") isstatic = true;
+ macros[macroname] = new MacroWindow(netcom, macronode, course, !isstatic);
+
QGroupBox *g = new QGroupBox(" " + xml_elem.attribute("caption", macroname));
g->setCheckable(false);
g->setChecked(false);
+ ((QBoxLayout*)w->layout())->addWidget(g);
- QPushButton *b = new QPushButton(">>", g);
- b->setFixedSize(16,16);
- b->show();
- b->move(0,0);
+ if(!isstatic) {
+ QPushButton *b = new QPushButton(">>", g);
+ b->setFixedSize(16,16);
+ b->show();
+ b->move(0,0);
- connect(b, SIGNAL(clicked()), this, SLOT(closeAll()));
- connect(b, SIGNAL(clicked()), macros[macroname], SLOT(toggleMacro()));
- ((QBoxLayout*)w->layout())->addWidget(g);
+ connect(b, SIGNAL(clicked()), this, SLOT(closeAll()));
+ connect(b, SIGNAL(clicked()), macros[macroname], SLOT(toggleMacro()));
+ }
QHBoxLayout *l = new QHBoxLayout();
l->setContentsMargins(10,0,10,0);
@@ -105,7 +109,9 @@ void MainWindow::update()
} else {
macros[macroname]->update(macronode);
- macros[macroname]->setCollapsed(true);
+ if(xml_elem.attribute("static", "false") == "false") {
+ macros[macroname]->setCollapsed(true);
+ }
}
}