2010-11-28 12:08:29 +00:00
|
|
|
/*
|
|
|
|
* messagebox.c
|
|
|
|
* d1x-rebirth
|
|
|
|
*
|
|
|
|
* Display an error or warning messagebox using the OS's window server.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "window.h"
|
|
|
|
#include "event.h"
|
|
|
|
#include "messagebox.h"
|
|
|
|
|
|
|
|
void display_linux_alert(char *message, int error)
|
|
|
|
{
|
2010-12-05 13:51:34 +00:00
|
|
|
d_event event;
|
2010-11-28 12:08:29 +00:00
|
|
|
window *wind;
|
|
|
|
|
|
|
|
// Handle Descent's windows properly
|
|
|
|
if ((wind = window_get_front()))
|
2010-12-05 13:51:34 +00:00
|
|
|
WINDOW_SEND_EVENT(wind, EVENT_WINDOW_DEACTIVATED);
|
2010-11-28 12:08:29 +00:00
|
|
|
|
|
|
|
// TODO: insert messagebox code...
|
|
|
|
|
2010-12-05 13:51:34 +00:00
|
|
|
if ((wind = window_get_front()))
|
|
|
|
WINDOW_SEND_EVENT(wind, EVENT_WINDOW_ACTIVATED);
|
2010-11-28 12:08:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void msgbox_warning(char *message)
|
|
|
|
{
|
|
|
|
display_linux_alert(message, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void msgbox_error(char *message)
|
|
|
|
{
|
|
|
|
display_linux_alert(message, 1);
|
|
|
|
}
|