1
0
Fork 0
forked from len0rd/rockbox
add playback menu to text editor, 
make the filename saving in rockpaint a bit better, automatically adds .bmp if its not there


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13993 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-07-26 08:04:28 +00:00
parent 6f66f0407f
commit cafffb5b65
2 changed files with 15 additions and 5 deletions

View file

@ -2491,8 +2491,13 @@ static void goto_menu(void)
break; break;
case MAIN_MENU_SAVE: case MAIN_MENU_SAVE:
if (!filename[0])
rb->strcpy(filename,"/");
if( !rb->kbd_input( filename, MAX_PATH ) ) if( !rb->kbd_input( filename, MAX_PATH ) )
{ {
if(rb->strlen(filename) <= 4 ||
rb->strcasecmp(&filename[rb->strlen(filename)-4], ".bmp"))
rb->strcat(filename, ".bmp");
save_bitmap( filename ); save_bitmap( filename );
rb->splash( 1*HZ, "File saved (%s)", filename ); rb->splash( 1*HZ, "File saved (%s)", filename );
} }

View file

@ -18,6 +18,7 @@
****************************************************************************/ ****************************************************************************/
#include "plugin.h" #include "plugin.h"
#include "action.h" #include "action.h"
#include "playback_control.h"
#if PLUGIN_BUFFER_SIZE > 0x45000 #if PLUGIN_BUFFER_SIZE > 0x45000
#define MAX_CHARS 0x40000 /* 128 kiB */ #define MAX_CHARS 0x40000 /* 128 kiB */
@ -465,27 +466,31 @@ enum plugin_status plugin_start(struct plugin_api* api, void* parameter)
if (changed) if (changed)
{ {
MENUITEM_STRINGLIST(menu, "Do What?", NULL, MENUITEM_STRINGLIST(menu, "Do What?", NULL,
"Return", "Save Changes", "Return",
"Show Playback Menu", "Save Changes",
"Save As...", "Save and Exit", "Save As...", "Save and Exit",
"Ignore Changes and Exit"); "Ignore Changes and Exit");
switch (rb->do_menu(&menu, NULL)) switch (rb->do_menu(&menu, NULL))
{ {
case 0: case 0:
break; break;
case 1: //save to disk case 1:
playback_control(rb);
break;
case 2: //save to disk
save_changes(1); save_changes(1);
changed = 0; changed = 0;
break; break;
case 2: case 3:
save_changes(0); save_changes(0);
changed = 0; changed = 0;
break; break;
case 3: case 4:
save_changes(1); save_changes(1);
exit=1; exit=1;
break; break;
case 4: case 5:
exit=1; exit=1;
break; break;
} }