update beos frontend to remove useage of depricated warn_user API

This commit is contained in:
Vincent Sanders 2016-05-01 22:04:03 +01:00
parent 4d18947adb
commit 91515e2b56
8 changed files with 36 additions and 34 deletions

View File

@ -374,7 +374,7 @@ void fetch_rsrc_register(void)
err = find_app_resources();
if (err < B_OK) {
warn_user("Resources", strerror(err));
beos_warn_user("Resources", strerror(err));
return;
}

View File

@ -38,6 +38,7 @@ extern "C" {
}
#include "beos/filetype.h"
#include "beos/gui.h"
static struct {
const char *type;
@ -68,7 +69,7 @@ void beos_fetch_filetype_init(void)
continue;
err = m.Install();
if (err < B_OK) {
warn_user("Mime", strerror(err));
beos_warn_user("Mime", strerror(err));
continue;
}
// the mime db doesn't know about it yet
@ -79,7 +80,7 @@ void beos_fetch_filetype_init(void)
extensions.AddString("extensions", default_types[i].ext2);
err = m.SetFileExtensions(&extensions);
if (err < B_OK) {
warn_user("Mime", strerror(err));
beos_warn_user("Mime", strerror(err));
}
}
}

View File

@ -332,7 +332,7 @@ bool nsfont_paint(const plot_font_style_t *fstyle,
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}

View File

@ -113,13 +113,8 @@ static int sEventPipe[2];
// #pragma mark - class NSBrowserFrameView
/**
* Display a warning for a serious problem (eg memory exhaustion).
*
* \param warning message key for warning message
* \param detail additional message, or 0
*/
static nserror beos_warn_user(const char *warning, const char *detail)
/* exported function defined in beos/gui.h */
nserror beos_warn_user(const char *warning, const char *detail)
{
LOG("warn_user: %s (%s)", warning, detail);
BAlert *alert;

View File

@ -78,3 +78,11 @@ void nsbeos_update_system_ui_colors(void);
* \param error The message to display to the user.
*/
void die(const char * const error) __attribute__ ((noreturn));
/**
* Display a warning for a serious problem (eg memory exhaustion).
*
* \param warning message key for warning message
* \param detail additional message, or 0
*/
nserror beos_warn_user(const char *warning, const char *detail)

View File

@ -40,8 +40,6 @@ extern "C" {
#include "beos/font.h"
#include "beos/gui.h"
#include "beos/plotters.h"
//#include "beos/scaffolding.h"
//#include "beos/options.h"
#include "beos/bitmap.h"
#warning MAKE ME static
@ -128,7 +126,7 @@ bool nsbeos_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *s
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -162,7 +160,7 @@ bool nsbeos_plot_rectangle(int x0, int y0, int x1, int y1, const plot_style_t *s
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -207,7 +205,7 @@ bool nsbeos_plot_line(int x0, int y0, int x1, int y1, const plot_style_t *style)
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -235,7 +233,7 @@ bool nsbeos_plot_polygon(const int *p, unsigned int n, const plot_style_t *style
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -265,7 +263,7 @@ bool nsbeos_plot_clip(const struct rect *ns_clip)
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -296,7 +294,7 @@ bool nsbeos_plot_disc(int x, int y, int radius, const plot_style_t *style)
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -319,7 +317,7 @@ bool nsbeos_plot_arc(int x, int y, int radius, int angle1, int angle2, const plo
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -349,7 +347,7 @@ static bool nsbeos_plot_bbitmap(int x, int y, int width, int height,
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}
@ -419,7 +417,7 @@ bool nsbeos_plot_bitmap(int x, int y, int width, int height,
view = nsbeos_current_gc/*_lock*/();
if (view == NULL) {
warn_user("No GC", 0);
beos_warn_user("No GC", 0);
return false;
}

View File

@ -439,7 +439,7 @@ NSBaseView::NSBaseView(BMessage *archive)
NSBaseView::~NSBaseView()
{
//warn_user ("~NSBaseView()", NULL);
//beos_warn_user("~NSBaseView()", NULL);
if (replicated) {
BMessage *message = new BMessage(B_QUIT_REQUESTED);
nsbeos_pipe_message_top(message, NULL, fScaffolding);
@ -914,7 +914,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
nsurl_unref(nsurl);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
}
}
break;
@ -937,7 +937,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
nsurl_unref(url);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
}
}
break;
@ -957,7 +957,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
error = nsurl_create(url.String(), &nsurl);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(bw,
nsurl,
@ -1027,7 +1027,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
error = nsurl_create(addr, &url);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(bw,
url,
@ -1055,7 +1055,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
error = nsurl_create(text.String(), &url);
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
} else {
browser_window_navigate(bw,
url,
@ -1106,7 +1106,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
}
if (ret != NSERROR_OK) {
warn_user(messages_get_errorcode(ret), 0);
beos_warn_user(messages_get_errorcode(ret), 0);
}
search_web_finalise();
@ -1155,7 +1155,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
nsurl_unref(url);
}
if (nserr != NSERROR_OK) {
warn_user(messages_get_errorcode(nserr), 0);
beos_warn_user(messages_get_errorcode(nserr), 0);
}
}
break;
@ -1173,7 +1173,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
nsurl_unref(url);
}
if (nserr != NSERROR_OK) {
warn_user(messages_get_errorcode(nserr), 0);
beos_warn_user(messages_get_errorcode(nserr), 0);
}
}
break;
@ -1226,7 +1226,7 @@ void nsbeos_scaffolding_dispatch_event(nsbeos_scaffolding *scaffold, BMessage *m
nsurl_unref(url);
}
if (error != NSERROR_OK) {
warn_user(messages_get_errorcode(error), 0);
beos_warn_user(messages_get_errorcode(error), 0);
}
break;
}
@ -1715,7 +1715,7 @@ nsbeos_scaffolding *nsbeos_new_scaffolding(struct gui_window *toplevel)
g->menu_bar = NULL;
if (replicated && !replicant_view) {
warn_user("Error: No subwindow allowed when replicated.", NULL);
beos_warn_user("Error: No subwindow allowed when replicated.", NULL);
return NULL;
}

View File

@ -348,7 +348,7 @@ static struct gui_window *gui_window_create(struct browser_window *bw,
g = (struct gui_window *)malloc(sizeof(*g));
if (!g) {
warn_user("NoMemory", 0);
beos_warn_user("NoMemory", 0);
return 0;
}