+2003-01-11 [colin] 0.8.8claws81
+
+ * src/mainwindow.c
+ src/mainwindow.h
+ Add mainwindow_get_mainwindow()
+ * src/alertpanel.c
+ src/alertpanel.h
+ Add alertpanel_error_log()
+ * src/compose.c
+ src/inc.c
+ src/messageview.c
+ src/toolbar.c
+ src/main.c
+ src/procmsg.c
+ Network errors get a View Log button
+
2003-01-10 [alfons] 0.8.8claws80
* src/prefs_toolbar.c
MICRO_VERSION=8
INTERFACE_AGE=0
BINARY_AGE=0
-EXTRA_VERSION=claws80
+EXTRA_VERSION=claws81
VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
dnl set $target
#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 "log.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);
...) G_GNUC_PRINTF(1, 2);
void alertpanel_error (const gchar *format,
...) G_GNUC_PRINTF(1, 2);
+void alertpanel_error_log(const gchar *format,
+ ...) G_GNUC_PRINTF(1, 2);
#endif /* __ALERTPANEL_H__ */
alertpanel_error(_("Can't queue the message."));
}
} else
- alertpanel_error(_("Error occurred while sending the message."));
+ alertpanel_error_log(_("Error occurred while sending the message."));
} else {
if (compose->mode == COMPOSE_REEDIT) {
compose_remove_reedit_target(compose);
if (inc_dialog->show_dialog)
manage_window_focus_in(inc_dialog->dialog->window,
NULL, NULL);
- alertpanel_error(_("Some errors occurred while getting mail."));
+ alertpanel_error_log(_("Some errors occurred while getting mail."));
if (inc_dialog->show_dialog)
manage_window_focus_out(inc_dialog->dialog->window,
NULL, NULL);
if (folder->queue) {
if (procmsg_send_queue
(folder->queue, prefs_common.savemsg) < 0)
- alertpanel_error(_("Some errors occurred while sending queued messages."));
+ alertpanel_error_log(_("Some errors occurred while sending queued messages."));
folder_item_scan(folder->queue);
if (prefs_common.savemsg && folder->outbox) {
if (folder->outbox == def_outbox)
summary_harvest_address( mainwin->summaryview );
}
+/*!
+ *\brief get a MainWindow
+ *
+ *\return MainWindow * The first mainwindow in the mainwin_list
+ */
+MainWindow *mainwindow_get_mainwindow(void)
+{
+ if (mainwin_list && mainwin_list->data)
+ return (MainWindow *)(mainwin_list->data);
+ else
+ return NULL;
+}
+
/*
* End of Source.
*/
void mainwindow_key_pressed (GtkWidget *widget,
GdkEventKey *event,
gpointer data);
+MainWindow *mainwindow_get_mainwindow (void);
#endif /* __MAINWINDOW_H__ */
alertpanel_error(_("Can't queue the notification."));
}
} else
- alertpanel_error(_("Error occurred while sending the notification."));
+ alertpanel_error_log(_("Error occurred while sending the notification."));
}
if (unlink(tmp) < 0) FILE_OP_ERROR(tmp, "unlink");
}
if (mailval < 0) {
if (!local)
- alertpanel_error(
+ alertpanel_error_log(
_("Error occurred while sending the message to `%s'."),
mailac ? mailac->smtp_server : smtpserver);
else
- alertpanel_error(
+ alertpanel_error_log(
_("Error occurred while sending the message with command `%s'."),
(mailac && mailac->use_mail_command &&
mailac->mail_command && (*mailac->mail_command)) ?
if (folder->queue) {
if (procmsg_send_queue
(folder->queue, prefs_common.savemsg) < 0)
- alertpanel_error(_("Some errors occurred while sending queued messages."));
+ alertpanel_error_log(_("Some errors occurred while sending queued messages."));
folder_item_scan(folder->queue);
}
}