#define TITLE_HEIGHT 72
#define MESSAGE_HEIGHT 62
-#define DEFAULT_TITLE_FONT "Helvetica 16"
+#define DEFAULT_TITLE_FONT "Sans Bold 12"
static gboolean alertpanel_is_open = FALSE;
static AlertValue value;
const gchar *button2_label,
const gchar *button3_label,
gboolean can_disable,
- GtkWidget *custom_widget);
+ GtkWidget *custom_widget,
+ gint alert_type);
static void alertpanel_button_toggled (GtkToggleButton *button,
gpointer data);
alertpanel_is_open = TRUE;
alertpanel_create(title, message, button1_label, button2_label,
- button3_label, FALSE, NULL);
+ button3_label, FALSE, NULL, ALERT_QUESTION);
alertpanel_show();
debug_print("return value = %d\n", value);
else
alertpanel_is_open = TRUE;
alertpanel_create(title, message, button1_label, button2_label,
- button3_label, FALSE, widget);
+ button3_label, FALSE, widget, ALERT_QUESTION);
alertpanel_show();
debug_print("return value = %d\n", value);
return value;
}
-void alertpanel_message(const gchar *title, const gchar *message)
+
+static void alertpanel_message(const gchar *title, const gchar *message, gint type)
{
if (alertpanel_is_open)
return;
else
alertpanel_is_open = TRUE;
- alertpanel_create(title, message, NULL, NULL, NULL, FALSE, NULL);
+ alertpanel_create(title, message, NULL, NULL, NULL, FALSE, NULL, type);
alertpanel_show();
}
AlertValue alertpanel_message_with_disable(const gchar *title,
- const gchar *message)
+ const gchar *message,
+ gint alert_type)
{
if (alertpanel_is_open)
return 0;
else
alertpanel_is_open = TRUE;
- alertpanel_create(title, message, NULL, NULL, NULL, TRUE, NULL);
+ alertpanel_create(title, message, NULL, NULL, NULL, TRUE, NULL,
+ alert_type);
alertpanel_show();
return value;
va_end(args);
strretchomp(buf);
- alertpanel_message(_("Notice"), buf);
+ alertpanel_message(_("Notice"), buf, ALERT_NOTICE);
}
void alertpanel_warning(const gchar *format, ...)
va_end(args);
strretchomp(buf);
- alertpanel_message(_("Warning"), buf);
+ alertpanel_message(_("Warning"), buf, ALERT_WARNING);
}
void alertpanel_error(const gchar *format, ...)
va_end(args);
strretchomp(buf);
- alertpanel_message(_("Error"), buf);
+ alertpanel_message(_("Error"), buf, ALERT_ERROR);
}
/*!
const gchar *button2_label,
const gchar *button3_label,
gboolean can_disable,
- GtkWidget *custom_widget)
+ GtkWidget *custom_widget,
+ gint alert_type)
{
static PangoFontDescription *font_desc;
GtkWidget *label;
+ GtkWidget *w_hbox;
GtkWidget *hbox;
GtkWidget *vbox;
GtkWidget *spc_vbox;
GtkWidget *button1;
GtkWidget *button2;
GtkWidget *button3;
+ GtkWidget *icon;
const gchar *label2;
const gchar *label3;
+ gchar *icon_desc[] = { GTK_STOCK_DIALOG_INFO,
+ GTK_STOCK_DIALOG_QUESTION,
+ GTK_STOCK_DIALOG_WARNING,
+ GTK_STOCK_DIALOG_ERROR };
debug_print("Creating alert panel dialog...\n");
gtk_widget_realize(dialog);
/* for title label */
+ w_hbox = gtk_hbox_new(FALSE, 0);
+
+ if (alert_type < 0 || alert_type > 3)
+ alert_type = 0;
+ icon = gtk_image_new_from_stock(icon_desc[alert_type],
+ GTK_ICON_SIZE_DIALOG);
+ gtk_box_pack_start(GTK_BOX(w_hbox), icon, FALSE, FALSE, 16);
hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(w_hbox), hbox, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox),
- hbox, TRUE, TRUE, 16);
+ w_hbox, TRUE, TRUE, 16);
+
- /* title label */
- /* pixmapwid = create_pixmapwid(dialog, GNUstep_xpm); */
- /* gtk_box_pack_start(GTK_BOX(hbox), pixmapwid, FALSE, FALSE, 16); */
label = gtk_label_new(title);
- gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 16);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
+ gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
if (!font_desc) {
gchar *fontstr = prefs_common.titlefont
? prefs_common.titlefont
if (font_desc) {
gtk_widget_modify_font (label, font_desc);
}
+ gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 16);
/* for message and button(s) */
vbox = gtk_vbox_new(FALSE, 0);