From bf279973126b01027dc4f40bc00e9b1499984f99 Mon Sep 17 00:00:00 2001 From: Ole Loots Date: Sat, 23 Jun 2012 00:17:57 +0000 Subject: Show alert when no editor option is configured. svn path=/trunk/netsurf/; revision=13985 --- atari/ctxmenu.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'atari/ctxmenu.c') diff --git a/atari/ctxmenu.c b/atari/ctxmenu.c index 8f7e9b9ff..2acf61ca4 100644 --- a/atari/ctxmenu.c +++ b/atari/ctxmenu.c @@ -150,6 +150,7 @@ void context_popup( struct gui_window * gw, short x, short y ) FILE * fp_tmpfile; char * tempfile; int err = 0; + char * editor; char cmdline[128]; pop = get_tree( POP_CTX ); @@ -224,7 +225,7 @@ void context_popup( struct gui_window * gw, short x, short y ) if( ctx->ccdata.link_url != NULL ) { browser_window_download( gw->browser->bw, - nsurl_access(ctx->ccdata.link_url), + nsurl_access((const char*)ctx->ccdata.link_url), nsurl_access(hlcache_handle_get_url(gw->browser->bw->current_content)) ); } @@ -256,8 +257,9 @@ void context_popup( struct gui_window * gw, short x, short y ) } break; - case POP_CTX_VIEW_SOURCE: - if( nsoption_charp(atari_editor) != NULL ) { + case POP_CTX_VIEW_SOURCE: + editor = nsoption_charp(atari_editor); + if( editor != NULL && strlen(editor)>0 ) { data = content_get_source_data( gw->browser->bw->current_content, &size ); if( size > 0 && data != NULL ){ tempfile = tmpnam( NULL ); @@ -271,8 +273,8 @@ void context_popup( struct gui_window * gw, short x, short y ) sprintf((char*)&cmdline, "%s \"%s\"", nsoption_charp(atari_editor), tempfile ); system( (char*)&cmdline ); */ - err = ShelWrite( nsoption_charp(atari_editor), tempfile , nsoption_charp(atari_editor), 1, 0); - LOG(("Launched: %s %s (%d)\n", nsoption_charp(atari_editor), tempfile, err )); + err = ShelWrite( editor, tempfile , editor, 1, 0); + LOG(("Launched: %s %s (%d)\n", editor, tempfile, err )); } else { printf("Could not open temp file: %s!\n", tempfile ); } @@ -281,7 +283,7 @@ void context_popup( struct gui_window * gw, short x, short y ) LOG(("Invalid content!")); } } else { - printf("Please set option_atari_editor!"); + form_alert(0, "[1][Set option \"option_atari_editor\".][OK]"); } break; -- cgit v1.2.3