Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

Tasklist

FS#4864 - text editor for rockbox

Attached to Project: Rockbox
Opened by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 14:09 GMT+2
Task Type Patches
Category Plugins
Status Closed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Private No

Details

just a very simple text editor for rockbox..
ok, so the way this works is its a really simple line based editor.. load the file from the open with menu and it will display the whole file in the list (max line length is 128, and max lines is 1024, so 128kb which should fit nicely in all the targets plugin buffer cept the archos..)

press select to goto the keyboard and edit the current line (iriver: NAVI/middle button, ipod: select).
press menu to get a list of things u can do (iriver:a-b button, ipod:menu)
hopefully all the menu items are easy enough to understand...
pressing delete (iriver:rec, ipod:left) will remove the line and put it on the "clipboard" so u can paste it from the menu (use the insert before/after item)
and lastly, press exit (iriver: off, ipod:menu+select) to exit, you'll get a menu asking u if u want to save if the file has been changed.

the reason why ive only mentioned ipod and iriver keys is coz i dont know whats good on the other targets, so if u have an idea please reply with key combos.. (the delete button is optional, the rest are required).
(application/octet-stream)    text_ed.patch (19.5 KiB)
 gui/list.c             |    9 -
 gui/list.h             |    6 
 plugin.c               |   21 ++
 plugin.h               |   24 ++
 plugins/SOURCES        |    1 
 plugins/text_editor.c  |  436 +++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/viewers.config |    1 
 7 files changed, 492 insertions(+), 6 deletions(-)

This task depends upon

Closed by  Hristo Kovachev (bger)
Monday, 03 April 2006, 10:52 GMT+2
Reason for closing:  Accepted
Comment by Robert Kukla (roolku) - Monday, 20 March 2006, 14:20 GMT+2
Just to say that I have been using it for a while it find it extremly useful.
There seems to be a bug with 'cut' though (unless it has been fixed in this version - will try when I get home), It seems to fill the whole text buffer with the lines above the cursor. i.e.

line 1
line 2
line 3 <- cursor
line 4
line 5

will become:

line 1
line 2
line 1
line 2
line 1

Also as mentioned in my forum post, I would love to be able to break/join lines of text.

Cheers
Roolku
Comment by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 14:24 GMT+2
ah, damn.. ok, ye, just tested and that bug still exsists... ill have a look..
you can join lines now (use the cat to above menu item), but not split a line.. i cant tihnk of a nice, logical way to do it (ui wise)...
Comment by Jonathan Gordon (jdgordon) - Monday, 20 March 2006, 14:34 GMT+2
well.. that was a simple fix :p
new patch attached
(application/octet-stream)    text_ed.patch (19.5 KiB)
 gui/list.c             |    9 -
 gui/list.h             |    6 
 plugin.c               |   21 ++
 plugin.h               |   24 ++
 plugins/SOURCES        |    1 
 plugins/text_editor.c  |  436 +++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/viewers.config |    1 
 7 files changed, 492 insertions(+), 6 deletions(-)

Comment by Jonathan Gordon (jdgordon) - Tuesday, 21 March 2006, 11:49 GMT+2
ok, updated again.. you can now spliut a line into 2... i hate how ive done it, but i couldnt get any better way to work.. (i dont think its going to be used very often, so no big deal.)
to split a line, go into the menu, choose split line, then u need to remove the end of the line, the removed text then becomes the next line (inserted as a new line.. doesnt overwrite the cureent next line.)
(application/octet-stream)    text_ed.diff (19.6 KiB)
 gui/list.c             |    9 
 gui/list.h             |    6 
 plugin.c               |   20 ++
 plugin.h               |   26 ++
 plugins/SOURCES        |    1 
 plugins/text_editor.c  |  445 +++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/viewers.config |    1 
 7 files changed, 499 insertions(+), 9 deletions(-)

Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 18:13 GMT+2
This doesn't work with current cvs anymore. :(

Any chance to have it updated (or even included in cvs)?

Thanks a lot!

Comment by Paul van der Heu (paulheu) - Sunday, 02 April 2006, 18:16 GMT+2
No problems here.. what is wrong for you?
Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 18:22 GMT+2
This is what I get with the patch Tuesday, 21 March 2006, 11:49AM:

$ patch -p0 < text_ed.patch
patching file apps/plugin.c
Hunk #1 FAILED at 411.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugin.c.rej
patching file apps/plugin.h
Hunk #1 FAILED at 479.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugin.h.rej
patching file apps/gui/list.c
patching file apps/gui/list.h
patching file apps/plugins/SOURCES
Hunk #1 FAILED at 16.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugins/SOURCES.rej
patching file apps/plugins/text_editor.c
patching file apps/plugins/viewers.config
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file apps/plugins/viewers.config.rej
Comment by Paul van der Heu (paulheu) - Sunday, 02 April 2006, 18:24 GMT+2
So you open the .rej file and put the changes in place manually
Comment by Robert Kukla (roolku) - Sunday, 02 April 2006, 19:18 GMT+2
That is what I wanted to avoid doing, hence my request for an updated patch.

Since you have already gone through the process, would you consider creating a patch for the benefit of others?

Thank you
Comment by Jonathan Gordon (jdgordon) - Monday, 03 April 2006, 01:05 GMT+2
updated patch coming later this arvo
Comment by Jonathan Gordon (jdgordon) - Monday, 03 April 2006, 08:50 GMT+2
ok, here we go...
updated for the latest cvs... except i updated the wrong patch file, so the line splitting isnt in this version (good thing, coz i didnt like how it was being done anyway, ill submit a patch later with a better way if this makes it in before the free).

it needs button definitions for all targets except ipod and iriver, each target needs 3 buttons, select, menu, and quit/cancel....

(application/octet-stream)    text_editor.patch (19.7 KiB)
 gui/list.c             |    8 
 gui/list.h             |    6 
 plugin.c               |   20 ++
 plugin.h               |   29 +++
 plugins/SOURCES        |    1 
 plugins/text_editor.c  |  437 +++++++++++++++++++++++++++++++++++++++++++++++++
 plugins/viewers.config |    3 
 7 files changed, 495 insertions(+), 9 deletions(-)

Loading...