[rkward-cvs] rkward/rkward/plugin Makefile.am,1.13,1.14 rknote.h,1.1,1.2 rkpluginbrowser.cpp,1.6,1.7 rkstandardcomponent.cpp,1.12,1.13 rktext.cpp,1.3,1.4 rktext.h,1.3,1.4 rkvarslot.cpp,1.18,1.19

Thomas Friedrichsmeier tfry at users.sourceforge.net
Fri Mar 17 17:27:27 UTC 2006


Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18781

Modified Files:
	Makefile.am rknote.h rkpluginbrowser.cpp 
	rkstandardcomponent.cpp rktext.cpp rktext.h rkvarslot.cpp 
Log Message:
Moved over RKText. First internal milestone reached

Index: rktext.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rktext.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rktext.cpp	29 Sep 2005 16:02:51 -0000	1.3
--- rktext.cpp	17 Mar 2006 17:27:24 -0000	1.4
***************
*** 3,7 ****
                               -------------------
      begin                : Sun Nov 10 2002
!     copyright            : (C) 2002 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
--- 3,7 ----
                               -------------------
      begin                : Sun Nov 10 2002
!     copyright            : (C) 2002, 2006 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
***************
*** 20,49 ****
  #include <qstring.h>
  #include <qstringlist.h>
- #include <qdom.h>
  #include <qlayout.h>
  #include <qlabel.h>
  
- #include "../debug.h"
  #include "../rkglobals.h"
  
! RKText::RKText(const QDomElement &element, QWidget *parent, RKPlugin *plugin) : RKPluginWidget (element, parent, plugin) {
  	RK_TRACE (PLUGIN);
  	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	
! 	QString text;
  	QStringList lines = lines.split ("\n", element.text (), false);
  	for (unsigned int i=0; i < lines.count (); i++) {
  		QString line = lines[i].stripWhiteSpace ();
  		if (!line.isEmpty ()) {
! 			text.append (line + "\n");
  		}
  	}
  
  	// strip final newline
! 	text.truncate (text.length () -1);
  
! 	label = new QLabel (text, this);
! 	label->setAlignment (Qt::AlignAuto | Qt::ExpandTabs | Qt::WordBreak);
! 	vbox->addWidget (label);
  }
  
--- 20,58 ----
  #include <qstring.h>
  #include <qstringlist.h>
  #include <qlayout.h>
  #include <qlabel.h>
+ #include <qdom.h>
  
  #include "../rkglobals.h"
+ #include "../debug.h"
  
! RKText::RKText (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget) : RKComponent (parent_component, parent_widget) {
  	RK_TRACE (PLUGIN);
+ 
+ 	// create layout and label
  	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 
! 	label = new QLabel (QString::null, this);
! 	label->setAlignment (Qt::AlignAuto | Qt::ExpandTabs | Qt::WordBreak);
! 	vbox->addWidget (label);
! 
! 	QString initial_text;
  	QStringList lines = lines.split ("\n", element.text (), false);
  	for (unsigned int i=0; i < lines.count (); i++) {
  		QString line = lines[i].stripWhiteSpace ();
  		if (!line.isEmpty ()) {
! 			initial_text.append (line + "\n");
  		}
  	}
  
  	// strip final newline
! 	initial_text.truncate (initial_text.length () -1);
  
! 	// create and add property
! 	addChild ("text", text = new RKComponentPropertyBase (this, true));
! 	connect (text, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (textChanged (RKComponentPropertyBase *)));
! 
! 	// initialize
! 	text->setValue (initial_text);
  }
  
***************
*** 51,52 ****
--- 60,70 ----
  	RK_TRACE (PLUGIN);
  }
+ 
+ void RKText::textChanged (RKComponentPropertyBase *) {
+ 	RK_TRACE (PLUGIN);
+ 
+ 	label->setText (text->value ());
+ 	changed ();
+ }
+ 
+ #include "rktext.moc"

Index: rktext.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rktext.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rktext.h	26 Mar 2005 10:32:17 -0000	1.3
--- rktext.h	17 Mar 2006 17:27:24 -0000	1.4
***************
*** 3,7 ****
                               -------------------
      begin                : Sun Nov 10 2002
!     copyright            : (C) 2002 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
--- 3,7 ----
                               -------------------
      begin                : Sun Nov 10 2002
!     copyright            : (C) 2002, 2006 by Thomas Friedrichsmeier
      email                : tfry at users.sourceforge.net
   ***************************************************************************/
***************
*** 19,34 ****
  #define RKTEXT_H
  
  
! #include <rkpluginwidget.h>
  
  /**
    *@author Thomas Friedrichsmeier
    */
! 
! class RKText : public RKPluginWidget  {
  public:
! 	RKText(const QDomElement &element, QWidget *parent, RKPlugin *plugin);
!  
! 	~RKText();
  };
  
--- 19,44 ----
  #define RKTEXT_H
  
+ #include "rkcomponent.h"
+ 
+ #include "rkcomponentproperties.h"
  
! class QLabel;
! class QDomElement;
  
  /**
    *@author Thomas Friedrichsmeier
    */
! class RKText : public RKComponent {
! 	Q_OBJECT
  public:
! 	RKText (const QDomElement &element, RKComponent *parent_component, QWidget *parent_widget);
! 
! 	~RKText ();
! 
! 	RKComponentPropertyBase *text;
! public slots:
! 	void textChanged (RKComponentPropertyBase *);
! private:
! 	QLabel *label;
  };
  

Index: rkvarslot.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkvarslot.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** rkvarslot.cpp	17 Mar 2006 16:46:25 -0000	1.18
--- rkvarslot.cpp	17 Mar 2006 17:27:25 -0000	1.19
***************
*** 86,92 ****
  
  	// initialize filters
! 	available->setClassFilter (QStringList::split (";", xml->getStringAttribute (element, "classes", QString::null, DL_INFO)));
  	available->setRequired (xml->getBoolAttribute (element, "required", true, DL_INFO));
! 	available->setTypeFilter (QStringList::split (";", xml->getStringAttribute (element, "types", QString::null, DL_INFO)));
  
  	connect (available, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (availablePropertyChanged (RKComponentPropertyBase *)));
--- 86,92 ----
  
  	// initialize filters
! 	available->setClassFilter (QStringList::split (" ", xml->getStringAttribute (element, "classes", QString::null, DL_INFO)));
  	available->setRequired (xml->getBoolAttribute (element, "required", true, DL_INFO));
! 	available->setTypeFilter (QStringList::split (" ", xml->getStringAttribute (element, "types", QString::null, DL_INFO)));
  
  	connect (available, SIGNAL (valueChanged (RKComponentPropertyBase *)), this, SLOT (availablePropertyChanged (RKComponentPropertyBase *)));

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/Makefile.am,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** Makefile.am	17 Mar 2006 16:46:25 -0000	1.13
--- Makefile.am	17 Mar 2006 17:27:24 -0000	1.14
***************
*** 4,17 ****
  libplugin_a_SOURCES = rkcomponentmap.cpp rkcomponentproperties.cpp rkcomponent.cpp \
  	rkstandardcomponent.cpp rkvarselector.cpp rkvarslot.cpp rkformula.cpp rkradio.cpp \
! 	rkcheckbox.cpp rkpluginspinbox.cpp rkinput.cpp rkpluginbrowser.cpp
  # rkplugin.cpp \
! #	rkpluginhandle.cpp rkpluginwidget.cpp rktext.cpp \
  #	  rknote.cpp
  
  noinst_HEADERS = rkcomponentmap.h rkcomponentproperties.h rkcomponent.h \
  	rkstandardcomponent.h rkvarselector.h rkvarslot.h rkformula.h rkradio.h \
! 	rkcheckbox.h rkpluginspinbox.h rkinput.h rkpluginbrowser.h
  # rkplugin.h rkpluginhandle.h \
! # rkpluginwidget.h rktext.h  \
  # rknote.h 
  
--- 4,17 ----
  libplugin_a_SOURCES = rkcomponentmap.cpp rkcomponentproperties.cpp rkcomponent.cpp \
  	rkstandardcomponent.cpp rkvarselector.cpp rkvarslot.cpp rkformula.cpp rkradio.cpp \
! 	rkcheckbox.cpp rkpluginspinbox.cpp rkinput.cpp rkpluginbrowser.cpp rktext.cpp
  # rkplugin.cpp \
! #	rkpluginhandle.cpp rkpluginwidget.cpp \
  #	  rknote.cpp
  
  noinst_HEADERS = rkcomponentmap.h rkcomponentproperties.h rkcomponent.h \
  	rkstandardcomponent.h rkvarselector.h rkvarslot.h rkformula.h rkradio.h \
! 	rkcheckbox.h rkpluginspinbox.h rkinput.h rkpluginbrowser.h rktext.h
  # rkplugin.h rkpluginhandle.h \
! # rkpluginwidget.h  \
  # rknote.h 
  

Index: rkstandardcomponent.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkstandardcomponent.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkstandardcomponent.cpp	17 Mar 2006 16:46:25 -0000	1.12
--- rkstandardcomponent.cpp	17 Mar 2006 17:27:24 -0000	1.13
***************
*** 59,63 ****
  #include "rkinput.h"
  #include "rkpluginbrowser.h"
! //#include "rktext.h"
  //#include "rknote.h"
  
--- 59,63 ----
  #include "rkinput.h"
  #include "rkpluginbrowser.h"
! #include "rktext.h"
  //#include "rknote.h"
  
***************
*** 213,218 ****
  		} else if (e.tagName () == "browser") {
  			widget = new RKPluginBrowser (e, component (), parent_widget);
! /*		} else if (e.tagName () == "text") {
! 			widget = new RKText (e, component (), parent_widget); */
  //		} else if (e.tagName () == "note") {		//TODO: remove corresponding class, it's a dupe
  //			widget = new RKNote (e, parent_widget, this);
--- 213,218 ----
  		} else if (e.tagName () == "browser") {
  			widget = new RKPluginBrowser (e, component (), parent_widget);
! 		} else if (e.tagName () == "text") {
! 			widget = new RKText (e, component (), parent_widget);
  //		} else if (e.tagName () == "note") {		//TODO: remove corresponding class, it's a dupe
  //			widget = new RKNote (e, parent_widget, this);

Index: rkpluginbrowser.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginbrowser.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkpluginbrowser.cpp	17 Mar 2006 16:46:25 -0000	1.6
--- rkpluginbrowser.cpp	17 Mar 2006 17:27:24 -0000	1.7
***************
*** 72,75 ****
--- 72,76 ----
  	updating = false;
  	selection->setValue (selector->getLocation ());
+ 	changed ();
  }
  

Index: rknote.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rknote.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** rknote.h	26 Mar 2005 10:33:30 -0000	1.1
--- rknote.h	17 Mar 2006 17:27:24 -0000	1.2
***************
*** 19,22 ****
--- 19,25 ----
  
  /**
+ 
+ TODO: remove. This is essentially a dupe of RKText
+ 
  @author Thomas Friedrichsmeier
  */





More information about the rkward-tracker mailing list