diff options
author | Ole Loots <ole@monochrom.net> | 2012-06-23 00:17:57 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2012-06-23 00:17:57 +0000 |
commit | bf279973126b01027dc4f40bc00e9b1499984f99 (patch) | |
tree | 6d36e875fc4e1815a83d6e1502aa6a25167a139e /atari | |
parent | ad656167dc66d8474eeef01ba14d7a053fecec9b (diff) | |
download | netsurf-bf279973126b01027dc4f40bc00e9b1499984f99.tar.gz netsurf-bf279973126b01027dc4f40bc00e9b1499984f99.tar.bz2 |
Show alert when no editor option is configured.
svn path=/trunk/netsurf/; revision=13985
Diffstat (limited to 'atari')
-rw-r--r-- | atari/ctxmenu.c | 14 |
1 files changed, 8 insertions, 6 deletions
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;
|