[rkward-cvs] rkward/rkward/windows rkhelpwindow.cpp,1.12,1.13 rkhelpwindow.h,1.10,1.11 rkhtmlwindowpart.cpp,1.1,1.2

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue Sep 27 09:08:01 UTC 2005


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

Modified Files:
	rkhelpwindow.cpp rkhelpwindow.h rkhtmlwindowpart.cpp 
Log Message:
Activate output on Window->Show Output. Handle empty output somewhat better

Index: rkhelpwindow.h
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** rkhelpwindow.h	15 Sep 2005 21:03:27 -0000	1.10
--- rkhelpwindow.h	27 Sep 2005 09:07:58 -0000	1.11
***************
*** 41,45 ****
      ~RKHelpWindow ();
      bool openURL (const KURL &url, bool update_caption=true);
!     void refresh ();
      void scrollToBottom ();
  	void showOutputEmptyMessage ();
--- 41,45 ----
      ~RKHelpWindow ();
      bool openURL (const KURL &url, bool update_caption=true);
!     bool refresh ();
      void scrollToBottom ();
  	void showOutputEmptyMessage ();

Index: rkhtmlwindowpart.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhtmlwindowpart.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** rkhtmlwindowpart.cpp	15 Sep 2005 21:03:27 -0000	1.1
--- rkhtmlwindowpart.cpp	27 Sep 2005 09:07:58 -0000	1.2
***************
*** 102,107 ****
  	if (current_output) {
  		if (raise) {
! 			current_output->widget->raise ();
! 			current_output->widget->refresh ();
  		}
  	} else {
--- 102,109 ----
  	if (current_output) {
  		if (raise) {
! 			current_output->widget->activate ();
! 		}
! 		if (!current_output->widget->refresh ()) {
! 			current_output->widget->showOutputEmptyMessage ();
  		}
  	} else {

Index: rkhelpwindow.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/windows/rkhelpwindow.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkhelpwindow.cpp	15 Sep 2005 21:03:27 -0000	1.12
--- rkhelpwindow.cpp	27 Sep 2005 09:07:58 -0000	1.13
***************
*** 56,77 ****
  
  bool RKHelpWindow::openURL(const KURL &url, bool update_caption) {
! 	if (QFile::exists (url.path ())) {
! 		khtmlpart->openURL(url);
! 		if (update_caption) {
! 			setTabCaption(url.fileName());
! 			setCaption(url.fileName());
! 		}
! 		currentURL=url;
! 		scroll_position=0;
! 		return (true);
! 	} else{
! 		return (false);
  	}
  }
  
  void RKHelpWindow::showOutputEmptyMessage () {
! 		khtmlpart->begin();
! 		khtmlpart->write (i18n ("<HTML><BODY><H1>RKWard output</H1>\n<P>The output is empty.</P>\n</BODY></HTML>"));
! 		khtmlpart->end();
  }
  
--- 56,76 ----
  
  bool RKHelpWindow::openURL(const KURL &url, bool update_caption) {
! 	currentURL=url;
! 	bool ok = QFile (url.path ()).exists ();
! 
! 	if (!ok) return false;
! 
! 	khtmlpart->openURL (url);
! 	if (update_caption) {
! 		setMDICaption (url.fileName ());
  	}
+ 
+ 	return true;	
  }
  
  void RKHelpWindow::showOutputEmptyMessage () {
! 	khtmlpart->begin();
! 	khtmlpart->write (i18n ("<HTML><BODY><H1>RKWard output</H1>\n<P>The output is empty.</P>\n</BODY></HTML>"));
! 	khtmlpart->end();
  }
  
***************
*** 91,99 ****
  	Reload current page.
   */
! void RKHelpWindow::refresh()
  {
  	int pos = khtmlpart->view()->contentsY();
- 	openURL (currentURL);
  	scroll_position=pos;
  }
  
--- 90,98 ----
  	Reload current page.
   */
! bool RKHelpWindow::refresh()
  {
  	int pos = khtmlpart->view()->contentsY();
  	scroll_position=pos;
+ 	return openURL (currentURL, false);
  }
  





More information about the rkward-tracker mailing list