--Boundary-03=_9q8IA/m1gTDjrBl Content-Type: multipart/mixed; boundary="Boundary-01=_7q8IAzUKydKhhHL" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_7q8IAzUKydKhhHL Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hello I've wrote a patch to support more type in KDCOP (QSize, QRect, QPoint,=20 QColor, QPixmap) I was about to support more type like QVariant, but i feeled tired I was not sure if i can commit dirrectly, so i prefer ask here before. is i= t=20 ok to commit? or do you have comment? should i post again to this list before commiting? --Boundary-01=_7q8IAzUKydKhhHL Content-Type: text/x-diff; charset="us-ascii"; name="kdcop.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="kdcop.diff" ? kdcop.kdevelop ? kdcop.kdevelop.pcs ? kdcop.kdevses Index: Makefile.am =================================================================== RCS file: /home/kde/kdebase/kdcop/Makefile.am,v retrieving revision 1.4 diff -u -p -b -B -r1.4 Makefile.am --- Makefile.am 1 Nov 2001 03:42:58 -0000 1.4 +++ Makefile.am 6 Feb 2004 15:56:09 -0000 @@ -10,7 +10,7 @@ INCLUDES = $(all_includes) bin_PROGRAMS = kdcop kdcop_SOURCES = kdcop.cpp kdcopwindow.cpp kdcoplistview.cpp kdcopview.ui -kdcop_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_KDEUI) $(LIB_KDECORE) -lDCOP $(LIB_QT) +kdcop_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_KDEUI) $(LIB_KDECORE) $(LIB_KIO) -lDCOP $(LIB_QT) noinst_HEADERS = kdcopwindow.h METASOURCES = AUTO Index: kdcopwindow.cpp =================================================================== RCS file: /home/kde/kdebase/kdcop/kdcopwindow.cpp,v retrieving revision 1.43 diff -u -p -b -B -r1.43 kdcopwindow.cpp --- kdcopwindow.cpp 5 Feb 2004 22:30:01 -0000 1.43 +++ kdcopwindow.cpp 6 Feb 2004 15:56:09 -0000 @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -42,17 +43,46 @@ #include #include #include +#include #include #include #include #include #include +#include class DCOPBrowserApplicationItem; class DCOPBrowserInterfaceItem; class DCOPBrowserFunctionItem; +//------------------------------ + +class KMultiIntEdit : public QVBox +{ +public: + KMultiIntEdit(QWidget *parent , const char * name=0) : QVBox(parent,name) {} + void addField(int key, const QString & caption ) + { + QHBox *l=new QHBox(this); + new QLabel(caption + ": ", l); + KLineEdit* e = new KLineEdit( l ); + m_widgets.insert(key, e ) ; + e->setValidator( new QIntValidator( e ) ); + } + int field(int key) + { + KLineEdit *e=m_widgets[key]; + if(!e) return 0; + return e->text().toInt(); + } + +private: + QMap m_widgets; +}; + +//------------------------------ + DCOPBrowserItem::DCOPBrowserItem (QListView * parent, DCOPBrowserItem::Type type) : QListViewItem(parent), @@ -496,6 +526,64 @@ void KDCOPWindow::slotCallFunction( QLis grid->addWidget( e, i, 2 ); wl.append( e ); } + else if ( type == "QColor" ) + { + QLabel* n = new QLabel( names[i-1], frame ); + grid->addWidget( n, i, 0 ); + QLabel* l = new QLabel( "QColor", frame ); + grid->addWidget( l, i, 1 ); + KColorButton* e = new KColorButton( frame ); + grid->addWidget( e, i, 2 ); + wl.append( e ); + } + else if ( type == "QSize" ) + { + QLabel* n = new QLabel( names[i-1], frame ); + grid->addWidget( n, i, 0 ); + QLabel* l = new QLabel( "QSize", frame ); + grid->addWidget( l, i, 1 ); + KMultiIntEdit* e = new KMultiIntEdit( frame ); + e->addField( 1, i18n("Width") ); + e->addField( 2, i18n("Height") ); + grid->addWidget( e, i, 2 ); + wl.append( e ); + } + else if ( type == "QPoint" ) + { + QLabel* n = new QLabel( names[i-1], frame ); + grid->addWidget( n, i, 0 ); + QLabel* l = new QLabel( "QPoint", frame ); + grid->addWidget( l, i, 1 ); + KMultiIntEdit* e = new KMultiIntEdit( frame ); + e->addField( 1, i18n("X") ); + e->addField( 2, i18n("Y") ); + grid->addWidget( e, i, 2 ); + wl.append( e ); + } + else if ( type == "QRect" ) + { + QLabel* n = new QLabel( names[i-1], frame ); + grid->addWidget( n, i, 0 ); + QLabel* l = new QLabel( "QRect", frame ); + grid->addWidget( l, i, 1 ); + KMultiIntEdit* e = new KMultiIntEdit( frame ); + e->addField( 1, i18n("Left") ); + e->addField( 2, i18n("Top") ); + e->addField( 3, i18n("Width") ); + e->addField( 4, i18n("Height") ); + grid->addWidget( e, i, 2 ); + wl.append( e ); + } + else if( type == "QPixmap" ) + { + QLabel* n = new QLabel( names[i-1], frame ); + grid->addWidget( n, i, 0 ); + QLabel* l = new QLabel( "KURL", frame ); + grid->addWidget( l, i, 1 ); + KURLRequester* e = new KURLRequester( frame ); + grid->addWidget( e, i, 2 ); + wl.append( e ); + } else { KMessageBox::sorry(this, i18n("Cannot handle datatype %1").arg(type)); @@ -588,6 +676,31 @@ void KDCOPWindow::slotCallFunction( QLis KLineEdit* e = (KLineEdit*)wl.at( i ); arg << KURL( e->text() ); } + else if( type == "QColor" ) + { + KColorButton* e = (KColorButton*)wl.at( i ); + arg << e->color(); + } + else if( type == "QSize" ) + { + KMultiIntEdit* e = (KMultiIntEdit*)wl.at( i ); + arg << QSize(e->field(1) , e->field(2)) ; + } + else if( type == "QPoint" ) + { + KMultiIntEdit* e = (KMultiIntEdit*)wl.at( i ); + arg << QPoint(e->field(1) , e->field(2)) ; + } + else if( type == "QRect" ) + { + KMultiIntEdit* e = (KMultiIntEdit*)wl.at( i ); + arg << QRect(e->field(1) , e->field(2) , e->field(3) , e->field(4)) ; + } + else if( type == "QPixmap" ) + { + KURLRequester* e= (KURLRequester*)wl.at( i ); + arg << QPixmap(e->url()); + } else { KMessageBox::sorry(this, i18n("Cannot handle datatype %1").arg(type)); --Boundary-01=_7q8IAzUKydKhhHL-- --Boundary-03=_9q8IA/m1gTDjrBl Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (GNU/Linux) iD4DBQBAI8q9z58lY8jWrL0RAqxkAJdWUWDNeaSHa9G3MYni3vnGrs+tAJ9uXWdJ bmqFwns3vyf4RBe/lo69zA== =gM2Y -----END PGP SIGNATURE----- --Boundary-03=_9q8IA/m1gTDjrBl--