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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Thu Mar 15 18:54:44 UTC 2007


Revision: 1587
          http://svn.sourceforge.net/rkward/?rev=1587&view=rev
Author:   tfry
Date:     2007-03-15 11:54:44 -0700 (Thu, 15 Mar 2007)

Log Message:
-----------
Make plugin code preview read-only

Modified Paths:
--------------
    trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp
    trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
    trunk/rkward/rkward/windows/rkcommandeditorwindow.h

Modified: trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp	2007-03-15 18:04:31 UTC (rev 1586)
+++ trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp	2007-03-15 18:54:44 UTC (rev 1587)
@@ -220,12 +220,14 @@
 void RKStandardComponentGUI::updateCodeNow () {
 	RK_TRACE (PLUGIN);
 
+	code_display->setReadOnly (false);	// sigh. The kate part does not allow setting text programatically, when it is read only
 	if (!code_property->isValid ()) {
 		code_display->setText (i18n ("Processing. Please wait"));
 		RK_DO (qDebug ("code not ready to be displayed: pre %d, cal %d, pri %d", !code_property->preprocess ().isNull (), !code_property->calculate ().isNull (), !code_property->printout ().isNull ()), PLUGIN, DL_DEBUG);
 	} else {
 		code_display->setText ("local({\n" + code_property->preprocess () + code_property->calculate () + code_property->printout () + "})\n");
 	}
+	code_display->setReadOnly (true);
 }
 
 ///////////////////////////////// RKStandardComponentWizard /////////////////////////////////

Modified: trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp	2007-03-15 18:04:31 UTC (rev 1586)
+++ trunk/rkward/rkward/windows/rkcommandeditorwindow.cpp	2007-03-15 18:54:44 UTC (rev 1587)
@@ -163,11 +163,17 @@
 	m_view->copy ();
 }
 
+void RKCommandEditorWindow::setReadOnly (bool ro) {
+	RK_TRACE (COMMANDEDITOR);
+
+	m_doc->setReadWrite (!ro);
+}
+
 bool RKCommandEditorWindow::openURL (const KURL &url, bool use_r_highlighting, bool read_only){
 	RK_TRACE (COMMANDEDITOR);
 	if (m_doc->openURL (url)){
 		if (use_r_highlighting) setRHighlighting ();
-		m_doc->setReadWrite (!read_only);
+		setReadOnly (read_only);
 
 		updateCaption ();
 

Modified: trunk/rkward/rkward/windows/rkcommandeditorwindow.h
===================================================================
--- trunk/rkward/rkward/windows/rkcommandeditorwindow.h	2007-03-15 18:04:31 UTC (rev 1586)
+++ trunk/rkward/rkward/windows/rkcommandeditorwindow.h	2007-03-15 18:54:44 UTC (rev 1587)
@@ -100,6 +100,8 @@
 
 	QString getDescription ();
 
+	void setReadOnly (bool ro);
+
 /** Return current url */
 	KURL url ();
 


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