#include <gdk/gdkkeysyms.h>
#include "intl.h"
+#include "mainwindow.h"
#include "alertpanel.h"
#include "manage_window.h"
#include "utils.h"
#include "gtkutils.h"
#include "inc.h"
+#include "logwindow.h"
#define TITLE_FONT "-*-helvetica-medium-r-normal--17-*-*-*-*-*-*-*," \
"-*-*-medium-r-normal--16-*-*-*-*-*-*-*,*"
alertpanel_message(_("Error"), buf);
}
+/*!
+ *\brief display an error with a View Log button
+ *
+ */
+void alertpanel_error_log(const gchar *format, ...)
+{
+ va_list args;
+ int val;
+ MainWindow *mainwin;
+ gchar buf[256];
+
+ va_start(args, format);
+ g_vsnprintf(buf, sizeof(buf), format, args);
+ va_end(args);
+ strretchomp(buf);
+
+ mainwin = mainwindow_get_mainwindow();
+
+ if (mainwin && mainwin->logwin) {
+ val = alertpanel(_("Error"), buf, _("OK"), _("View log"), NULL);
+ if (val == G_ALERTALTERNATE)
+ log_window_show(mainwin->logwin);
+ } else
+ alertpanel_error(buf);
+}
+
static void alertpanel_show(void)
{
gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
style = gtk_style_copy(gtk_widget_get_style(label));
if (!titlefont)
- titlefont = gdk_fontset_load(TITLE_FONT);
+ titlefont = gtkut_font_load(TITLE_FONT);
if (titlefont)
style->font = titlefont;
gtk_widget_set_style(label, style);
/* message label */
label = gtk_label_new(message);
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 24);
- gtk_misc_set_alignment(GTK_MISC(label), 0, 0.5);
gtk_label_set_justify(GTK_LABEL(label), GTK_JUSTIFY_LEFT);
+ /* Claws: custom widget */
+ if (custom_widget) {
+ GtkWidget *custom_hbox = gtk_hbox_new(FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(msg_vbox), custom_hbox, FALSE,
+ FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(custom_hbox), custom_widget, FALSE,
+ FALSE, 24);
+ }
if (can_disable) {
hbox = gtk_hbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);