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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Sun Apr 1 13:56:09 UTC 2007


Revision: 1772
          http://svn.sourceforge.net/rkward/?rev=1772&view=rev
Author:   tfry
Date:     2007-04-01 06:56:08 -0700 (Sun, 01 Apr 2007)

Log Message:
-----------
Use correct dialog size, when code is shown by default

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

Modified: trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp	2007-03-30 23:08:31 UTC (rev 1771)
+++ trunk/rkward/rkward/plugin/rkstandardcomponentgui.cpp	2007-04-01 13:56:08 UTC (rev 1772)
@@ -43,6 +43,8 @@
 RKStandardComponentGUI::RKStandardComponentGUI (RKStandardComponent *component, RKComponentPropertyCode *code_property, bool enslaved) {
 	RK_TRACE (PLUGIN);
 
+	toggle_code_button = 0;
+
 	// create an error-dialog
 	error_dialog = new RKRErrorDialog (i18n ("The R-backend has reported one or more error(s) while processing the plugin '%1'.\nThis may lead to an incorrect output and is likely due to a bug in the plugin.\nA transcript of the error message(s) is shown below.").arg (component->getFilename ()), i18n ("R-Error"), false);
 
@@ -128,11 +130,21 @@
 	main_vbox->addWidget (code_display);
 
 	if (!enslaved && RKSettingsModulePlugins::showCodeByDefault ()) {
-		toggle_code_button->setOn (true);
+		toggle_code_button->setOn (true);	// will trigger showing the code along with the dialog
+	}
+}
+
+void RKStandardComponentGUI::show () {
+	RK_TRACE (PLUGIN);
+
+	QWidget::show ();
+
+	if (toggle_code_button) {	// this is a dialog, not  wizard
 		QTimer::singleShot (0, this, SLOT (toggleCode ()));
 	}
 }
 
+
 void RKStandardComponentGUI::ok () {
 	RK_TRACE (PLUGIN);
 
@@ -157,10 +169,11 @@
 
 void RKStandardComponentGUI::toggleCode () {
 	RK_TRACE (PLUGIN);
+	RK_ASSERT (toggle_code_button);
 
 	int new_height = height ();
 
-	if (!code_display->isShown ()) {
+	if (toggle_code_button->isOn()) {
 		new_height += RKSettingsModulePlugins::defaultCodeHeight ();
 		code_display->show ();
 	} else {

Modified: trunk/rkward/rkward/plugin/rkstandardcomponentgui.h
===================================================================
--- trunk/rkward/rkward/plugin/rkstandardcomponentgui.h	2007-03-30 23:08:31 UTC (rev 1771)
+++ trunk/rkward/rkward/plugin/rkstandardcomponentgui.h	2007-04-01 13:56:08 UTC (rev 1772)
@@ -84,6 +84,8 @@
 	void createDialog (bool switchable);
 	virtual void enableSubmit (bool enable);
 	virtual void updateCode ();
+/** reimplemented from QWidget to take care of showing the code display if needed */
+	void show ();
 public slots:
 	void ok ();
 	void cancel ();


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