diff options
author | deva <deva> | 2008-09-22 12:21:14 +0000 |
---|---|---|
committer | deva <deva> | 2008-09-22 12:21:14 +0000 |
commit | 355772289f57522157759b6150ebfd2cc849c0ae (patch) | |
tree | e8cbecdf03e8d627d0a7d902422f7f9684f47e90 /client/mainwindow.cc | |
parent | 64f5bc46a4925da459704092e884e747ccbc544c (diff) |
Made the client use the static attribute to set a macro always visible, non-collapsable. Made the macro widgetlist clear itself when loading a new macro.
Diffstat (limited to 'client/mainwindow.cc')
-rw-r--r-- | client/mainwindow.cc | 26 |
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); + } } } |