#include <glib.h>
#include <glib/gi18n.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtksignal.h>
-#include <gtk/gtkprogressbar.h>
+#include <gtk/gtk.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
static GList *inc_dialog_list = NULL;
-static guint inc_lock_count = 0;
+guint inc_lock_count = 0;
static GdkPixbuf *currentpix;
static GdkPixbuf *errorpix;
if (prefs_common.scan_all_after_inc)
folderview_check_new(NULL);
- if (!autocheck && prefs_common.open_inbox_on_inc) {
+ if (!autocheck && new_messages && prefs_common.open_inbox_on_inc) {
FolderItem *item = NULL;
if (cur_account && cur_account->inbox)
if (execute_command_line(prefs_common.extinc_cmd, FALSE) < 0) {
main_window_unlock(mainwin);
inc_autocheck_timer_set();
+ inc_unlock();
return;
}
} else {
"Done (%d messages (%s) received)",
pop3_session->cur_total_num),
pop3_session->cur_total_num,
- to_human_readable(pop3_session->cur_total_recv_bytes));
+ to_human_readable((goffset)pop3_session->cur_total_recv_bytes));
else
msg = g_strdup_printf(_("Done (no new messages)"));
SET_PIXMAP_AND_TEXT(okpix, msg);
if (pop3_session->state == POP3_RETR ||
pop3_session->state == POP3_RETR_RECV ||
pop3_session->state == POP3_DELETE) {
- Xstrdup_a(total_size_str, to_human_readable(total), return);
+ Xstrdup_a(total_size_str, to_human_readable((goffset)total), return);
g_snprintf(buf, sizeof(buf),
_("Retrieving message (%d / %d) (%s / %s)"),
pop3_session->cur_msg, pop3_session->count,
- to_human_readable(cur_total), total_size_str);
+ to_human_readable((goffset)cur_total), total_size_str);
progress_dialog_set_label(inc_dialog->dialog, buf);
}
pop3_session->cur_total_num),
pop3_session->cur_total_num,
to_human_readable
- (pop3_session->cur_total_recv_bytes));
+ ((goffset)pop3_session->cur_total_recv_bytes));
progress_dialog_list_set_status(inc_dialog->dialog,
inc_dialog->cur_row,
buf);
} else
inbox = folder_get_default_inbox();
if (!inbox) {
- g_unlink(file);
+ claws_unlink(file);
return -1;
}
/* add msg file to drop folder */
if ((msgnum = folder_item_add_msg(
dropfolder, file, NULL, TRUE)) < 0) {
- g_unlink(file);
+ claws_unlink(file);
return -1;
}
err_msg = g_strdup(log_msg);
break;
case INC_TIMEOUT:
- log_msg = _("Session timed out.");
+ log_msg = _("Session timed out. You may be able to "
+ "recover by increasing the timeout value in "
+ "Preferences/Other.");
if (prefs_common.no_recv_err_panel)
break;
err_msg = g_strdup_printf(_("Connection to %s:%d timed out."),
msgs = proc_mbox(dest, tmp_mbox, account->filter_on_recv, account);
- g_unlink(tmp_mbox);
+ claws_unlink(tmp_mbox);
if (msgs >= 0) empty_mbox(mbox);
unlock_mbox(mbox, lockfd, LOCK_FLOCK);
return msgs;
}
-void inc_lock(void)
+void inc_lock_real(void)
{
inc_lock_count++;
}
-void inc_unlock(void)
+void inc_unlock_real(void)
{
if (inc_lock_count > 0)
inc_lock_count--;
the common preferences */
if (prefs_common.autochk_newmail && autocheck_data
&& prefs_common.work_offline == FALSE) {
+#if GLIB_CHECK_VERSION(2,14,0)
+ if (interval % 1000 == 0)
+ autocheck_timer =
+ g_timeout_add_seconds(interval/1000, inc_autocheck_func, autocheck_data);
+ else
+#endif
autocheck_timer = g_timeout_add
(interval, inc_autocheck_func, autocheck_data);
debug_print("added timer = %d\n", autocheck_timer);
int length = 10; /* minutes */
gint answer = G_ALERTDEFAULT;
+#ifdef HAVE_NETWORKMANAGER_SUPPORT
+ /* If no network connection is available, override is not possible */
+ if(!networkmanager_is_online(NULL))
+ return FALSE;
+#endif
+
#if (defined(MAEMO) && defined(CONIC))
if (prefs_common.work_offline) {
if (force_ask && !maemo_warned_offline) {