[rkward-cvs] rkward/rkward/windows rkhelpwindow.cpp,1.6,1.7 rkhelpwindow.h,1.6,1.7

Pierre ecoch at users.sourceforge.net
Sun Apr 3 20:06:23 UTC 2005


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

Modified Files:
	rkhelpwindow.cpp rkhelpwindow.h 
Log Message:
You can now refresh output (again).

Index: rkhelpwindow.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkhelpwindow.cpp	3 Apr 2005 16:23:38 -0000	1.6
--- rkhelpwindow.cpp	3 Apr 2005 20:06:17 -0000	1.7
***************
*** 26,29 ****
--- 26,30 ----
  #include <qwidget.h>
  #include <qlayout.h>
+ #include <qtimer.h>
  
  #include "../rkglobals.h"
***************
*** 37,45 ****
   : 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")); */
  	
  	iShowOutput=output;
--- 38,45 ----
   : KMdiChildView(parent, name)
  {
+ 	scrollPosition=0;
+ 	
  	khtmlpart = new KHTMLPart(this,0,0,0,KHTMLPart::BrowserViewGUI);
  	khtmlpart->setSelectable(true);
  	
  	iShowOutput=output;
***************
*** 53,56 ****
--- 53,58 ----
  	connect( khtmlpart->browserExtension(), SIGNAL( openURLRequest( const KURL &, const KParts::URLArgs & ) ), this, SLOT( slotOpenURLRequest(const KURL &, const KParts::URLArgs & ) ) );
  	
+ 	connect(khtmlpart,SIGNAL(completed()),this,SLOT(loadDone()));
+ 	
  }
  
***************
*** 77,80 ****
--- 79,84 ----
  			setCaption(url.prettyURL());
  		}
+ 		currentURL=url;
+ 		scrollPosition=0;
  		return(true);
  	}
***************
*** 93,94 ****
--- 97,131 ----
  	openURL (url);
  }
+ 
+ 
+ /*!
+     \fn RKHelpWindow::refresh()
+ 
+ 	Reload current page.
+  */
+ void RKHelpWindow::refresh()
+ {
+ 	int pos = khtmlpart->view()->contentsY();
+ 	openURL (currentURL);
+ 	scrollPosition=pos;
+ }
+ 
+ 
+ /*!
+     \fn RKHelpWindow::loadDone()
+ 	This slot is called when the new page has finished loading.
+  */
+ void RKHelpWindow::loadDone()
+ {
+ 	khtmlpart->view()->setContentsPos ( 0, scrollPosition );
+ }
+ 
+ 
+ /*!
+     \fn RKHelpWindow::scrollToBottom()
+ 	Scrolls to the bottom of the page.
+  */
+ void RKHelpWindow::scrollToBottom()
+ {
+ 	khtmlpart->view()->setContentsPos ( 0, khtmlpart->view()->contentsHeight() );
+ }

Index: rkhelpwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkhelpwindow.h	3 Apr 2005 16:23:38 -0000	1.6
--- rkhelpwindow.h	3 Apr 2005 20:06:21 -0000	1.7
***************
*** 40,43 ****
--- 40,45 ----
      ~RKHelpWindow();
      bool openURL(KURL url);
+     void refresh();
+     void scrollToBottom();
  public slots:
      void slotOpenURLRequest(const KURL &url, const KParts::URLArgs & );
***************
*** 49,52 ****
--- 51,60 ----
      /** Are we showing the output? */
      bool iShowOutput;
+     KURL currentURL;
+ private slots:
+     void loadDone();
+ protected:
+ 	/** Here we store the position of the scroll bar before refresh */
+     int scrollPosition;
  };
  





More information about the rkward-tracker mailing list