[rkward-cvs] rkward/rkward/agents showedittextfileagent.cpp,NONE,1.1 showedittextfileagent.h,NONE,1.1 Makefile.am,1.2,1.3

Thomas Friedrichsmeier tfry at users.sourceforge.net
Tue Sep 13 16:08:36 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/agents
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28290/agents

Modified Files:
	Makefile.am 
Added Files:
	showedittextfileagent.cpp showedittextfileagent.h 
Log Message:
Compilation fixes. Adding unfinished ShowEditTextFileAgent

--- NEW FILE: showedittextfileagent.h ---
/***************************************************************************
                          showedittextfileagent  -  description
                             -------------------
    begin                : Tue Sep 13 2005
    copyright            : (C) 2005 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 SHOWEDITTEXTFILEAGENT_H
#define SHOWEDITTEXTFILEAGENT_H

#include <qobject.h>

struct RCallbackArgs;

/** The purpose of this agent is to display text files for showing and/or editing on request of the R backend. Technically speaking, it gets invoked, whenever the standard R callbacks (ptr_)R_ShowFiles, (ptr_)R_EditFiles, or (ptr_)R_EditFile are called. While the task of simply opening such files for display/editing is rather simple, there is one slightly more difficult issue involved (and hence this class to handle it): In standard R, all these calls are blocking further processing, until the user has closed the shown/edited files. In some cases this may be necessary (for instance if R wants to use with the edited files immediately), in some cases this is an unneccessary nuisance (such as when R simply wants to display a help page or some other purely informational text).

The solution to this, used in this agent, is to display a non-modal dialog with a "Done"-button, and thereby leave the decision to the user. Whenever the user thinks, it's safe to resume processing, the "Done"-button can be pressed, even if the files are still open. Until that time, processing is halted.

You probably don't want to create an instance of this agent directly. Rather use the static showEditFiles ().

@author Thomas Friedrichsmeier
*/
class ShowEditTextFileAgent : public QObject {
	Q_OBJECT
public:
	ShowEditTextFileAgent (QObject *parent = 0);

/** destructor */
	~ShowEditTextFileAgent ();

/** This gets called by RInterface, in order to show/edit the files in question. The RCallbackArgs-struct is passed in raw form, and only this function sorts
out, what exactly needs to be done. Note that this is a static member. It will take care of creating/deleting an agent on its own. */
	static showEditFiles (RCallbackArgs *args);
};

#endif

Index: Makefile.am
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/agents/Makefile.am,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** Makefile.am	5 Sep 2004 21:21:51 -0000	1.2
--- Makefile.am	13 Sep 2005 16:08:34 -0000	1.3
***************
*** 2,5 ****
  METASOURCES = AUTO
  noinst_LIBRARIES =  libagents.a
! noinst_HEADERS = rksaveagent.h rkloadagent.h
! libagents_a_SOURCES = rksaveagent.cpp rkloadagent.cpp
--- 2,5 ----
  METASOURCES = AUTO
  noinst_LIBRARIES =  libagents.a
! noinst_HEADERS = rksaveagent.h rkloadagent.h showedittextfileagent.h
! libagents_a_SOURCES = rksaveagent.cpp rkloadagent.cpp showedittextfileagent.cpp

--- NEW FILE: showedittextfileagent.cpp ---
/***************************************************************************
                          showedittextfileagent  -  description
                             -------------------
    begin                : Tue Sep 13 2005
    copyright            : (C) 2005 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 "showedittextfileagent.h"

ShowEditTextFileAgent::ShowEditTextFileAgent(QObject *parent, const char *name)
 : QObject(parent, name)
{
}


ShowEditTextFileAgent::~ShowEditTextFileAgent()
{
}


#include "showedittextfileagent.moc"





More information about the rkward-tracker mailing list