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

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Apr 9 13:56:28 UTC 2007


Revision: 1793
          http://svn.sourceforge.net/rkward/?rev=1793&view=rev
Author:   tfry
Date:     2007-04-09 06:56:27 -0700 (Mon, 09 Apr 2007)

Log Message:
-----------
remove obsoleted RKRErrorDialog class (superceeded by RKProgressControl)

Modified Paths:
--------------
    trunk/rkward/rkward/misc/Makefile.am
    trunk/rkward/rkward/windows/rkwindowcatcher.cpp
    trunk/rkward/rkward/windows/rkwindowcatcher.h

Removed Paths:
-------------
    trunk/rkward/rkward/misc/rkerrordialog.cpp
    trunk/rkward/rkward/misc/rkerrordialog.h

Modified: trunk/rkward/rkward/misc/Makefile.am
===================================================================
--- trunk/rkward/rkward/misc/Makefile.am	2007-04-09 13:45:38 UTC (rev 1792)
+++ trunk/rkward/rkward/misc/Makefile.am	2007-04-09 13:56:27 UTC (rev 1793)
@@ -1,11 +1,11 @@
 INCLUDES = $(all_includes)
 METASOURCES = AUTO
 noinst_LIBRARIES =  libmisc.a
-libmisc_a_SOURCES = rkerrordialog.cpp rkspinbox.cpp \
+libmisc_a_SOURCES = rkspinbox.cpp \
 	getfilenamewidget.cpp rkobjectlistview.cpp rkcanceldialog.cpp xmlhelper.cpp \
 	multistringselector.cpp rkcommonfunctions.cpp rkprogresscontrol.cpp rksaveobjectchooser.cpp \
 	rkdummypart.cpp
-noinst_HEADERS = rkerrordialog.h rkspinbox.h getfilenamewidget.h \
+noinst_HEADERS = rkspinbox.h getfilenamewidget.h \
 	rkobjectlistview.h rkcanceldialog.h xmlhelper.h multistringselector.h \
 	rkcommonfunctions.h rkprogresscontrol.h rksaveobjectchooser.h \
 	rkdummypart.h

Deleted: trunk/rkward/rkward/misc/rkerrordialog.cpp
===================================================================
--- trunk/rkward/rkward/misc/rkerrordialog.cpp	2007-04-09 13:45:38 UTC (rev 1792)
+++ trunk/rkward/rkward/misc/rkerrordialog.cpp	2007-04-09 13:56:27 UTC (rev 1793)
@@ -1,133 +0,0 @@
-/***************************************************************************
-                          rkerrordialog  -  description
-                             -------------------
-    begin                : Fri Jul 30 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-#include "rkerrordialog.h"
-
-#include <qdialog.h>
-#include <qtextedit.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <klocale.h>
-
-#include "../debug.h"
-
-RKErrorDialog::RKErrorDialog (const QString &text, const QString &caption, bool modal) : QObject () {
-	RK_TRACE (MISC);
-
-	RKErrorDialog::text = text;
-	RKErrorDialog::caption = caption;
-	show_modal = modal;
-	dialog = 0;
-}
-
-RKErrorDialog::~RKErrorDialog () {
-	RK_TRACE (MISC);
-
-	// dialog deletes itself via Qt::WDestructiveClose!
-	//delete dialog;
-}
-
-void RKErrorDialog::newError (const QString &error) {
-	RK_TRACE (MISC);
-
-	if (!dialog) createDialog ();
-	error_log->append (error);
-}
-
-void RKErrorDialog::newOutput (const QString &output) {
-	RK_TRACE (MISC);
-	if (dialog) {
-		error_log->append (output);
-	} else {
-		stored_output.append (output);
-	}
-}
-
-void RKErrorDialog::resetOutput () {
-	RK_TRACE (MISC);
-	stored_output = QString::null;
-}
-
-void RKErrorDialog::dialogDestroyed () {
-	RK_TRACE (MISC);
-	dialog = 0;
-}
-
-void RKErrorDialog::createDialog () {
-	RK_TRACE (MISC);
-
-	dialog = new QDialog (0, 0, show_modal, Qt::WDestructiveClose);
-	dialog->setCaption (caption);
-	connect (dialog, SIGNAL (destroyed ()), this, SLOT (dialogDestroyed ()));
-	
-	QGridLayout *grid = new QGridLayout (dialog, 1, 1, 11, 6);
-	QVBoxLayout *vbox = new QVBoxLayout (0,0, 6);
-	grid->addLayout (vbox, 0, 0);
-	
-	QLabel *label = new QLabel (text, dialog);
-	label->setAlignment (Qt::AlignAuto | Qt::ExpandTabs | Qt::WordBreak);
-	vbox->addWidget (label);
-	
-	error_log = new QTextEdit (dialog);
-	error_log->setReadOnly (true);
-	error_log->append (stored_output);
-	stored_output = QString::null;
-	vbox->addWidget (error_log);
-	
-	dialog->show ();
-}
-
-////////////////////////////////////// RKRErrorDialog /////////////////////////////////////
-
-#include "../rbackend/rcommand.h"
-
-RKRErrorDialog::RKRErrorDialog (const QString &text, const QString &caption, bool modal) : RKErrorDialog (text, caption, modal) {
-	RK_TRACE (MISC);
-}
-
-RKRErrorDialog::~RKRErrorDialog () {
-	RK_TRACE (MISC);
-}
-
-void RKRErrorDialog::addRCommand (RCommand *command) {
-	RK_TRACE (MISC);
-
-	if (command->hasOutput ()) {
-		RKErrorDialog::newOutput (command->output ());
-	}
-
-	if (command->hasWarnings ()) {
-		newError (command->warnings ());
-	}
-
-	if (command->hasError ()) {
-		newError (command->error ());
-	}
-
-	if (command->errorSyntax ()) {
-		newError (i18n ("Syntax error"));
-	} else if (command->errorIncomplete ()) {
-		newError (i18n ("command incomplete"));
-	}
-}
-
-void RKRErrorDialog::rCommandDone (RCommand *command) {
-	RK_TRACE (MISC);
-
-	addRCommand (command);
-}
-
-#include "rkerrordialog.moc"

Deleted: trunk/rkward/rkward/misc/rkerrordialog.h
===================================================================
--- trunk/rkward/rkward/misc/rkerrordialog.h	2007-04-09 13:45:38 UTC (rev 1792)
+++ trunk/rkward/rkward/misc/rkerrordialog.h	2007-04-09 13:56:27 UTC (rev 1793)
@@ -1,76 +0,0 @@
-/***************************************************************************
-                          rkerrordialog  -  description
-                             -------------------
-    begin                : Fri Jul 30 2004
-    copyright            : (C) 2004, 2006 by Thomas Friedrichsmeier
-    email                : tfry at users.sourceforge.net
- ***************************************************************************/
-
-/***************************************************************************
- *                                                                         *
- *   This program is free software; you can redistribute it and/or modify  *
- *   it under the terms of the GNU General Public License as published by  *
- *   the Free Software Foundation; either version 2 of the License, or     *
- *   (at your option) any later version.                                   *
- *                                                                         *
- ***************************************************************************/
-#ifndef RKERRORDIALOG_H
-#define RKERRORDIALOG_H
-
-#include <qobject.h>
-
-#include <qstring.h>
-
-class QDialog;
-class QTextEdit;
-
-/**
-This class can be used to display errors (non-blocking). The dialog itself is only generated when there really are errors to display, otherwise the class is just a few QStrings waiting to be used. It's essentially useful in the case where error-messages may come in one by one: You simply call newError (...) - if the dialog is already being shown, the new error-messages simply get appended, so as not to clutter the desktop with loads of error-dialogs. if the dialog is not yet/no longer shown, it will be created/shown.
-
- at author Thomas Friedrichsmeier
-*/
-class RKErrorDialog : public QObject {
-	Q_OBJECT
-public:
-	RKErrorDialog (const QString &text, const QString &caption, bool modal=false);
-
-	virtual ~RKErrorDialog ();
-
-	void newError (const QString &error);
-/** usually you will call newError instead. However, if in case of an error, you also want to show the regular output, use this function to add output. The output is added to the internal error_log, but the dialog is not shown until you call newError (). */
-	void newOutput (const QString &output);
-/** you don't need this, unless you feed regular output to the dialog using newOutput. */
-	void resetOutput ();
-public slots:
-// so we can easily keep track of whether the dialog is alive or not
-	void dialogDestroyed ();
-private:
-	void createDialog ();
-
-	QDialog *dialog;
-	
-	QTextEdit *error_log;
-	
-	bool show_modal;
-	
-	QString text;
-	QString caption;
-	QString stored_output;
-};
-
-#include "../rbackend/rcommandreceiver.h"
-/** A subclass of RKErrorDialog, that has special helper functions to deal with RCommands. It can be set as the receiver of RCommands, or can be fed RCommands, and will extract any errors associated with those commands. */
-class RKRErrorDialog : public RKErrorDialog, public RCommandReceiver {
-public:
-/** constructor. See RKErrorDialog::RKErrorDialog () for details */
-	RKRErrorDialog (const QString &text, const QString &caption, bool modal=false);
-/** constructor. See RKErrorDialog::~RKErrorDialog () for details */
-	~RKRErrorDialog ();
-
-/** Use this mechanism to feed RCommands to the RKRErrorDialog manually. The alternative is to simply specify the error-dialog as the receiver of your RCommands (but then you'll never see them first). Errors contained in the command will be extracted. */
-	void addRCommand (RCommand *command);
-protected:
-	void rCommandDone (RCommand *command);
-};
-
-#endif

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2007-04-09 13:45:38 UTC (rev 1792)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.cpp	2007-04-09 13:56:27 UTC (rev 1793)
@@ -80,7 +80,7 @@
 #include "../rkglobals.h"
 #include "../rbackend/rinterface.h"
 #include "../core/robject.h"
-#include "../misc/rkerrordialog.h"
+#include "../misc/rkprogresscontrol.h"
 #include "../misc/rksaveobjectchooser.h"
 #include "../plugin/rkcomponentcontext.h"
 
@@ -90,7 +90,7 @@
 	embedded = window_to_embed;
 	RKCaughtX11Window::device_number = device_number;
 
-	error_dialog = new RKRErrorDialog (i18n ("An error occurred"), i18n ("An error occurred"));
+	error_dialog = new RKProgressControl (0, i18n ("An error occurred"), i18n ("An error occurred"), RKProgressControl::DetailedError);
 	setPart (new RKCaughtX11WindowPart (this));
 	initializeActivationSignals ();
 	setFocusPolicy (QWidget::ClickFocus);

Modified: trunk/rkward/rkward/windows/rkwindowcatcher.h
===================================================================
--- trunk/rkward/rkward/windows/rkwindowcatcher.h	2007-04-09 13:45:38 UTC (rev 1792)
+++ trunk/rkward/rkward/windows/rkwindowcatcher.h	2007-04-09 13:56:27 UTC (rev 1793)
@@ -80,7 +80,7 @@
 class QXEmbedCopy;
 class QScrollView;
 class QVBox;
-class RKRErrorDialog;
+class RKProgressControl;
 
 /** An R X11 device window managed by rkward. */
 class RKCaughtX11Window : public RKMDIWindow {
@@ -125,7 +125,7 @@
 	QVBox *xembed_container;
 	QScrollView *scroll_widget;
 	QVBox *box_widget;
-	RKRErrorDialog *error_dialog;
+	RKProgressControl *error_dialog;
 
 	bool dynamic_size;
 	KToggleAction *dynamic_size_action;


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