Changeset 1280

Show
Ignore:
Timestamp:
1/31/2010 6:14:32 AM (7 weeks ago)
Author:
vessper
Message:

31/01/2010 (1.14.0.1280)


- Core: Created events for remote evemail download

Location:
trunk/EveHQ/Forms
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/EveHQ/Forms/frmEveHQ.vb

    r1278 r1280  
    5151    Dim EveHQMLF As New frmMarketPrices 
    5252    Private EveHQTrayForm As Form = Nothing 
     53    Public Event MailUpdateStarted() 
     54    Public Event MailUpdateCompleted() 
    5355    Friend Structure RECT 
    5456        Friend Left As Int32 
     
    27052707 
    27062708    Private Sub UpdateMailNotifications() 
    2707         Threading.ThreadPool.QueueUserWorkItem(AddressOf MailUpdateThread) 
    2708     End Sub 
    2709  
    2710     Private Sub MailUpdateThread(ByVal state As Object) 
     2709        OpenEveHQMailForm() 
     2710        Threading.ThreadPool.QueueUserWorkItem(AddressOf MailUpdateThread, frmMail.IsHandleCreated) 
     2711    End Sub 
     2712 
     2713    Private Sub MailUpdateThread(ByVal MailFormOpen As Object) 
    27112714        ' Check for the AutoMailAPI flag 
    27122715        Dim requiresAutoDisable As Boolean = False 
     
    27182721            EveHQ.Core.HQ.EveHQSettings.AutoMailAPI = False 
    27192722        End If 
    2720         frmMail.btnDownloadMail.Enabled = False 
     2723 
     2724        RaiseEvent MailUpdateStarted() 
    27212725 
    27222726        ' Call the main routines! 
     
    27242728        Call myMail.GetMail() 
    27252729 
    2726         ' Update the display with EveMail 
    2727         If frmMail.IsHandleCreated = True Then 
    2728             Call frmMail.UpdateMailInfo() 
    2729         End If 
    2730  
    2731         frmMail.btnDownloadMail.Enabled = True 
     2730        RaiseEvent MailUpdateCompleted() 
     2731 
     2732        ' Update the main EveMail button 
     2733        Call Me.UpdateEveMailButton() 
     2734 
    27322735        ' Set the AutoMailAPI flag if required 
    27332736        If requiresAutoDisable = True Then 
    27342737            EveHQ.Core.HQ.EveHQSettings.AutoMailAPI = True 
    27352738        End If 
    2736         ' Update the main EveMail button 
    2737         Call Me.UpdateEveMailButton() 
     2739 
    27382740    End Sub 
    27392741 
  • trunk/EveHQ/Forms/frmMail.vb

    r1279 r1280  
    2222 
    2323    Private Sub frmMail_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 
     24        ' Adds handlers for the external mail events 
     25        AddHandler frmEveHQ.MailUpdateStarted, AddressOf MailUpdateStarted 
     26        AddHandler frmEveHQ.MailUpdateCompleted, AddressOf MailUpdateCompleted 
    2427        ' Check for the existence of our 2 required tables 
    2528        Call EveHQ.Core.DataFunctions.CheckForEveMailTable() 
     
    8386        Dim myMail As New EveHQ.Core.EveMail 
    8487        AddHandler myMail.MailProgress, AddressOf DisplayMailProgress 
    85         btnDownloadMail.Enabled = False 
     88        Me.Invoke(New MethodInvoker(AddressOf MailUpdateStarted)) 
    8689        Call myMail.GetMail() 
    8790        Me.Invoke(New MethodInvoker(AddressOf MailUpdateCompleted)) 
     
    97100    End Sub 
    98101 
    99     Private Sub MailUpdateCompleted() 
     102    Public Sub MailUpdateStarted() 
     103        lblDownloadMailStatus.Text = "Processing EveMails and Notifications..." 
     104        btnDownloadMail.Enabled = False 
     105    End Sub 
     106 
     107    Public Sub MailUpdateCompleted() 
    100108        ' Update the display with EveMail 
    101109        Call Me.UpdateMailInfo()