-
Notifications
You must be signed in to change notification settings - Fork 0
/
wxMsMailCheckTimer.cpp
96 lines (90 loc) · 3.03 KB
/
wxMsMailCheckTimer.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
/*-----------------------------------------------------------------
* Name: wxMsMailCheckTimer.cpp
* Purpose:
* Author: A. Wiegert
*
* Copyright:
* Licence: wxWidgets licence
*---------------------------------------------------------------- */
/*----------------------------------------------------------------
* Standard wxWidgets headers
*---------------------------------------------------------------- */
// Note __VISUALC__ is defined by wxWidgets, not by MSVC IDE
// and thus won't be defined until some wxWidgets headers are included
#if defined( _MSC_VER )
# if defined ( _DEBUG )
// this statement NEEDS to go BEFORE all headers
# define _CRTDBG_MAP_ALLOC
# endif
#endif
#include "wxMsPreProcDefsh.h" // needs to be first
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
/* For all others, include the necessary headers
* (this file is usually all you need because it
* includes almost all "standard" wxWidgets headers) */
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
// ------------------------------------------------------------------
#include "wxMsFrameh.h"
// ------------------------------------------------------------------
// Note __VISUALC__ is defined by wxWidgets, not by MSVC IDE // from Autohotkey-hummer.ahk
// and thus won't be defined until some wxWidgets headers are included
#if defined( _MSC_VER )
// this block needs to go AFTER all headers
#include <crtdbg.h>
# ifdef _DEBUG
# define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
# define new DEBUG_NEW
# endif
#endif
// ------------------------------------------------------------------
/**
* Timer to handle the mail check, if enabled
* When started, the timer is set to 1 minute ( 60 * 1000)
*/
void MyFrame::OnMailCheckTimer( wxTimerEvent& event )
{
// nothing to do if the mail check is not scheduled
if ( g_iniPrefs.data[IE_SCHEDULE_MAIL_CHECK].dataCurrent.bVal )
{
m_iMailTimerTicks++;
wxString wsT;
wsT.Printf( _("Last mail check: %d min(s)"), m_iMailTimerTicks );
if ( m_iMailTimerTicks >= g_iniPrefs.data[IE_MAIL_CHECK_INTERVAL].dataCurrent.lVal )
{
Check4NewMail();
m_tMailCheckTimer.Start(1000 * 60 );
}
SetStatusText( wsT, 0 );
}
m_iConnectCheckTimerTicks++;
}
// ------------------------------------------------------------------
/**
* Timer to handle the mail server connection timing check,
* When started, the timer is set to 1 minute ( 60 * 1000)
*/
void MyFrame::OnMailConnectTimer( wxTimerEvent& event )
{
#if defined( WANT_MAIL_CONNECT_TEST )
m_iConnectCheckTimerTicks++;
if ( m_iConnectCheckTimerTicks > g_iniPrefs.data[IE_MAIL_CHECK_INTERVAL].dataCurrent.lVal )
{
CheckConnectivity();
}
#endif
}
// ------------------------------------------------------------------
/**
* Clear the status field 0 after a suitable time
*/
void MyFrame::OnMailDisplayTimer( wxTimerEvent& event )
{
SetStatusText( wxEmptyString, 0 );
}
// ------------------------------- eof ------------------------------