summaryrefslogtreecommitdiff
path: root/client/macrowindow.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/macrowindow.cc')
-rw-r--r--client/macrowindow.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/client/macrowindow.cc b/client/macrowindow.cc
index ca76b46..d96facb 100644
--- a/client/macrowindow.cc
+++ b/client/macrowindow.cc
@@ -37,6 +37,7 @@
#include "widgets/window.h"
#include "lua.h"
#include "mainwindow.h"
+#include "macrodrawer.h"
#include "debug.h"
@@ -47,9 +48,11 @@ extern QString user;
MacroWindow::MacroWindow(NetCom &n, QString templ,
bool is_static, bool compact,
- QScrollArea *scrollarea)
+ QScrollArea *scrollarea,
+ MacroDrawer *d)
: Collapser(NULL, compact?NULL:scrollarea), netcom(n)
{
+ drawer = d;
this->is_static = is_static;
DEBUG(macrowindow, "Constructor %p\n", this);
@@ -267,6 +270,7 @@ void MacroWindow::clear()
if(mainwidget) {
delete mainwidget;
mainwidget = NULL;
+ drawer->setFocus();
}
}
@@ -283,15 +287,20 @@ void MacroWindow::animated(QWidget *w)
waschanged = false;
mainwidget->setValues();
+ if(is_static) return;
+
+ printf("SetFocus:\n");
// Set keyboard focus on the first focusable widget in the macro.
QVector< Widget* > widgets;
widgets = mainwidget->widgetList(true);
QVector< Widget* >::iterator i = widgets.begin();
while(i != widgets.end()) {
Widget *w = *i;
+ if(w) {
+ printf("\t%s\n", w->type().toStdString().c_str());
+ }
if(w && w->setKeyboardFocus()) break;
i++;
}
-
}
}