#include "defs.h"
#include <glib.h>
+#include <glib/gi18n.h>
#include <gtk/gtkmain.h>
#include <gtk/gtkwindow.h>
#include <gtk/gtksignal.h>
#include <signal.h>
#include <errno.h>
-#include "intl.h"
#include "main.h"
#include "inc.h"
#include "mainwindow.h"
static guint inc_lock_count = 0;
-static GdkPixmap *currentxpm;
-static GdkBitmap *currentxpmmask;
-static GdkPixmap *errorxpm;
-static GdkBitmap *errorxpmmask;
-static GdkPixmap *okxpm;
-static GdkBitmap *okxpmmask;
+static GdkPixbuf *currentpix;
+static GdkPixbuf *errorpix;
+static GdkPixbuf *okpix;
#define MSGBUFSIZE 8192
progress_dialog_get_fraction(progress);
- stock_pixmap_gdk(progress->clist, STOCK_PIXMAP_COMPLETE,
- &okxpm, &okxpmmask);
- stock_pixmap_gdk(progress->clist, STOCK_PIXMAP_CONTINUE,
- ¤txpm, ¤txpmmask);
- stock_pixmap_gdk(progress->clist, STOCK_PIXMAP_ERROR,
- &errorxpm, &errorxpmmask);
+ stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_COMPLETE,
+ &okpix);
+ stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_CONTINUE,
+ ¤tpix);
+ stock_pixbuf_gdk(progress->treeview, STOCK_PIXMAP_ERROR,
+ &errorpix);
if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
(prefs_common.recv_dialog_mode == RECV_DIALOG_MANUAL &&
for (list = inc_dialog->queue_list; list != NULL; list = list->next) {
IncSession *session = list->data;
Pop3Session *pop3_session = POP3_SESSION(session->session);
- gchar *text[3];
session->data = inc_dialog;
- text[0] = NULL;
- text[1] = pop3_session->ac_prefs->account_name;
- text[2] = _("Standby");
- gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
+ progress_dialog_list_set(inc_dialog->dialog,
+ -1, NULL,
+ pop3_session->ac_prefs->account_name,
+ _("Standby"));
}
}
static gint inc_start(IncProgressDialog *inc_dialog)
{
IncSession *session;
- GtkCList *clist = GTK_CLIST(inc_dialog->dialog->clist);
GList *qlist;
Pop3Session *pop3_session;
IncState inc_state;
FolderItem *processing, *inbox;
MsgInfo *msginfo;
GSList *msglist, *msglist_element;
+ gboolean cancelled = FALSE;
qlist = inc_dialog->queue_list;
while (qlist != NULL) {
qlist = next;
}
-#define SET_PIXMAP_AND_TEXT(xpm, xpmmask, str) \
+#define SET_PIXMAP_AND_TEXT(pix, str) \
{ \
- gtk_clist_set_pixmap(clist, inc_dialog->cur_row, 0, xpm, xpmmask); \
- gtk_clist_set_text(clist, inc_dialog->cur_row, 2, str); \
+ progress_dialog_list_set(inc_dialog->dialog, \
+ inc_dialog->cur_row, \
+ pix, \
+ NULL, \
+ str); \
}
- for (; inc_dialog->queue_list != NULL; inc_dialog->cur_row++) {
+ for (; inc_dialog->queue_list != NULL && !cancelled; inc_dialog->cur_row++) {
session = inc_dialog->queue_list->data;
pop3_session = POP3_SESSION(session->session);
if (pop3_session->pass == NULL) {
- SET_PIXMAP_AND_TEXT(okxpm, okxpmmask, _("Cancelled"));
+ SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
inc_session_destroy(session);
inc_dialog->queue_list =
g_list_remove(inc_dialog->queue_list, session);
}
inc_progress_dialog_clear(inc_dialog);
- gtk_clist_moveto(clist, inc_dialog->cur_row, -1, 1.0, 0.0);
+ progress_dialog_scroll_to_row(inc_dialog->dialog,
+ inc_dialog->cur_row);
- SET_PIXMAP_AND_TEXT(currentxpm, currentxpmmask,
- _("Retrieving"));
+ SET_PIXMAP_AND_TEXT(currentpix, _("Retrieving"));
/* begin POP3 session */
inc_state = inc_pop3_session_do(session);
switch (inc_state) {
case INC_SUCCESS:
if (pop3_session->cur_total_num > 0)
- msg = g_strdup_printf
- (_("Done (%d message(s) (%s) received)"),
+ msg = g_strdup_printf(
+ ngettext("Done (%d message (%s) received)",
+ "Done (%d messages (%s) received)",
+ pop3_session->cur_total_num),
pop3_session->cur_total_num,
to_human_readable(pop3_session->cur_total_recv_bytes));
else
msg = g_strdup_printf(_("Done (no new messages)"));
- SET_PIXMAP_AND_TEXT(okxpm, okxpmmask, msg);
+ SET_PIXMAP_AND_TEXT(okpix, msg);
g_free(msg);
break;
case INC_CONNECT_ERROR:
- SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask,
- _("Connection failed"));
+ SET_PIXMAP_AND_TEXT(errorpix, _("Connection failed"));
break;
case INC_AUTH_FAILED:
- SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask,
- _("Auth failed"));
+ SET_PIXMAP_AND_TEXT(errorpix, _("Auth failed"));
break;
case INC_LOCKED:
- SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask,
- _("Locked"));
+ SET_PIXMAP_AND_TEXT(errorpix, _("Locked"));
break;
case INC_ERROR:
case INC_NO_SPACE:
case INC_IO_ERROR:
case INC_SOCKET_ERROR:
case INC_EOF:
- SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask, _("Error"));
+ SET_PIXMAP_AND_TEXT(errorpix, _("Error"));
break;
case INC_TIMEOUT:
- SET_PIXMAP_AND_TEXT(errorxpm, errorxpmmask, _("Timeout"));
+ SET_PIXMAP_AND_TEXT(errorpix, _("Timeout"));
break;
case INC_CANCEL:
- SET_PIXMAP_AND_TEXT(okxpm, okxpmmask, _("Cancelled"));
+ SET_PIXMAP_AND_TEXT(okpix, _("Cancelled"));
+ if (!inc_dialog->show_dialog)
+ cancelled = TRUE;
break;
default:
break;
/* process messages */
folder_item_update_freeze();
for(msglist_element = msglist; msglist_element != NULL; msglist_element = msglist_element->next) {
+ gchar *filename;
msginfo = (MsgInfo *) msglist_element->data;
- if (!pop3_session->ac_prefs->filter_on_recv || !procmsg_msginfo_filter(msginfo))
+ filename = folder_item_fetch_msg(processing, msginfo->msgnum);
+ g_free(filename);
+ if (!pop3_session->ac_prefs->filter_on_recv ||
+ !procmsg_msginfo_filter(msginfo))
folder_item_move_msg(inbox, msginfo);
procmsg_msginfo_free(msginfo);
}
#undef SET_PIXMAP_AND_TEXT
if (new_msgs > 0)
- fin_msg = g_strdup_printf(_("Finished (%d new message(s))"),
- new_msgs);
+ fin_msg = g_strdup_printf(ngettext("Finished (%d new message)",
+ "Finished (%d new messages)",
+ new_msgs), new_msgs);
else
fin_msg = g_strdup_printf(_("Finished (no new messages)"));
else {
gtk_window_set_title(GTK_WINDOW(inc_dialog->dialog->window),
fin_msg);
- gtk_label_set_text(GTK_LABEL(GTK_BIN(inc_dialog->dialog->cancel_btn)->child),
- _("Close"));
+ gtk_button_set_label(GTK_BUTTON(inc_dialog->dialog->cancel_btn),
+ GTK_STOCK_CLOSE);
}
g_free(fin_msg);
if (pop3_session->cur_total_num > 0) {
g_snprintf(buf, sizeof(buf),
- _("Retrieving (%d message(s) (%s) received)"),
+ ngettext("Retrieving (%d message (%s) received)",
+ "Retrieving (%d messages (%s) received)",
+ pop3_session->cur_total_num),
pop3_session->cur_total_num,
to_human_readable
(pop3_session->cur_total_recv_bytes));
- gtk_clist_set_text(GTK_CLIST(inc_dialog->dialog->clist),
- inc_dialog->cur_row, 2, buf);
+ progress_dialog_list_set_status(inc_dialog->dialog,
+ inc_dialog->cur_row,
+ buf);
}
}