summaryrefslogtreecommitdiff
path: root/client/widgets
diff options
context:
space:
mode:
authorsenator <senator>2007-08-22 10:23:33 +0000
committersenator <senator>2007-08-22 10:23:33 +0000
commit47750e70ba9171c10e32a1033b68ae2b614799fa (patch)
tree5b799493a9d2941ba26e540570a4121b764b950a /client/widgets
parent50496c06eebb902d75e13667da0d87c9f454424a (diff)
name have moved to widget in all classes. combobox is a dummy so far
Diffstat (limited to 'client/widgets')
-rw-r--r--client/widgets/checkbox.cc10
-rw-r--r--client/widgets/checkbox.h2
-rw-r--r--client/widgets/combobox.cc4
-rw-r--r--client/widgets/combobox.h5
-rw-r--r--client/widgets/frame.cc20
-rw-r--r--client/widgets/frame.h2
-rw-r--r--client/widgets/label.cc14
-rw-r--r--client/widgets/lineedit.cc10
-rw-r--r--client/widgets/pushbutton.cc10
-rw-r--r--client/widgets/radiobutton.cc10
-rw-r--r--client/widgets/radiobutton.h2
-rw-r--r--client/widgets/textedit.cc10
-rw-r--r--client/widgets/widget.cc12
-rw-r--r--client/widgets/widget.h2
-rw-r--r--client/widgets/window.cc10
-rw-r--r--client/widgets/window.h2
16 files changed, 58 insertions, 67 deletions
diff --git a/client/widgets/checkbox.cc b/client/widgets/checkbox.cc
index c04b104..1bb1cfe 100644
--- a/client/widgets/checkbox.cc
+++ b/client/widgets/checkbox.cc
@@ -26,17 +26,11 @@
*/
#include "checkbox.h"
-CheckBox::CheckBox(QDomNode node) : QCheckBox()
+CheckBox::CheckBox(QDomNode node)
+ : QCheckBox(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
-
if(elem.hasAttribute("caption")) {
setText(elem.attribute("caption"));
} else {
diff --git a/client/widgets/checkbox.h b/client/widgets/checkbox.h
index 94905f2..fb796cf 100644
--- a/client/widgets/checkbox.h
+++ b/client/widgets/checkbox.h
@@ -31,7 +31,7 @@
#include <QDomNode>
#include <QCheckBox>
-class CheckBox : public Widget, public QCheckBox
+class CheckBox : public QCheckBox, public Widget
{
public:
diff --git a/client/widgets/combobox.cc b/client/widgets/combobox.cc
index 6a4d8df..5499d09 100644
--- a/client/widgets/combobox.cc
+++ b/client/widgets/combobox.cc
@@ -26,8 +26,10 @@
*/
#include "combobox.h"
-ComboBox::ComboBox(QWidget *parent) : QComboBox(parent)
+ComboBox::ComboBox(QDomNode node)
+ : QComboBox(), Widget(node)
{
+ QDomElement elem = node.toElement();
}
QString ComboBox::getValue()
diff --git a/client/widgets/combobox.h b/client/widgets/combobox.h
index 7b705ad..eb7d72e 100644
--- a/client/widgets/combobox.h
+++ b/client/widgets/combobox.h
@@ -29,12 +29,13 @@
#include "widget.h"
#include <QComboBox>
+#include <QDomNode>
-class ComboBox : public Widget, public QComboBox
+class ComboBox : public QComboBox, public Widget
{
public:
- ComboBox(QWidget *parent);
+ ComboBox(QDomNode node);
public slots:
QString getValue();
diff --git a/client/widgets/frame.cc b/client/widgets/frame.cc
index d700b1b..00f1930 100644
--- a/client/widgets/frame.cc
+++ b/client/widgets/frame.cc
@@ -26,18 +26,26 @@
*/
#include "frame.h"
-Frame::Frame(QDomNode node) : QGroupBox()
+Frame::Frame(QDomNode node)
+ : QGroupBox(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
+ if(elem.hasAttribute("caption")) {
+ setTitle(elem.attribute("caption"));
} else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
+ setTitle(elem.attribute(""));
}
- setTitle(elem.attribute("caption"));
+ if(elem.hasAttribute("border")) {
+ if(elem.attribute("border") == "true") {
+ setFlat(false);
+ } else {
+ setFlat(true);
+ }
+ } else {
+ setFlat(true);
+ }
}
QString Frame::getValue()
diff --git a/client/widgets/frame.h b/client/widgets/frame.h
index f934269..fed9b1f 100644
--- a/client/widgets/frame.h
+++ b/client/widgets/frame.h
@@ -31,7 +31,7 @@
#include <QGroupBox>
#include <QDomNode>
-class Frame : public Widget, public QGroupBox
+class Frame : public QGroupBox, public Widget
{
public:
diff --git a/client/widgets/label.cc b/client/widgets/label.cc
index b1875e4..dd658d3 100644
--- a/client/widgets/label.cc
+++ b/client/widgets/label.cc
@@ -27,17 +27,19 @@
#include "label.h"
#include <stdio.h>
-Label::Label(QDomNode node) : QLabel()
+Label::Label(QDomNode node)
+ : QLabel(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
+ if(elem.hasAttribute("width")) {
+ setMinimumWidth(elem.attribute("width").toInt());
}
+ if(elem.hasAttribute("height")) {
+ setMinimumWidth(elem.attribute("height").toInt());
+ }
+
if(elem.hasAttribute("caption")) {
setText(elem.attribute("caption"));
} else {
diff --git a/client/widgets/lineedit.cc b/client/widgets/lineedit.cc
index 62e1aa8..6c3264b 100644
--- a/client/widgets/lineedit.cc
+++ b/client/widgets/lineedit.cc
@@ -27,17 +27,11 @@
#include "lineedit.h"
#include <stdio.h>
-LineEdit::LineEdit(QDomNode node) : QLineEdit()
+LineEdit::LineEdit(QDomNode node)
+ : QLineEdit(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
-
if(elem.hasAttribute("regexp")) {
rx = QRegExp(elem.attribute("regexp"));
connect(this, SIGNAL(textChanged(QString)), this, SLOT(changed(QString)));
diff --git a/client/widgets/pushbutton.cc b/client/widgets/pushbutton.cc
index 7c78cfd..5b424a5 100644
--- a/client/widgets/pushbutton.cc
+++ b/client/widgets/pushbutton.cc
@@ -27,17 +27,11 @@
#include "pushbutton.h"
#include <stdio.h>
-PushButton::PushButton(QDomNode node) : QPushButton()
+PushButton::PushButton(QDomNode node)
+ : QPushButton(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
-
if(elem.hasAttribute("caption")) {
setText(elem.attribute("caption"));
} else {
diff --git a/client/widgets/radiobutton.cc b/client/widgets/radiobutton.cc
index af34de6..0645745 100644
--- a/client/widgets/radiobutton.cc
+++ b/client/widgets/radiobutton.cc
@@ -26,17 +26,11 @@
*/
#include "radiobutton.h"
-RadioButton::RadioButton(QDomNode node) : QRadioButton()
+RadioButton::RadioButton(QDomNode node)
+ : QRadioButton(), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
-
if(elem.hasAttribute("caption")) {
setText(elem.attribute("caption"));
} else {
diff --git a/client/widgets/radiobutton.h b/client/widgets/radiobutton.h
index 6239c3f..a2f06c5 100644
--- a/client/widgets/radiobutton.h
+++ b/client/widgets/radiobutton.h
@@ -31,7 +31,7 @@
#include <QRadioButton>
#include <QDomNode>
-class RadioButton : public Widget, public QRadioButton
+class RadioButton : public QRadioButton, public Widget
{
public:
diff --git a/client/widgets/textedit.cc b/client/widgets/textedit.cc
index 1d1babe..d1bd6e4 100644
--- a/client/widgets/textedit.cc
+++ b/client/widgets/textedit.cc
@@ -27,19 +27,13 @@
#include "textedit.h"
#include <stdio.h>
-TextEdit::TextEdit(QDomNode node) : QTextEdit()
+TextEdit::TextEdit(QDomNode node)
+ : QTextEdit(), Widget(node)
{
setAutoFillBackground(true); /* Default is false, which disables background
color manipulation.*/
QDomElement elem = node.toElement();
-
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
if(elem.hasAttribute("regexp")) {
rx = QRegExp(elem.attribute("regexp"));
diff --git a/client/widgets/widget.cc b/client/widgets/widget.cc
index 8bbb3a8..910d80b 100644
--- a/client/widgets/widget.cc
+++ b/client/widgets/widget.cc
@@ -26,6 +26,18 @@
*/
#include "widget.h"
+Widget::Widget(QDomNode node)
+{
+ QDomElement elem = node.toElement();
+
+ if(elem.hasAttribute("name")) {
+ widget_name = elem.attribute("name");
+ } else {
+ printf("XML ERROR!! Unnamed widget of type: %s\n",
+ elem.tagName().toStdString().c_str());
+ }
+}
+
QString Widget::getName()
{
return widget_name;
diff --git a/client/widgets/widget.h b/client/widgets/widget.h
index beefdab..d8a0b2d 100644
--- a/client/widgets/widget.h
+++ b/client/widgets/widget.h
@@ -28,10 +28,12 @@
#define __PRACRO_WIDGET_H__
#include <QString>
+#include <QDomNode>
class Widget {
public:
+ Widget(QDomNode node);
virtual ~Widget(){}
virtual QString getValue() = 0;
QString getName();
diff --git a/client/widgets/window.cc b/client/widgets/window.cc
index 217bf21..31f51bf 100644
--- a/client/widgets/window.cc
+++ b/client/widgets/window.cc
@@ -26,17 +26,11 @@
*/
#include "window.h"
-Window::Window(QDomNode node) : QWidget(NULL)
+Window::Window(QDomNode node)
+ : QWidget(NULL), Widget(node)
{
QDomElement elem = node.toElement();
- if(elem.hasAttribute("name")) {
- widget_name = elem.attribute("name");
- } else {
- printf("XML ERROR!! Unnamed widget of type: %s\n",
- elem.tagName().toStdString().c_str());
- }
-
if(elem.hasAttribute("width")) {
setMinimumWidth(elem.attribute("width").toInt());
}
diff --git a/client/widgets/window.h b/client/widgets/window.h
index 560c094..0640c7b 100644
--- a/client/widgets/window.h
+++ b/client/widgets/window.h
@@ -31,7 +31,7 @@
#include <QWidget>
#include <QDomNode>
-class Window : public Widget, public QWidget
+class Window : public QWidget, public Widget
{
public: