From 4edb3b4deb2a0bc43379d905c9a662aeafcecf62 Mon Sep 17 00:00:00 2001 From: deva Date: Tue, 23 Sep 2008 10:09:40 +0000 Subject: Added resumewidget. --- client/client.pro | 2 ++ client/macrowindow.cc | 4 ++-- client/macrowindow.h | 3 ++- client/resumewidget.cc | 42 ++++++++++++++++++++++++++++++++++++++++++ client/resumewidget.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 client/resumewidget.cc create mode 100644 client/resumewidget.h (limited to 'client') diff --git a/client/client.pro b/client/client.pro index e015e63..28b0709 100644 --- a/client/client.pro +++ b/client/client.pro @@ -30,6 +30,7 @@ HEADERS += \ macrowindow.h \ mainwindow.h \ netcom.h \ + resumewidget.h \ widgetbuilder.h \ widgets.h \ widgets/common.h \ @@ -58,6 +59,7 @@ SOURCES += \ macrowindow.cc \ mainwindow.cc \ netcom.cc \ + resumewidget.cc \ widgetbuilder.cc \ widgets/common.cc \ widgets/widget.cc \ diff --git a/client/macrowindow.cc b/client/macrowindow.cc index d9d8f32..3a6d3c7 100644 --- a/client/macrowindow.cc +++ b/client/macrowindow.cc @@ -49,7 +49,7 @@ MacroWindow::MacroWindow(NetCom &n, QDomNode &xml_doc, QString course, bool coll { this->course = course; - setCollapsedWidget(new QLabel("")); + setCollapsedWidget(new ResumeWidget()); this->lua = new LUA(this); @@ -89,7 +89,7 @@ void MacroWindow::initMacro(QDomNode &node) // Nothing to do here } else if(xml_elem.tagName() == "resume") { QString resume = xml_elem.text(); - ((QLabel*)collapsedWidget())->setText(resume); + ((ResumeWidget*)collapsedWidget())->setText(resume); } else if(xml_elem.tagName() == "script") { if(xml_elem.hasAttribute("language") && diff --git a/client/macrowindow.h b/client/macrowindow.h index 3100a5d..aad54a9 100644 --- a/client/macrowindow.h +++ b/client/macrowindow.h @@ -37,6 +37,7 @@ #include "collapser.h" #include "netcom.h" +#include "resumewidget.h" class NetCom; class LUA; @@ -84,7 +85,7 @@ private: QString course; QString version; QWidget *mainwidget; - QLabel *resumewidget; + ResumeWidget *resumewidget; bool isclosed; void close(); diff --git a/client/resumewidget.cc b/client/resumewidget.cc new file mode 100644 index 0000000..80643db --- /dev/null +++ b/client/resumewidget.cc @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * resumewidget.cc + * + * Tue Sep 23 12:02:03 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Pracro. + * + * Pracro is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Pracro is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Pracro; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#include "resumewidget.h" + +#include + +ResumeWidget::ResumeWidget() +{ + setLayout(new QHBoxLayout()); + resume = new QLabel(); + resume->setWordWrap(true); + layout()->addWidget(resume); +} + +void ResumeWidget::setText(QString text) +{ + resume->setText(text); +} diff --git a/client/resumewidget.h b/client/resumewidget.h new file mode 100644 index 0000000..79fd7f5 --- /dev/null +++ b/client/resumewidget.h @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/*************************************************************************** + * resumewidget.h + * + * Tue Sep 23 12:02:03 CEST 2008 + * Copyright 2008 Bent Bisballe Nyeng + * deva@aasimon.org + ****************************************************************************/ + +/* + * This file is part of Pracro. + * + * Pracro is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * Pracro is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Pracro; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ +#ifndef __PRACRO_RESUMEWIDGET_H__ +#define __PRACRO_RESUMEWIDGET_H__ + +#include +#include + +class ResumeWidget : public QWidget { +public: + ResumeWidget(); + + void setText(QString text); + +private: + QLabel *resume; +}; + +#endif/*__PRACRO_RESUMEWIDGET_H__*/ -- cgit v1.2.3