[rkward-cvs] rkward/rkward/windows rkcommandeditorwindow.cpp,1.12,1.13 rkcommandeditorwindow.h,1.8,1.9 rkhelpwindow.cpp,1.4,1.5 rkhelpwindow.h,1.4,1.5

Pierre ecoch at users.sourceforge.net
Sun Apr 3 13:26:21 UTC 2005


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

Modified Files:
	rkcommandeditorwindow.cpp rkcommandeditorwindow.h 
	rkhelpwindow.cpp rkhelpwindow.h 
Log Message:
Trying to use kparts properly. Not finished yet. (but hey, it's cvs, man).

Index: rkhelpwindow.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rkhelpwindow.cpp	17 Mar 2005 07:37:42 -0000	1.4
--- rkhelpwindow.cpp	3 Apr 2005 13:26:19 -0000	1.5
***************
*** 18,21 ****
--- 18,22 ----
  #include <khtmlview.h>
  #include <khtml_part.h>
+ #include <klibloader.h>
  
  #include <klocale.h>
***************
*** 23,41 ****
  
  #include <qfile.h>
  #include <qlayout.h>
  
  #include "rkhelpwindow.h"
  
  RKHelpWindow::RKHelpWindow(QWidget *parent, const char *name)
   : KMdiChildView(parent, name)
  {
! 	khtmlpart = new KHTMLPart (this);
  	khtmlpart->view()->setIcon(SmallIcon("help"));
  	khtmlpart->view()->setName("Help"); 
  	khtmlpart->view()->setCaption(i18n("Help")); 
! 	
  	pLayout = new QHBoxLayout( this, 0, -1, "layout");
! 	pLayout->addWidget(khtmlpart->view());
! 	
  	// We have to connect this in order to allow browsing.
  	connect( khtmlpart->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), this, SLOT( slotOpenURLRequest(const KURL &, const KParts::URLArgs & ) ) );
--- 24,51 ----
  
  #include <qfile.h>
+ #include <qwidget.h>
  #include <qlayout.h>
  
+ #include "../rkglobals.h"
+ #include "../rkward.h"
+ #include <kparts/partmanager.h>
+ 
  #include "rkhelpwindow.h"
  
+ 
  RKHelpWindow::RKHelpWindow(QWidget *parent, const char *name)
   : KMdiChildView(parent, name)
  {
! 	khtmlpart = new KHTMLPart(this,0,0,0,KHTMLPart::BrowserViewGUI);
! 	khtmlpart->setSelectable(true);
  	khtmlpart->view()->setIcon(SmallIcon("help"));
  	khtmlpart->view()->setName("Help"); 
  	khtmlpart->view()->setCaption(i18n("Help")); 
! 
! 	(RKGlobals::rkApp()->m_manager)->addPart(khtmlpart,false);
! 	khtmlpart->widget()->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
  	pLayout = new QHBoxLayout( this, 0, -1, "layout");
! 	pLayout->addWidget(khtmlpart->widget());
! 
  	// We have to connect this in order to allow browsing.
  	connect( khtmlpart->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), this, SLOT( slotOpenURLRequest(const KURL &, const KParts::URLArgs & ) ) );

Index: rkcommandeditorwindow.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkcommandeditorwindow.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkcommandeditorwindow.cpp	25 Feb 2005 22:28:26 -0000	1.12
--- rkcommandeditorwindow.cpp	3 Apr 2005 13:26:19 -0000	1.13
***************
*** 61,65 ****
  	
  	
! 	m_library = KLibLoader::self()->library("libkatepart");
  	m_doc = (Kate::Document *) m_library->factory ()->create (0L,"kate","KTextEditor::Document");
  	m_view = (Kate::View *)m_doc->createView(this);
--- 61,65 ----
  	
  	
! 	/*m_library = KLibLoader::self()->library("libkatepart");
  	m_doc = (Kate::Document *) m_library->factory ()->create (0L,"kate","KTextEditor::Document");
  	m_view = (Kate::View *)m_doc->createView(this);
***************
*** 69,72 ****
--- 69,97 ----
  	pLayout->addWidget(m_view);
   
+ 	(RKGlobals::rkApp()->m_manager)->addPart((KParts::Part*)m_view,false);*/
+ 
+ 	KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" );
+ 	if (factory)
+ 	{
+ 		// Create the part
+ 		m_katepart = (KParts::ReadWritePart *)factory->create( this,
+ 			"katepart", "KParts::ReadWritePart" );
+ 	}
+ 	(RKGlobals::rkApp()->m_manager)->addPart((KParts::Part*)m_katepart,false);
+ 	//m_katepart->widget()->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
+ 
+ 
+ 
+ 	m_doc = (Kate::Document *) m_katepart;
+ 	m_view = (Kate::View *) m_katepart->widget();
+ 
+ 	pLayout = new QHBoxLayout( this, 0, -1, "layout");
+ 	pLayout->addWidget(m_katepart->widget());
+ 
+ 
+ 	m_view->setName("Kate Part View");
+ 	setRHighlighting(m_doc);
+ 
+ 
  	connect (this, SIGNAL (gotFocus (KMdiChildView *)), this, SLOT (slotGotFocus ()));
  	connect (this, SIGNAL (lostFocus (KMdiChildView *)), this, SLOT (slotLostFocus ()));

Index: rkhelpwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rkhelpwindow.h	17 Mar 2005 07:37:42 -0000	1.4
--- rkhelpwindow.h	3 Apr 2005 13:26:19 -0000	1.5
***************
*** 45,48 ****
--- 45,49 ----
      KHTMLPart * khtmlpart;
      QBoxLayout* pLayout;
+     KParts::ReadOnlyPart *m_khtmlpart;
  };
  

Index: rkcommandeditorwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkcommandeditorwindow.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** rkcommandeditorwindow.h	17 Mar 2005 07:37:42 -0000	1.8
--- rkcommandeditorwindow.h	3 Apr 2005 13:26:19 -0000	1.9
***************
*** 86,89 ****
--- 86,90 ----
      void updateTabCaption(const KURL &url);
      RCommandChain *chain;
+     KParts::ReadWritePart *m_katepart;
  };
  





More information about the rkward-tracker mailing list