From d9338083192084613e5530b02710b796252d342b Mon Sep 17 00:00:00 2001 From: deva Date: Thu, 12 Aug 2010 10:57:04 +0000 Subject: New scripting system part2. --- client/widgets/window.cc | 45 +++++++++++++++------------------------------ 1 file changed, 15 insertions(+), 30 deletions(-) (limited to 'client/widgets/window.cc') diff --git a/client/widgets/window.cc b/client/widgets/window.cc index ea27321..f51cfd9 100644 --- a/client/widgets/window.cc +++ b/client/widgets/window.cc @@ -27,54 +27,39 @@ #include "window.h" #include "common.h" +#include #include Window::Window(QDomNode &node, MacroWindow *macrowindow) - : QWidget(NULL), Widget(node, macrowindow) + : Widget(node, macrowindow) { - setWindowFlags(Qt::WindowContextHelpButtonHint | Qt::WindowSystemMenuHint); + widget = new QWidget(NULL); - setWindowIcon(QIcon(":/icons/icon.png")); + widget->setWindowFlags(Qt::WindowContextHelpButtonHint | + Qt::WindowSystemMenuHint); - setCommonAttributes(this, node); - setCommonLayout(this, node); + widget->setWindowIcon(QIcon(":/icons/icon.png")); + + setCommonAttributes(widget, node); + setCommonLayout(widget, node); QDomElement elem = node.toElement(); if(elem.hasAttribute("fixed")) { if(elem.attribute("fixed") == "true") { - setFixedSize(width(), height()); + widget->setFixedSize(widget->width(), widget->height()); } } if(elem.hasAttribute("caption")) { - setWindowTitle(elem.attribute("caption")); + widget->setWindowTitle(elem.attribute("caption")); } -} - -void Window::connectFrom(const char *signal, - const QObject *receiver, const char *method) -{ - connect(this, signal, receiver, method); -} - -void Window::connectTo(const QObject *sender, const char *signal, - const char *method) -{ - connect(sender, signal, this, method); -} - -void Window::enable() -{ - setEnabled(true); -} -void Window::disable() -{ - setEnabled(false); + addChildren(node); } -bool Window::isDisabled() +Window::~Window() { - return isEnabled() == false; + printf("Delete (Window) %p\n", this); fflush(stdout); + // delete widget; } -- cgit v1.2.3