[rkward-cvs] SF.net SVN: rkward: [1556] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Mar 9 12:01:32 UTC 2007


Revision: 1556
          http://svn.sourceforge.net/rkward/?rev=1556&view=rev
Author:   tfry
Date:     2007-03-09 04:01:32 -0800 (Fri, 09 Mar 2007)

Log Message:
-----------
Allow to define short (navigation bar) titles for custom sections in help pages

Modified Paths:
--------------
    trunk/rkward/rkward/pages/rkward_trouble_shooting.rkh
    trunk/rkward/rkward/windows/rkhtmlwindow.cpp
    trunk/rkward/rkward/windows/rkhtmlwindow.h

Modified: trunk/rkward/rkward/pages/rkward_trouble_shooting.rkh
===================================================================
--- trunk/rkward/rkward/pages/rkward_trouble_shooting.rkh	2007-03-08 22:52:17 UTC (rev 1555)
+++ trunk/rkward/rkward/pages/rkward_trouble_shooting.rkh	2007-03-09 12:01:32 UTC (rev 1556)
@@ -4,22 +4,22 @@
 	<summary>
 	RKWard is far from complete and certainly there are many issues that need to be fixed. However, some of the things you notice are not due to the nature of RKWard but R or something else. This section will try to cover some common issues.
 	</summary>
-	<section title="People tend to ask me what RKWard means. What should I answer?" id="the_name_problems">
+	<section title="People tend to ask me what RKWard means. What should I answer?" shorttitle="What does "RKWard" mean?" id="the_name_problems">
 		Yes, it's a very odd name. ;) However, R comes obviously from the <link href="http://www.r-project.org/">R-language</link> which is the statistical basis of RKWard. K is derived from <link href="http://kde.org/">KDE</link> which delivered the basic GUI technologies for RKWard. And <link href="http://en.wikipedia.org/wiki/Ward">Ward</link>? That's another story.
 	</section>
-	<section title="Sometimes I enter a command short after the start of RKWard but it is not processed. What's wrong?" id="not_yet_ready_problems">
+	<section title="Sometimes I enter a command short after the start of RKWard but it is not processed. What's wrong?" shorttitle="Commands not processing" id="not_yet_ready_problems">
 		This happens because RKWard starts first and subsequent R is started in the background. Depending on the speed of your machine it can take some time to start R. In any case you can check the state of R within RKWard. Just look at the little box on the right bottom corner of RKWard. If it is green you can go ahead.
 
 		You can start submitting commands while the backend has not yet started, or while another lengthy calculation is still taking place. In this case your commands will be placed into a queue, first, and executed as soon as the backend becomes available, again.
 	</section>
-	<section title="RKWard says it needs a package. Was the installation of RKWard not complete?" id="package_problems">
+	<section title="RKWard says it needs a package. Was the installation of RKWard not complete?" shorttitle="Missing packages" id="package_problems">
 		RKWard has basically all the functionality which comes with the standard packages of R. But RKWard is at the same time rather extensible. Many developers made use of this and thus some of the procedures in RKWard depend on "external" packages (obtained from <link href="http://cran.r-project.org/">The Comprehensive R Archive Network (CRAN)</link>) to perform a task.
 
 		Here is an example. All tests related to <link href="rkward://rhelp/moments">skewness</link> and <link href="rkward://rhelp/moments">kurtosis</link> (which you would certainly expect to be shipped as a base package of R) are performed from an external package. If you read this the first time or restarted RKWard after you installed it and try to follow the link you will be out of luck. First you need to run a test from Analysis->Moment in order to achieve this.
 
 		Typically you would call them from R via <link href="rkward://rhelp/update.packages">update.packages</link> and <link href="rkward://rhelp/library">library</link> to achieve this. But RKWard simplifies this for you. You'll be guided through the install procedure for the required package. Please note you need root privileges in certain situations.
 	</section>
-	<section title="RKWard is running since ages. Has it hung up?" id="hung_up_problems">
+	<section title="RKWard is running since ages. Has it hung up?" shorttitle="RKWard seems to hang" id="hung_up_problems">
 		This depends. Some test and plots just need some time if you have huge amounts of data or sophisticated calculations. Therefore patience is sometimes needed.
 
 		But some statistical test are rather memory and stack hungry and can make the entire system unresponsive, if there is a lot of swapping. Please refere to <link href="http://cran.r-project.org/doc/Rnews/Rnews_2001-1.pdf">RNews 2001/1, pg. 10</link> for more information. Therefore, this is neither a bug in RKWard (most likely at least) nor in R but due to the statistical test itself.
@@ -30,7 +30,7 @@
 
 		Therefore it's important you know the test. Moreover it's very important to save the workspace and other sections you worked on before you do such operations. There is currently no recovery functionality within RKWard in case of a crash! You can find build-in tests from R to address this memory issue but these work on Windows(TM) platforms only (see: <link href="rkward://rhelp/memory.size">Memory Size</link>, <link href="rkward://rhelp/limit">Memory Limit</link> and <link href="http://finzi.psych.upenn.edu/R/library/base/html/Memory.html">Memory Available for Data Storage</link>). Sorry to say, this means there is no way for the RKWard developers to build a routine which does a "memory check" before a test is run.
 	</section>
-	<section title="I think I did something wrong? Where is 'Undo' and 'Redo'?" id="undo_redo_problems">
+	<section title="I think I did something wrong? Where is 'Undo' and 'Redo'?" shorttitle="Undo/Redo" id="undo_redo_problems">
 		Right now RKWard doesn't have any "undo" or "redo" functionality. Therefore it's important that you know what you do before you start. It's recommended to use copies of original data and to give everything a meaningful name.
 
 		However, RKWard tries to give you as much information as possible about things you have done. For example all test and plots show the specific settings in combination with the creation date. Moreover you can check and copy any code generated for your documentation purposes

Modified: trunk/rkward/rkward/windows/rkhtmlwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhtmlwindow.cpp	2007-03-08 22:52:17 UTC (rev 1555)
+++ trunk/rkward/rkward/windows/rkhtmlwindow.cpp	2007-03-09 12:01:32 UTC (rev 1556)
@@ -475,21 +475,22 @@
 		// render the sections
 		element = help_xml->getChildElement (help_doc_element, "summary", DL_INFO);
 		if (!element.isNull ()) {
-			khtmlpart->write (startSection ("summary", i18n ("Summary"), &anchors, &anchornames));
+			khtmlpart->write (startSection ("summary", i18n ("Summary"), QString (), &anchors, &anchornames));
 			khtmlpart->write (renderHelpFragment (element));
 		}
 
 		element = help_xml->getChildElement (help_doc_element, "usage", DL_INFO);
 		if (!element.isNull ()) {
-			khtmlpart->write (startSection ("usage", i18n ("Usage"), &anchors, &anchornames));
+			khtmlpart->write (startSection ("usage", i18n ("Usage"), QString (), &anchors, &anchornames));
 			khtmlpart->write (renderHelpFragment (element));
 		}
 
 		XMLChildList section_elements = help_xml->getChildElements (help_doc_element, "section", DL_INFO);
 		for (XMLChildList::iterator it = section_elements.begin (); it != section_elements.end (); ++it) {
 			QString title = help_xml->getStringAttribute (*it, "title", QString (), DL_WARNING);
+			QString shorttitle = help_xml->getStringAttribute (*it, "shorttitle", QString (), DL_DEBUG);
 			QString id = help_xml->getStringAttribute (*it, "id", QString (), DL_WARNING);
-			khtmlpart->write (startSection (id, title, &anchors, &anchornames));
+			khtmlpart->write (startSection (id, title, shorttitle, &anchors, &anchornames));
 			khtmlpart->write (renderHelpFragment (*it));
 		}
 
@@ -497,7 +498,7 @@
 		if (for_component) {
 			element = help_xml->getChildElement (help_doc_element, "settings", DL_INFO);
 			if (!element.isNull ()) {
-				khtmlpart->write (startSection ("settings", i18n ("GUI settings"), &anchors, &anchornames));
+				khtmlpart->write (startSection ("settings", i18n ("GUI settings"), QString (), &anchors, &anchornames));
 				XMLChildList setting_elements = help_xml->getChildElements (element, QString (), DL_WARNING);
 				for (XMLChildList::iterator it = setting_elements.begin (); it != setting_elements.end (); ++it) {
 					if ((*it).tagName () == "setting") {
@@ -525,7 +526,7 @@
 		// "related" section
 		element = help_xml->getChildElement (help_doc_element, "related", DL_INFO);
 		if (!element.isNull ()) {
-			khtmlpart->write (startSection ("related", i18n ("Related functions and pages"), &anchors, &anchornames));
+			khtmlpart->write (startSection ("related", i18n ("Related functions and pages"), QString (), &anchors, &anchornames));
 			khtmlpart->write (renderHelpFragment (element));
 		}
 
@@ -637,11 +638,12 @@
 	return (RKComponentMap::getComponentHandle (path_segments.join ("::")));
 }
 
-QString RKHelpWindow::startSection (const QString &name, const QString &title, QStringList *anchors, QStringList *anchor_names) {
+QString RKHelpWindow::startSection (const QString &name, const QString &title, const QString &shorttitle, QStringList *anchors, QStringList *anchor_names) {
 	QString ret = "<a name=\"" + name + "\">";
 	ret.append ("<h2>" + title + "</h2>\n");
 	anchors->append (name);
-	anchor_names->append (title);
+	if (!shorttitle.isNull ()) anchor_names->append (shorttitle);
+	else anchor_names->append (title);
 	return (ret);
 }
 

Modified: trunk/rkward/rkward/windows/rkhtmlwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkhtmlwindow.h	2007-03-08 22:52:17 UTC (rev 1555)
+++ trunk/rkward/rkward/windows/rkhtmlwindow.h	2007-03-09 12:01:32 UTC (rev 1556)
@@ -168,7 +168,7 @@
 	QString renderHelpFragment (QDomElement &fragment);
 	void prepareHelpLink (QDomElement *link_element);
 	RKComponentHandle *componentPathToHandle (QString path);
-	QString startSection (const QString &name, const QString &title, QStringList *anchors, QStringList *anchor_names);
+	QString startSection (const QString &name, const QString &title, const QString &shorttitle, QStringList *anchors, QStringList *anchor_names);
 };
 
 #endif


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list