The following list of TODO-items is NOT complete!
Also, plans change frequently. If something is listed for a specific release, that's no more than a rough plan.
All in all, this TODO list is mostly for internal purposes, and many parts may not necessarily be intellegible to anybody but the authors.

Important:
	- Around March 1st, write to R-devel to achieve having IS_UTF8 and IS_LATIN1 in public API (if not already available, then).
		- Is Rf_translateChar() what we are looking for?

Should be fixed for 0.4.9:
	- make rk.results work with matrices
		- use in crosstabs n to 1 plugin

Advertizing:
	- start being a bit bolder about RKWard (descriptions, startup notification, etc.)

Bugs:
	- "cannot create html package index" when installing package as a regular user (due to R.home ("doc") not writable)
	- There is definitely a memory leak in handling output!
		- Produce lots and lots of output -> watch mem usage grow
		- Probably the RKConsole is to blame (run outside console -> no significant increase)
			- Maybe the kate-part needs to be reset (syntax parse tree) every once in a while?
	- rnorm () and friends auto-print value only once. R_Visible is 0 on subsequent calls (what in the world is going on, here?)
	- RKEditorDataFrame:
		- sometimes the current cell indicator (the box around the current cell) gets lost.
			- Navigation and editing is still fine
			- seems to happen more often with larger data frames
			- more precisely: seems to happen after scrolling
			- no idea, why this happens
	- Quitting via q() in the R console will often lead to a segfault during shutdown

Compilation / technical
	- Incorporate FreeBSD patches http://www.freshports.org/math/rkward/files.php?message_id=200609172111.k8HLBiob081349@repoman.freebsd.org
	- cleanup DISABLE_RKWINDOWCATCHER (either get rid of it, or do it right)

UI-stuff
	- find/create a set of menu icons (https://sourceforge.net/mailarchive/message.php?msg_id=37891606)
	- "First-run wizard"
		- pre-install R packages
	- Snippets library
		- pre-defined snippets to base scripts on
		- custom snippets
		- can be categorized by keywords / search
	- Check for existence of php binary on startup, not only when loading a plugin
	- RKEditorDataFrame
		- undo/redo
			- KDE4
		- deletion of multiple columns in one step
		- when pasting a large array, rows should not be added one by one. Suggested algorithm:
			- if we find out we've already pasted 100 rows, first check, how many more are to come and add this many both to the variable and to the R workspace. Can potentially avoid *lots* of work
	- Twintable/RKEditorDataFrame
		- merge the two classes
		- more efficient syncing: fetch only the values actually needed instead of the whole table. How?
		- make configurable:
			- invalid color (global and per variable)
			- unused color (global and per variable)
			- default alignment (per var type)
			- default precision
			- display of factor level labels (global and per variable)
				- might default to "only for factors"
			- delay of factor-level popup
		- highlighting of value ranges
	- Create an editor for single vectors/factors, or rework RKEditorDataFrame to handle those as well
	- Rework package management dialog
		- the UI should probably be simplified somehow. But how? All in a single list with "filter"? Ask for ideas/look at other apps
			- this will be very hard to do with the current Qt. We'd really need several checkboxes *within* a QListViewItem. Tackle this when/after porting to Qt4
		- add option to remove packages
		- smooth handling of updating packages installed in different repositories
		- auto-updating functionality (every x days, every new session, never; see https://sourceforge.net/mailarchive/message.php?msg_id=37960665)
	- RObjectListView
		- use better icons to mark up the different base types
		- double click action should be configurable: View, Edit, insert name into current script, insert name into console, nothing
		- context menu action "detach" for package environments (probably with a warning, at least for base packages)
	- RKConsole:
		- Console should start a command chain when submitting a batch of pasted commands
		- Better yet, the commands might be autosplit in the backend. Need to think about how to design this correctly, though
		- Allow pasting at other positions than line end
		- Prevent cursor from venturing into lines other than the last line
		- When inside a string, should offer tab-completion for system paths (will maybe have to wait for KDE4, when we get better clues, what context we are currently in)
		- Allow multi-line command editing?
	- Script editor:
		- new action "Run Toplevel expression" (see https://sourceforge.net/mailarchive/forum.php?thread_id=31463482&forum_id=12970)
		- new action "Source file"
	- RKConsole / Script editor:
		- highlight only valid function names
	- RKHelpDlg:
		- in the mid term, this should probably be renamed and moved to windows
		- call .rk.get.installed.packages, and update package selection drop down on every show, but not on startup? Really? Maybe both.
	- RKVarslot:
		- allow "save as" selection mode (i.e. new object names, or selection of existing symbol) -> RKSaveObjectChooser
	- RKVarselector:
		- pop-up-able selectors (maybe more generic, not only for varselectors): Like a "Browse" button
	- RKCommandLog:
		- optionally keep a file log!
	- hot-key/permanent icon to cancel current command / hold processing. Perhaps in the busy/idle indicator?
	- find out how to save toolbar states properly in parts-GUI
		- also setting the toolbar state for all windows with that toolbar
	- David's usability items
	- use RKGlobals::marginHint (), RKGlobals::spacingHint () everywhere
	- from Ralf:
		- show first few values of vectors/scalars in tool-tip in workspace browser
	- Debugging functionality
		- ideally the whole thing: setting breakpoints, etc.
		- realistically, maybe we can override browser () or do_browser with something nicer
	- Preview of plots
		- Maybe use a button (along the submit / close / etc. buttons instead)?
		- The preview window should be a specialized RKCaughtWindow
			- It should show info on state (up to date / updating / error / etc).
	- Graphics Device List window
		- (see http://sourceforge.net/mailarchive/message.php?msg_id=37825223)
		- par (no.readonly=TRUE) and par () to fetch available parameters and determine read-only state
		- device list would only be fetched when opening the window, not kept up to date?
		- access to graphics device plugins
	- Help system
		- find a good way to open R help pages in the same window
		- open link in new tab, etc.
	- Working directory
		- show current wd in <browser>, somewhere
	- Settings UI:
		- see http://sourceforge.net/mailarchive/forum.php?thread_name=200703230304.43023.kapatp%40gmail.com&forum_name=rkward-devel
		- R-Backend-Settings:
			- the options should gain a "use default" checkbox to cope with changing R option defaults
	- UI geometry:
		- see https://sourceforge.net/mailarchive/forum.php?thread_name=200704181922.07780.michellang%40gmail.com&forum_name=rkward-devel
		- save size/proportions of R script file, R console, Workspace browser...
		- save attach/detach status of the windows
	- project/session handling: files, workspace, current working directory.
	- file system browser tab
		- a way to inline pdf/ps/jpg/png files like in KDevelop?
	- provide a menu action / shortcut to switch to the directory of the current script file.
	- Quitting:
		- instead of closing windows one by one, and asking to save changes if necessary, first list all windows that might need to be saved, let the user chose to save them, then close all windows without further questions.
	- RObjectViewer
		- also show the summary for objects
		- do some formatting to make it look nicer
		- make it an MDI window
		- add update buttons and such
			- on updating: if object has changed, display a note to that effect in the window
	- Vignettes:
		- Add a vignettes browser to the help menu
		- Add context menu with vignettes to package environments in object browser
			- likely, package environments should try to fetch vignettes, when "updating"

Internal stuff:
	- Workspace browser / code completion
		- we might make this a bit less pro-active:
			- only objects directly on the search path need to be fetched at once
			- children of these objects do not need to be investigated until we first try to access a child of the object.
			- i.e. RContainerobject::children() should handle fetching the child structure (numChildren() should probably be populated pro-actively).
			- isParentOf() should not be affected, as this can only be true for a child object that has previously been investigated
			- need to make sure, completions are not blocking
	- Handling fonts:
		- http://sourceforge.net/mailarchive/forum.php?thread_id=31631211&forum_id=12970
	- Look at package odfWeave, and find out, how to use this
		- replace remaining direct HTML fragments in plugins with wrapper calls
	- should we override bindingIsActive()?
	RKVariable:
		- True Support for Logicals
		- In the current design, RKVariable would not handle storage mode changes from outside well at all
		- use QIntDict instead of string-map for value-labels / factor levels? Qt4: QHash
	- call toplevel handlers for user/console commands?
	RCommandReceiver:
		- add virtual rCommandStarted () function, so receivers can find out, when their command becomes active
	REmbedInternal:
		- probably we do not need na_double at all (just any NaN) => less confusion
	Detecting object modifications inside R:
		- left TODO:
			- detection hole:
				x is 1
				user does
				rm (x); x <- function () {}
				(object list remains the same, watch was not active, but symbol changed)
				- will need to put an extra notification inside .rk.watch.globalenv ()? Will that get run?
	- RExpressionObject as an abstraction for R-Expressions (i.e. manually edited expressions).
		- It will be possible to "store" these in the RObjectList and select them just like any other object
		- RKVarslot will allow editing the selected value by hand (or just typing the name in)
			- How to do this nicely UI wise?
	- RKCancelDialog:
		- remove this class. Port to use RKProgressControl instead
	- RThread:
		- Detection of commands that run for a suspiciously long time
			- Show "do you want to cancel ..." option after configurable amount of time
	- use R_DirtyImage to determine, whether workspace needs to be saved
	- in REmbedInternal, add extractTemporaryStrings (), for strings that do not have to be copied
	- Object editing / modification tracking:
		- functions to set double/int/string-vectors directly. Use in paste-operations
	- error-handling/raising in .rk.do.call
	- I've changed the simple RInterface::issueCommand (QString, ...) command to return a pointer to the RCommand created. This will allow for lots of small cleanups. Do them.
		- well, on second thought, it might be better to rely more on RCommand::id () instead of pointers. Why? The id is unique (until integer overflow). The pointer may be reused after a delete -> potential problem when trying to cancel command which is actually already deleted (and potentially other cases)
		- let's set this back for a while
	- give informative feedback on syntax errors (line numbers, etc.)!
	- .rk.get.available.packages ()
		- use external (file) storage for cache to save mem
	- can the mutex be made non-recursive? I think so, but don't recall
	- When saving workplace layout, save it relative to the workspace file. Allows to move the workspace, easier
		- KURL::relativeUrl()
		- How to deal with workplaces saved in the config (and not bound to a workspace file?)

General code:
	- use constBegin (), constEnd ()
	- get rid of all the superflous dependencies: http://lists.debian.org/debian-devel/2005/12/msg00439.html
	- use more QDicts instead of QMap<QString,...>s
	- remove classes/files:
		- RKGlobals
			- static members should be moved to the respective classes. Much cleaner!

R plugins:
	- distribution plugins (probabilities and quantiles)
		- probably all these could use an option "Store result (to name) / Print result / print and store"
		- when changing this, they should first be changed to use common base functionality:
			- the tail, log, and print options would be in a single embedded plugin
			- a common PHP file would be included that generates uniform code (a small set of options would be needed to define the parts that are different across distributions)
			- something similar should be done for the plots
	- plugin help files:
		- It would be nice to add the <id="..."> fetaure like <settings id=".."> in the technical section too. Also may be add something like <tag=".."> for the tags or variable which can be in italics, grey color.
		- Find a way to make help searchable, preferentially within the R help search window
	- import plugins:
		- standardized? checkbox to open imported object for editing
			- would be nice, if this box could be affected (default) by a global setting
	- Generalized preview:
		- E.g. for data import plugins
	- Ability to pre-select some default values with a single option
	- Spinbox:
		- find a solution for "pending changes". Currently, if the user enters a value, manually, then presses submit, the old value will be used (the new value is only set, when the focus changes to another widget). Probably the RKSpinbox should emit signals for "pending" and "ready". The plugin spinbox should listen to those and not be satisfied as long as a change is pending. Maybe mark the spinbox in yellow, while a change is pending.
		- options min_inclusive / max_inclusive for real number spinboxes (defaulting to true)
	- use SVG device for graphics output
	- X11->Export:
		- provide SVG export option
	- provide context menu / other UI to export to different formats / edit
	- PHP-backend:
		- switch to KProcIO for easier logic
		- http://de3.php.net/manual/en/function.call-user-func.php seems to be faster than eval
		- find out why an error in the backend often leads to a subsequent crash
		- it might be possible to create only one "master" PHP process, and fork off child processes as needed from that (pcntl_fork() in PHP).
			- Do some timing, on how much faster this would actually be
			- The main drawback is that communication could no longer go via stdin/out, but some other mechanism would be needed. This would also mean ditching KProcess, and using perhaps QTcpServer/Socket.
	- plugins (general)
		- ODS filter (try to find someone to implement one in R)
	- formula-widget:
		- use smart sorting, esp. of generated string
		- add labels, add "up to level" option
		- add constant term option
	- multi-object option group:
		- provide the set of enclosed options for each of the selected variables
		- will provide dynamic properties based on which variables are selected in the source
		- how to determine default values?

Documentation:
	- add an example to show rkward-specific commands (rk.print, rk.graph)

API documentation:
	- add page containing a rough overview of general architecture
	- RCommandStack

Configuration:
	- additional console/log options:
		- color highlighting for warnings/errors
	- additional R engine options:
		- stack size (commandline arg --map-ppsize)
		- disable html help
	- new dataeditor options:
		- see comments on RKEditorDataFrame


################## Some internal notes below ##############

################## menu structure file/workspace ###########
File
	New
		Dataset
		Script File
	Open R Script File
	Open Recent (Script File)
	Save/Load R Objects
		Save
			...
		Load
			...
	Save
	Save As
	Reload
	Print
	Quit

Workspace
	Open Workspace
	Open Recent (Workspace)
	Save Workspace
	Save Workspace As
	Configure Packages (redundant)

How should this be changed? Maybe:

File
	New
		Dataset
		Script File
	Open R Script File
	Open Recent (Script File)
	Open Workspace
	Open Recent (Workspace)
	Import (previously Load R Objects)
	Export (previously Save R Objects)
	Save
	Save As
	Save Workspace
	Save Workspace As
	Reload
	Print
	Quit


################## cryptic notes ######################

translation of plugins and help files (no, this is not good, yet. Not modular, order gets messed up, context information is lacking. We need a dedicated simple parser that will understand the files it deals with, and extracts the strings with relevant context info).
in Makefil.am:
# experimental: extract all messages. Probably it would make sense to split this up, however, perhaps per .pluginmap, or per directory!
messages:
	extractrc `find . -name \*.rkh` --tag=title --tag=summary --tag=usage --tag=section --tag=related --tag=technical > messages.cpp
	extractattr `find . -name \*.rkh` --attr=section,title --attr=section,shorttitle >> messages.cpp
	extractattr `find . -name \*.pluginmap` --attr=component,label --attr=menu,label --attr=entry,label >> messages.cpp
	extractrc `find . -name \*.xml` --tag=text >> messages.cpp
	extractattr `find . -name \*.xml` --attr=dialog,label --attr=wizard,label --attr=tab,label --attr=page,label --attr=frame,label --attr=varselector,label --attr=varslot,label --attr=radio,label --attr=dropdown,label --attr=option,label --attr=checkbox,label --attr=spinbox,label --attr=browser,label --attr=saveobject,label --attr=formula,label >> messages.cpp
