*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifdef HAVE_CONFIG_H
if (inc_lock_count) return;
- if (prefs_common.work_offline)
- if (alertpanel(_("Offline warning"),
- _("You're working offline. Override?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT)
+ if (prefs_common.work_offline && !inc_offline_should_override())
return;
inc_lock();
if (inc_lock_count) return 0;
- if (prefs_common.work_offline)
- if (alertpanel(_("Offline warning"),
- _("You're working offline. Override?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT)
- return 0;
+ if (prefs_common.work_offline && !inc_offline_should_override())
+ return 0;
inc_autocheck_timer_remove();
main_window_lock(mainwin);
gint new_msgs = 0;
gint account_new_msgs = 0;
- if (prefs_common.work_offline)
- if (alertpanel(_("Offline warning"),
- _("You're working offline. Override?"),
- GTK_STOCK_YES, GTK_STOCK_NO, NULL) != G_ALERTDEFAULT)
+ if (prefs_common.work_offline && !inc_offline_should_override())
return;
if (inc_lock_count) return;
SESSION(pop3_session)->nonblocking =
pop3_session->ac_prefs->use_nonblocking_ssl;
#else
+ if (pop3_session->ac_prefs->ssl_pop != SSL_NONE) {
+ if (alertpanel_full(_("Insecure connection"),
+ _("This connection is configured to be secured "
+ "using SSL, but SSL is not available in this "
+ "build of Sylpheed-Claws. \n\n"
+ "Do you want to continue connecting to this "
+ "server? The communication would not be "
+ "secure."),
+ _("Con_tinue connecting"),
+ GTK_STOCK_CANCEL, NULL,
+ FALSE, NULL, ALERT_WARNING,
+ G_ALERTALTERNATE) != G_ALERTDEFAULT)
+ return INC_CONNECT_ERROR;
+ }
port = pop3_session->ac_prefs->set_popport ?
pop3_session->ac_prefs->popport : 110;
#endif
gchar *mbox;
gint result;
- if (account->inbox) {
- inbox = folder_find_item_from_path(account->inbox);
+ if (account->local_inbox) {
+ inbox = folder_find_item_from_identifier(account->local_inbox);
if (!inbox)
inbox = folder_get_default_inbox();
} else
return FALSE;
}
+
+gboolean inc_offline_should_override(void)
+{
+ static time_t overridden_yes = 0;
+ static time_t overridden_no = 0;
+ int length = 10; /* minutes */
+ gint answer = G_ALERTDEFAULT;
+
+ if (prefs_common.autochk_newmail)
+ length = prefs_common.autochk_itv; /* minutes */
+
+ if (prefs_common.work_offline) {
+ gchar *tmp = NULL;
+
+ if (time(NULL) - overridden_yes < length * 60) /* seconds */
+ return TRUE;
+ else if (time(NULL) - overridden_no < length * 60) /* seconds */
+ return FALSE;
+
+ tmp = g_strdup_printf(
+ _("You're working offline. Override for %d minutes?"),
+ length);
+
+ answer = alertpanel(_("Offline warning"),
+ tmp,
+ GTK_STOCK_YES, GTK_STOCK_NO, _("On_ly once"));
+ g_free(tmp);
+ if (answer == G_ALERTDEFAULT) {
+ overridden_yes = time(NULL);
+ return TRUE;
+ } else if (answer == G_ALERTALTERNATE) {
+ overridden_no = time(NULL);
+ return FALSE;
+ } else {
+ overridden_yes = (time_t)0;
+ overridden_no = (time_t)0;
+ return TRUE;
+ }
+ }
+ return TRUE;
+}