Update to new warn_user API

This commit is contained in:
Chris Young 2016-05-01 14:00:47 +01:00
parent 67805f407f
commit 4d18947adb
14 changed files with 38 additions and 38 deletions

View File

@ -245,7 +245,7 @@ STATIC VOID rx_open(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[4], *(ULONG *)cmd->ac_ArgList[5]); gw = ami_find_tab(*(ULONG *)cmd->ac_ArgList[4], *(ULONG *)cmd->ac_ArgList[5]);
if (nsurl_create((char *)cmd->ac_ArgList[0], &url) != NSERROR_OK) { if (nsurl_create((char *)cmd->ac_ArgList[0], &url) != NSERROR_OK) {
warn_user("NoMemory", 0); amiga_warn_user("NoMemory", 0);
return; return;
} }
@ -513,7 +513,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
if(gw == NULL) return; if(gw == NULL) return;
if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) { if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) {
warn_user("NoMemory", 0); amiga_warn_user("NoMemory", 0);
} else { } else {
browser_window_navigate(gw->bw, browser_window_navigate(gw->bw,
url, url,

View File

@ -131,7 +131,7 @@ HOOKF(void, ami_ctxmenu_item_websearch, APTR, window, struct IntuiMessage *)
nsurl_unref(url); nsurl_unref(url);
} }
if (ret != NSERROR_OK) { if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0); amiga_warn_user(messages_get_errorcode(ret), 0);
} }
free(sel); free(sel);
@ -151,7 +151,7 @@ HOOKF(void, ami_ctxmenu_item_urlopentab, APTR, window, struct IntuiMessage *)
&bw); &bw);
if (error != NSERROR_OK) if (error != NSERROR_OK)
warn_user(messages_get_errorcode(error), 0); amiga_warn_user(messages_get_errorcode(error), 0);
} }
HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *) HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *)
@ -168,7 +168,7 @@ HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *)
&bw); &bw);
if (error != NSERROR_OK) if (error != NSERROR_OK)
warn_user(messages_get_errorcode(error), 0); amiga_warn_user(messages_get_errorcode(error), 0);
} }
HOOKF(void, ami_ctxmenu_item_urldownload, APTR, window, struct IntuiMessage *) HOOKF(void, ami_ctxmenu_item_urldownload, APTR, window, struct IntuiMessage *)

View File

@ -274,7 +274,7 @@ static void gui_download_window_done(struct gui_download_window *dw)
if(queuedl) { if(queuedl) {
nsurl *url; nsurl *url;
if (nsurl_create(dln2->node.ln_Name, &url) != NSERROR_OK) { if (nsurl_create(dln2->node.ln_Name, &url) != NSERROR_OK) {
warn_user("NoMemory", 0); amiga_warn_user("NoMemory", 0);
} else { } else {
browser_window_navigate(bw, browser_window_navigate(bw,
url, url,
@ -292,7 +292,7 @@ static void gui_download_window_done(struct gui_download_window *dw)
static void gui_download_window_error(struct gui_download_window *dw, static void gui_download_window_error(struct gui_download_window *dw,
const char *error_msg) const char *error_msg)
{ {
warn_user("Unwritten",""); amiga_warn_user("Unwritten","");
dw->result = AMINS_DLOAD_ERROR; dw->result = AMINS_DLOAD_ERROR;
gui_download_window_done(dw); gui_download_window_done(dw);
} }
@ -432,7 +432,7 @@ BOOL ami_download_check_overwrite(const char *file, struct Window *win, ULONG si
overwritetext = ASPrintf(messages_get("OverwriteFile")); overwritetext = ASPrintf(messages_get("OverwriteFile"));
} }
res = ami_warn_user_multi(overwritetext, "Replace", "DontReplace", win); res = amiga_warn_user_multi(overwritetext, "Replace", "DontReplace", win);
FreeVec(overwritetext); FreeVec(overwritetext);
} }
else return TRUE; else return TRUE;

View File

@ -97,7 +97,7 @@ void ami_file_open(struct gui_window_2 *gwin)
AddPart(temp, filereq->fr_File, 1024); AddPart(temp, filereq->fr_File, 1024);
if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) { if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) {
warn_user("NoMemory", 0); amiga_warn_user("NoMemory", 0);
} else { } else {
browser_window_navigate(gwin->gw->bw, browser_window_navigate(gwin->gw->bw,
url, url,

View File

@ -345,7 +345,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical
nodedata = ami_font_cache_alloc_entry(font); nodedata = ami_font_cache_alloc_entry(font);
if(nodedata == NULL) { if(nodedata == NULL) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return NULL; return NULL;
} }
@ -354,7 +354,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical
if(!nodedata->font) if(!nodedata->font)
{ {
LOG("Requested font not found: %s", font); LOG("Requested font not found: %s", font);
if(critical == true) warn_user("CompError", font); if(critical == true) amiga_warn_user("CompError", font);
FreeVec(nodedata); FreeVec(nodedata);
return NULL; return NULL;
} }

View File

@ -4419,7 +4419,7 @@ static void ami_gui_close_tabs(struct gui_window_2 *gwin, bool other_tabs)
if((gwin->tabs > 1) && (nsoption_bool(tab_close_warn) == true)) { if((gwin->tabs > 1) && (nsoption_bool(tab_close_warn) == true)) {
char *req_body = ami_utf8_easy(messages_get("MultiTabClose")); char *req_body = ami_utf8_easy(messages_get("MultiTabClose"));
int32 res = ami_warn_user_multi(req_body, "Yes", "No", gwin->win); int32 res = amiga_warn_user_multi(req_body, "Yes", "No", gwin->win);
free(req_body); free(req_body);
if(res == 0) return; if(res == 0) return;

View File

@ -76,7 +76,7 @@ static void ami_history_redraw(struct history_window *hw)
GetAttr(SCROLLER_Top,hw->objects[OID_HSCROLL],(ULONG *)&xs); GetAttr(SCROLLER_Top,hw->objects[OID_HSCROLL],(ULONG *)&xs);
GetAttr(SCROLLER_Top,hw->objects[OID_VSCROLL],(ULONG *)&ys); GetAttr(SCROLLER_Top,hw->objects[OID_VSCROLL],(ULONG *)&ys);
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -193,7 +193,7 @@ static bool ami_history_click(struct history_window *hw, uint16 code)
ULONG xs, ys; ULONG xs, ys;
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return false; return false;
} }
@ -259,7 +259,7 @@ BOOL ami_history_event(struct history_window *hw)
GetAttr(SCROLLER_Top, hw->objects[OID_VSCROLL], (ULONG *)&ys); GetAttr(SCROLLER_Top, hw->objects[OID_VSCROLL], (ULONG *)&ys);
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
break; break;
} }
@ -299,7 +299,7 @@ void ami_history_update_extent(struct history_window *hw)
browser_window_history_size(hw->gw->bw, &width, &height); browser_window_history_size(hw->gw->bw, &width, &height);
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }

View File

@ -116,7 +116,7 @@ HOOKF(void, ami_menu_item_project_newwin, APTR, window, struct IntuiMessage *)
nsurl_unref(url); nsurl_unref(url);
} }
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0); amiga_warn_user(messages_get_errorcode(error), 0);
} }
} }
@ -228,7 +228,7 @@ HOOKF(void, ami_menu_item_project_about, APTR, window, struct IntuiMessage *)
nsurl_unref(url); nsurl_unref(url);
} }
if (error != NSERROR_OK) { if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0); amiga_warn_user(messages_get_errorcode(error), 0);
} }
} }

View File

@ -141,7 +141,7 @@ nserror amiga_warn_user(const char *warning, const char *detail)
return NSERROR_OK; return NSERROR_OK;
} }
int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win) int32 amiga_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win)
{ {
int res = 0; int res = 0;

View File

@ -46,7 +46,7 @@ void ami_misc_itempool_free(APTR pool, APTR item, int size);
char *translate_escape_chars(const char *s); char *translate_escape_chars(const char *s);
void ami_misc_fatal_error(const char *message); void ami_misc_fatal_error(const char *message);
int32 ami_warn_user_multi(const char *body, int32 amiga_warn_user_multi(const char *body,
const char *opt1, const char *opt2, struct Window *win); const char *opt1, const char *opt2, struct Window *win);
#endif #endif

View File

@ -163,10 +163,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8); gg->bm = ami_rtg_allocbitmap(width, height, 32, 0, friend, RGBFB_A8R8G8B8);
} }
if(!gg->bm) warn_user("NoMemory",""); if(!gg->bm) amiga_warn_user("NoMemory","");
gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL); gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL);
if(!gg->rp) warn_user("NoMemory",""); if(!gg->rp) amiga_warn_user("NoMemory","");
InitRastPort(gg->rp); InitRastPort(gg->rp);
gg->rp->BitMap = gg->bm; gg->rp->BitMap = gg->bm;
@ -179,12 +179,12 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height, bool for
InstallLayerHook(gg->rp->Layer,LAYERS_NOBACKFILL); InstallLayerHook(gg->rp->Layer,LAYERS_NOBACKFILL);
gg->rp->AreaInfo = AllocVecTagList(sizeof(struct AreaInfo), NULL); gg->rp->AreaInfo = AllocVecTagList(sizeof(struct AreaInfo), NULL);
if((!gg->areabuf) || (!gg->rp->AreaInfo)) warn_user("NoMemory",""); if((!gg->areabuf) || (!gg->rp->AreaInfo)) amiga_warn_user("NoMemory","");
InitArea(gg->rp->AreaInfo,gg->areabuf, AREA_SIZE/5); InitArea(gg->rp->AreaInfo,gg->areabuf, AREA_SIZE/5);
gg->rp->TmpRas = AllocVecTagList(sizeof(struct TmpRas), NULL); gg->rp->TmpRas = AllocVecTagList(sizeof(struct TmpRas), NULL);
if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) warn_user("NoMemory",""); if((!gg->tmprasbuf) || (!gg->rp->TmpRas)) amiga_warn_user("NoMemory","");
InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height); InitTmpRas(gg->rp->TmpRas, gg->tmprasbuf, width*height);

View File

@ -408,7 +408,7 @@ void ami_print(struct hlcache_handle *c, int copies)
if(OpenDevice("printer.device", nsoption_int(printer_unit), if(OpenDevice("printer.device", nsoption_int(printer_unit),
(struct IORequest *)ami_print_info.PReq, 0)) (struct IORequest *)ami_print_info.PReq, 0))
{ {
warn_user("CompError","printer.device"); amiga_warn_user("CompError","printer.device");
return; return;
} }
@ -422,7 +422,7 @@ void ami_print(struct hlcache_handle *c, int copies)
if(!print_set_up(c, &amiprinter, ami_print_info.ps, &height)) if(!print_set_up(c, &amiprinter, ami_print_info.ps, &height))
{ {
warn_user("PrintError","print_set_up() returned false"); amiga_warn_user("PrintError","print_set_up() returned false");
ami_print_close_device(); ami_print_close_device();
return; return;
} }

View File

@ -140,7 +140,7 @@ void ami_theme_init(void)
if(!lock) if(!lock)
{ {
warn_user("ThemeApplyErr",nsoption_charp(theme)); amiga_warn_user("ThemeApplyErr",nsoption_charp(theme));
strcpy(themefile,"PROGDIR:Resources/Themes/Default/Theme"); strcpy(themefile,"PROGDIR:Resources/Themes/Default/Theme");
nsoption_set_charp(theme, (char *)strdup("PROGDIR:Resources/Themes/Default")); nsoption_set_charp(theme, (char *)strdup("PROGDIR:Resources/Themes/Default"));
} }
@ -447,7 +447,7 @@ void gui_window_stop_throbber(struct gui_window *g)
if(g == g->shared->gw) { if(g == g->shared->gw) {
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -479,7 +479,7 @@ static void ami_throbber_update(void *p)
if(g->shared->gw == g) { if(g->shared->gw == g) {
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
#ifdef __amigaos4__ #ifdef __amigaos4__

View File

@ -151,7 +151,7 @@ static void ami_tree_resized(struct tree *tree, int width, int height, void *dat
if(twin->win) if(twin->win)
{ {
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -193,7 +193,7 @@ static void ami_tree_get_window_dimensions(int *width, int *height, void *data)
struct IBox *bbox; struct IBox *bbox;
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -232,7 +232,7 @@ static void ami_tree_redraw_req_dr(void *p)
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y); GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -291,7 +291,7 @@ static void ami_tree_redraw_req(void *p)
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y); GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -377,7 +377,7 @@ static void ami_tree_draw(struct treeview_window *twin)
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y); GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y);
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -401,7 +401,7 @@ static void ami_tree_scroll_visible(int y, int height, void *data)
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&sy); GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&sy);
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
return; return;
} }
@ -980,7 +980,7 @@ BOOL ami_tree_event(struct treeview_window *twin)
drag_y_move = 0; drag_y_move = 0;
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
break; break;
} }
@ -1046,7 +1046,7 @@ BOOL ami_tree_event(struct treeview_window *twin)
case WMHI_MOUSEBUTTONS: case WMHI_MOUSEBUTTONS:
if(ami_gui_get_space_box((Object *)twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) { if(ami_gui_get_space_box((Object *)twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
warn_user("NoMemory", ""); amiga_warn_user("NoMemory", "");
break; break;
} }
@ -1458,7 +1458,7 @@ struct treeview_window *ami_tree_create(int flags,
if(!twin) if(!twin)
{ {
warn_user("NoMemory", 0); amiga_warn_user("NoMemory", 0);
return NULL; return NULL;
} }