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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue Feb 27 00:34:46 UTC 2007


Revision: 1494
          http://svn.sourceforge.net/rkward/?rev=1494&view=rev
Author:   tfry
Date:     2007-02-26 16:34:46 -0800 (Mon, 26 Feb 2007)

Log Message:
-----------
Make rkreadlinedialog store size and position and restore that on the next show (at least approximately)
Makes debug() much more bearable

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/dialogs/rkreadlinedialog.cpp
    trunk/rkward/rkward/dialogs/rkreadlinedialog.h

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2007-02-26 23:16:10 UTC (rev 1493)
+++ trunk/rkward/ChangeLog	2007-02-27 00:34:46 UTC (rev 1494)
@@ -1,3 +1,4 @@
+- make readline dialog store last size and position
 - new outlier test (chisq.out.test, dixon.test, grubbs.test, outlier)
 - support R's mechanism for checking the C stack limits (only with R 2.3.x or greater, and not on all platforms)
 - support of all tests from moments package

Modified: trunk/rkward/rkward/dialogs/rkreadlinedialog.cpp
===================================================================
--- trunk/rkward/rkward/dialogs/rkreadlinedialog.cpp	2007-02-26 23:16:10 UTC (rev 1493)
+++ trunk/rkward/rkward/dialogs/rkreadlinedialog.cpp	2007-02-27 00:34:46 UTC (rev 1494)
@@ -2,7 +2,7 @@
                           rkreadlinedialog  -  description
                              -------------------
     begin                : Fri Sep 15 2006
-    copyright            : (C) 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -30,6 +30,8 @@
 
 #include "../debug.h"
 
+QRect RKReadLineDialog::stored_geom;
+
 RKReadLineDialog::RKReadLineDialog (QWidget *parent, const QString &caption, const QString &prompt, RCommand *command) : KDialogBase (parent, 0, true, caption, KDialogBase::Ok | KDialogBase::Cancel) {
 	RK_TRACE (DIALOGS);
 	RK_ASSERT (command);
@@ -74,8 +76,10 @@
 	RK_ASSERT (result);
 
 	RKReadLineDialog *dialog = new RKReadLineDialog (parent, caption, prompt, command);
+	if (!stored_geom.isNull ()) dialog->setGeometry (stored_geom);
 	int res = dialog->exec ();
 	*result = dialog->input->text ();
+	stored_geom = dialog->frameGeometry ();
 	delete dialog;
 
 	return (res != QDialog::Rejected);

Modified: trunk/rkward/rkward/dialogs/rkreadlinedialog.h
===================================================================
--- trunk/rkward/rkward/dialogs/rkreadlinedialog.h	2007-02-26 23:16:10 UTC (rev 1493)
+++ trunk/rkward/rkward/dialogs/rkreadlinedialog.h	2007-02-27 00:34:46 UTC (rev 1494)
@@ -2,7 +2,7 @@
                           rkreadlinedialog  -  description
                              -------------------
     begin                : Fri Sep 15 2006
-    copyright            : (C) 2006 by Thomas Friedrichsmeier
+    copyright            : (C) 2006, 2007 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -31,11 +31,6 @@
 */
 class RKReadLineDialog : public KDialogBase {
 public:
-	/** ctor. Use the static readLine() instead. */
-	RKReadLineDialog (QWidget *parent, const QString &caption, const QString &prompt, RCommand *command);
-	/** destructor */
-	~RKReadLineDialog ();
-
 	/** Construct and run modal RKReadLineDialog.
 	@param parent QWidget to center the modal dialog on (0 for application)
 	@param prompt The question
@@ -43,8 +38,14 @@
 	@param result The answer to the question (the line read) will be stored in this string
 	@returns true if ok was pressed (or the dialog was closed), false if cancel was pressed (i.e. the command should be cancelled) */
 	static bool readLine (QWidget *parent, const QString &caption, const QString &prompt, RCommand *command, QString *result);
+protected:
+	/** ctor. Use the static readLine() instead. */
+	RKReadLineDialog (QWidget *parent, const QString &caption, const QString &prompt, RCommand *command);
+	/** destructor */
+	~RKReadLineDialog ();
 private:
 	QLineEdit *input;
+	static QRect stored_geom;
 };
 
 #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