mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-20 11:12:46 +03:00
Update to new warn_user API
This commit is contained in:
parent
67805f407f
commit
4d18947adb
@ -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]);
|
||||
|
||||
if (nsurl_create((char *)cmd->ac_ArgList[0], &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
amiga_warn_user("NoMemory", 0);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ STATIC VOID rx_home(struct ARexxCmd *cmd, struct RexxMsg *rxm __attribute__((unu
|
||||
if(gw == NULL) return;
|
||||
|
||||
if (nsurl_create(nsoption_charp(homepage_url), &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
amiga_warn_user("NoMemory", 0);
|
||||
} else {
|
||||
browser_window_navigate(gw->bw,
|
||||
url,
|
||||
|
@ -131,7 +131,7 @@ HOOKF(void, ami_ctxmenu_item_websearch, APTR, window, struct IntuiMessage *)
|
||||
nsurl_unref(url);
|
||||
}
|
||||
if (ret != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(ret), 0);
|
||||
amiga_warn_user(messages_get_errorcode(ret), 0);
|
||||
}
|
||||
|
||||
free(sel);
|
||||
@ -151,7 +151,7 @@ HOOKF(void, ami_ctxmenu_item_urlopentab, APTR, window, struct IntuiMessage *)
|
||||
&bw);
|
||||
|
||||
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 *)
|
||||
@ -168,7 +168,7 @@ HOOKF(void, ami_ctxmenu_item_urlopenwin, APTR, window, struct IntuiMessage *)
|
||||
&bw);
|
||||
|
||||
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 *)
|
||||
|
@ -274,7 +274,7 @@ static void gui_download_window_done(struct gui_download_window *dw)
|
||||
if(queuedl) {
|
||||
nsurl *url;
|
||||
if (nsurl_create(dln2->node.ln_Name, &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
amiga_warn_user("NoMemory", 0);
|
||||
} else {
|
||||
browser_window_navigate(bw,
|
||||
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,
|
||||
const char *error_msg)
|
||||
{
|
||||
warn_user("Unwritten","");
|
||||
amiga_warn_user("Unwritten","");
|
||||
dw->result = AMINS_DLOAD_ERROR;
|
||||
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"));
|
||||
}
|
||||
|
||||
res = ami_warn_user_multi(overwritetext, "Replace", "DontReplace", win);
|
||||
res = amiga_warn_user_multi(overwritetext, "Replace", "DontReplace", win);
|
||||
FreeVec(overwritetext);
|
||||
}
|
||||
else return TRUE;
|
||||
|
@ -97,7 +97,7 @@ void ami_file_open(struct gui_window_2 *gwin)
|
||||
AddPart(temp, filereq->fr_File, 1024);
|
||||
|
||||
if (netsurf_path_to_nsurl(temp, &url) != NSERROR_OK) {
|
||||
warn_user("NoMemory", 0);
|
||||
amiga_warn_user("NoMemory", 0);
|
||||
} else {
|
||||
browser_window_navigate(gwin->gw->bw,
|
||||
url,
|
||||
|
@ -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);
|
||||
|
||||
if(nodedata == NULL) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -354,7 +354,7 @@ static struct ami_font_cache_node *ami_font_open(const char *font, bool critical
|
||||
if(!nodedata->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);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -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)) {
|
||||
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);
|
||||
|
||||
if(res == 0) return;
|
||||
|
@ -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_VSCROLL],(ULONG *)&ys);
|
||||
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ static bool ami_history_click(struct history_window *hw, uint16 code)
|
||||
ULONG xs, ys;
|
||||
|
||||
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -259,7 +259,7 @@ BOOL ami_history_event(struct history_window *hw)
|
||||
GetAttr(SCROLLER_Top, hw->objects[OID_VSCROLL], (ULONG *)&ys);
|
||||
|
||||
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -299,7 +299,7 @@ void ami_history_update_extent(struct history_window *hw)
|
||||
|
||||
browser_window_history_size(hw->gw->bw, &width, &height);
|
||||
if(ami_gui_get_space_box(hw->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,7 @@ HOOKF(void, ami_menu_item_project_newwin, APTR, window, struct IntuiMessage *)
|
||||
nsurl_unref(url);
|
||||
}
|
||||
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);
|
||||
}
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
amiga_warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,7 +141,7 @@ nserror amiga_warn_user(const char *warning, const char *detail)
|
||||
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;
|
||||
|
||||
|
@ -46,7 +46,7 @@ void ami_misc_itempool_free(APTR pool, APTR item, int size);
|
||||
|
||||
char *translate_escape_chars(const char *s);
|
||||
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);
|
||||
#endif
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
if(!gg->bm) warn_user("NoMemory","");
|
||||
if(!gg->bm) amiga_warn_user("NoMemory","");
|
||||
|
||||
gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL);
|
||||
if(!gg->rp) warn_user("NoMemory","");
|
||||
if(!gg->rp) amiga_warn_user("NoMemory","");
|
||||
|
||||
InitRastPort(gg->rp);
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
|
@ -408,7 +408,7 @@ void ami_print(struct hlcache_handle *c, int copies)
|
||||
if(OpenDevice("printer.device", nsoption_int(printer_unit),
|
||||
(struct IORequest *)ami_print_info.PReq, 0))
|
||||
{
|
||||
warn_user("CompError","printer.device");
|
||||
amiga_warn_user("CompError","printer.device");
|
||||
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))
|
||||
{
|
||||
warn_user("PrintError","print_set_up() returned false");
|
||||
amiga_warn_user("PrintError","print_set_up() returned false");
|
||||
ami_print_close_device();
|
||||
return;
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ void ami_theme_init(void)
|
||||
|
||||
if(!lock)
|
||||
{
|
||||
warn_user("ThemeApplyErr",nsoption_charp(theme));
|
||||
amiga_warn_user("ThemeApplyErr",nsoption_charp(theme));
|
||||
strcpy(themefile,"PROGDIR:Resources/Themes/Default/Theme");
|
||||
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(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -479,7 +479,7 @@ static void ami_throbber_update(void *p)
|
||||
|
||||
if(g->shared->gw == g) {
|
||||
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
#ifdef __amigaos4__
|
||||
|
18
amiga/tree.c
18
amiga/tree.c
@ -151,7 +151,7 @@ static void ami_tree_resized(struct tree *tree, int width, int height, void *dat
|
||||
if(twin->win)
|
||||
{
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -193,7 +193,7 @@ static void ami_tree_get_window_dimensions(int *width, int *height, void *data)
|
||||
struct IBox *bbox;
|
||||
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -232,7 +232,7 @@ static void ami_tree_redraw_req_dr(void *p)
|
||||
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
|
||||
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -291,7 +291,7 @@ static void ami_tree_redraw_req(void *p)
|
||||
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&pos_y);
|
||||
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -377,7 +377,7 @@ static void ami_tree_draw(struct treeview_window *twin)
|
||||
GetAttr(SCROLLER_Top, twin->objects[OID_VSCROLL], (ULONG *)&y);
|
||||
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
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);
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -980,7 +980,7 @@ BOOL ami_tree_event(struct treeview_window *twin)
|
||||
drag_y_move = 0;
|
||||
|
||||
if(ami_gui_get_space_box(twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1046,7 +1046,7 @@ BOOL ami_tree_event(struct treeview_window *twin)
|
||||
|
||||
case WMHI_MOUSEBUTTONS:
|
||||
if(ami_gui_get_space_box((Object *)twin->objects[GID_BROWSER], &bbox) != NSERROR_OK) {
|
||||
warn_user("NoMemory", "");
|
||||
amiga_warn_user("NoMemory", "");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1458,7 +1458,7 @@ struct treeview_window *ami_tree_create(int flags,
|
||||
|
||||
if(!twin)
|
||||
{
|
||||
warn_user("NoMemory", 0);
|
||||
amiga_warn_user("NoMemory", 0);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user