summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
authordeva <deva>2009-06-30 17:31:53 +0000
committerdeva <deva>2009-06-30 17:31:53 +0000
commit9a773bc9ed736301b5ac6f6f8798056194398011 (patch)
treea113908743936aea97975adb6f4f1c7f49e6b007 /client/macrowindow.cc
parentb31e7fba17d1e5c1264c0829c4da258c32aa80c3 (diff)
Removed console on win32 unless, compiled in debug mode. First attempt on a macro dependency system.
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r--client/macrowindow.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc
index e3e3bac..db6ad53 100644
--- a/client/macrowindow.cc
+++ b/client/macrowindow.cc
@@ -44,14 +44,13 @@ extern QString user;
extern QString host;
extern quint16 port;
-MacroWindow::MacroWindow(NetCom *netcom, QDomNode &xml_doc, QString course,
+MacroWindow::MacroWindow(NetCom &n, QDomNode &xml_doc, QString course,
bool collapsed, bool compact)
- : Collapser()
+ : Collapser(), netcom(n)
{
waschanged = false;
this->course = course;
- this->netcom = netcom;
setCollapsedWidget(new ResumeWidget(compact));
@@ -60,6 +59,7 @@ MacroWindow::MacroWindow(NetCom *netcom, QDomNode &xml_doc, QString course,
update(xml_doc);
setCollapsed(collapsed);
+ active = true;
}
MacroWindow::~MacroWindow()
@@ -149,7 +149,7 @@ bool MacroWindow::doCommit()
// If all entries passed validation, continue commit
if(faulty == 0) {
- netcom->send(widgets, course, macro, version);
+ netcom.send(widgets, course, macro, version);
emit updateOnCommit();
setCollapsed(true);
return true;
@@ -305,7 +305,7 @@ void MacroWindow::expandWrapper()
luaprograms.clear();
waschanged = false;
- QDomDocument xml_doc = netcom->send(course, macro);
+ QDomDocument xml_doc = netcom.send(course, macro);
//
// TODO: This is where the dependency checking should occur.
@@ -380,6 +380,7 @@ void MacroWindow::collapseWrapper()
void MacroWindow::toggleMacro()
{
+ if(!active) return;
if(isCollapsed()) {
expandWrapper();
} else {
@@ -393,3 +394,13 @@ void MacroWindow::macroChanged()
emit macroHasChanged();
waschanged = true;
}
+
+void MacroWindow::setActive(bool active)
+{
+ if(this->active == active) return;
+
+ this->active = active;
+ if(active == false) setEnabled(false);
+ else setEnabled(true);
+ emit activationChanged(active);
+}