mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-19 02:32:44 +03:00
stop monkey frontend using depricated warn_user API
This commit is contained in:
parent
b2e8c0d54f
commit
746177ee39
@ -37,6 +37,13 @@ static uint32_t win_ctr = 0;
|
||||
|
||||
static struct gui_window *gw_ring = NULL;
|
||||
|
||||
/* exported function documented in monkey/browser.h */
|
||||
nserror monkey_warn_user(const char *warning, const char *detail)
|
||||
{
|
||||
fprintf(stderr, "WARN %s %s\n", warning, detail);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
struct gui_window *
|
||||
monkey_find_window_by_num(uint32_t win_num)
|
||||
{
|
||||
@ -366,6 +373,9 @@ static void
|
||||
monkey_window_handle_go(int argc, char **argv)
|
||||
{
|
||||
struct gui_window *gw;
|
||||
nsurl *url;
|
||||
nsurl *ref_url = NULL;
|
||||
nserror error;
|
||||
|
||||
if (argc < 4 || argc > 5) {
|
||||
fprintf(stdout, "ERROR WINDOW GO ARGS BAD\n");
|
||||
@ -376,31 +386,32 @@ monkey_window_handle_go(int argc, char **argv)
|
||||
|
||||
if (gw == NULL) {
|
||||
fprintf(stdout, "ERROR WINDOW NUM BAD\n");
|
||||
} else {
|
||||
nsurl *url;
|
||||
nsurl *ref_url = NULL;
|
||||
nserror error;
|
||||
return;
|
||||
}
|
||||
|
||||
error = nsurl_create(argv[3], &url);
|
||||
if (error != NSERROR_OK) {
|
||||
warn_user(messages_get_errorcode(error), 0);
|
||||
} else {
|
||||
if (error == NSERROR_OK) {
|
||||
if (argc == 5) {
|
||||
error = nsurl_create(argv[4], &ref_url);
|
||||
}
|
||||
|
||||
browser_window_navigate(gw->bw,
|
||||
if (error == NSERROR_OK) {
|
||||
error = browser_window_navigate(gw->bw,
|
||||
url,
|
||||
ref_url,
|
||||
BW_NAVIGATE_HISTORY,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL);
|
||||
nsurl_unref(url);
|
||||
if (ref_url != NULL) {
|
||||
nsurl_unref(ref_url);
|
||||
}
|
||||
}
|
||||
nsurl_unref(url);
|
||||
}
|
||||
|
||||
if (error != NSERROR_OK) {
|
||||
monkey_warn_user(messages_get_errorcode(error), 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -43,4 +43,6 @@ void monkey_window_process_reformats(void);
|
||||
void monkey_window_handle_command(int argc, char **argv);
|
||||
void monkey_kill_browser_windows(void);
|
||||
|
||||
nserror monkey_warn_user(const char *warning, const char *detail);
|
||||
|
||||
#endif /* NETSURF_MONKEY_BROWSER_H */
|
||||
|
@ -223,12 +223,6 @@ static nserror set_defaults(struct nsoption_s *defaults)
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
static nserror monkey_warn_user(const char *warning, const char *detail)
|
||||
{
|
||||
fprintf(stderr, "WARN %s %s\n", warning, detail);
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Ensures output logging stream is correctly configured
|
||||
|
Loading…
Reference in New Issue
Block a user