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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
| PUBLIC hProc AS Process PUBLIC hProcPrinc AS Process PUBLIC hLock AS Stream PUBLIC MonSon AS Sound PUBLIC POP AS Pop3Client PUBLIC maBool AS BOOLEAN PUBLIC dirTemp AS STRING PUBLIC cloture AS BOOLEAN
PUBLIC SUB ouverture()
TRY MonSon = Sound.Load("./sons/ouverture4.ogg") TRY MonSon.Play()
END
PUBLIC SUB beep()
TRY MonSon = Sound.Load("./sons/beep.ogg") TRY MonSon.Play()
END
PUBLIC SUB camera()
TRY MonSon = Sound.Load("./sons/camera1.ogg") TRY MonSon.Play()
END
PUBLIC SUB shade()
TRY MonSon = Sound.Load("./sons/shade.ogg") TRY MonSon.Play()
END
PUBLIC SUB Main() ' ' pour que les langues s'appliquent correctement démarrage sur module obligatoire
IF IsNull(Settings["LangInit"]) THEN Settings["LangInit"] = "" Settings.Save ' '************************************************* 'sélection de la langue en fonction du fichier de configuration ELSE IF Settings["LangInit"] = "en" THEN System.Language = "en_US.UTF-8" ELSE IF Settings["LangInit"] = "fr" THEN System.Language = "fr_FR.UTF-8" ELSE IF Settings["LangInit"] = "es" THEN System.Language = "es_ES.UTF-8" ELSE IF Settings["LangInit"] = "it" THEN System.Language = "it_IT.UTF-8" ELSE IF Settings["LangInit"] = "pt" THEN System.Language = "pt_PT.UTF-8" ELSE IF Settings["LangInit"] = "de" THEN System.Language = "de_DE.UTF-8" ENDIF
TRY hLock = LOCK User.home & "/.CherchMail-lock" 'pour éviter plusieurs instance du programme IF ERROR THEN beep Message.Title = (("Attention!")) Message(("Une seule instance du Progamme est possible.")) QUIT ENDIF
dirTemp = Temp '(Application.Name) TRY MKDIR dirTemp
cloture = FALSE Cerf.ShowModal() ' ' splash form FMain.Show() ' 'démarrage formulaire principal, pour démarrage par module.
CATCH Message.Title = ("Horreur!") Message(("Une erreur : ") & Error.Text & gb.CrLf & "Code : " & Error.Code & gb.CrLf & "Module1.Main") Application.Busy = 0
END
PUBLIC FUNCTION serveurPop(i AS INTEGER) 'définition du serveur pop
POP = NEW Pop3Client POP.host = FMain.Accounts[i].Server POP.User = FMain.Accounts[i].User POP.Password = FMain.Accounts[i].Pass POP.port = FMain.Accounts[i].Port POP.Encrypt = IIf(FMain.Accounts[i].SSL, net.ssl, Net.none) RETURN
END
PUBLIC SUB quitAppli() ' 'procédure de fin et de cloture de programme
IF NOT IsNull(Module1.hLock) THEN ' 'libération du fichier de contrôle hLock TRY UNLOCK Module1.hLock TRY KILL (User.home & "/.CherchMail-lock") ENDIF cloture = TRUE Cerf.ShowModal()
QUIT
END
PUBLIC SUB SupprMail()
frmMail.Close() FMain.mnuSupprMail_Click()
END
PUBLIC SUB ReponseMail()
frmMail.Close() FMain.mnuReponseMail_Click
END
|