×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    May 2009
    Posts
    67

    wait note problem.

    i have one function which gets all msg from inbox and display on list.
    but this function takes more time so for that i need to show wait note untill function complete.

    I have write code for wait note but it displays after that function gets executed.

    i want it's process like this.

    1)show wait note
    2)execute the code for getting msg from inbox and display listbox.
    3)close wait note.

    following is my code snippet.
    //to start wait note..
    void CContainer3::ShowWaitNoteL(TDesC& text)
    {

    if ( iWaitNoteTimer->IsActive() )
    {
    iWaitNoteTimer->Cancel();
    }

    // Timer for deleting note is set if user cannot delete the note


    TCallBack callback( WaitNoteTimeoutL,this );
    iWaitNoteTimer->Start( ( TTimeIntervalMicroSeconds32 ) KMaxWaitNoteDelay,
    ( TTimeIntervalMicroSeconds32 ) KMaxWaitNoteShowTime,
    callback );


    // Create CAknWaitDialog instance
    CAknWaitDialog* waitDialog = new ( ELeave ) CAknWaitDialog( NULL, ETrue );

    // Show the Dialog
    waitDialog->ExecuteLD( R_AKNEXNOTE_WAIT_NOTE_SOFTKEY_EMPTY );
    ReadInbox(text);
    }

    //to close wait note after specific interval..
    TInt CContainer3::WaitNoteTimeoutL( TAny* aThis )
    {


    CContainer3* container = static_cast<CContainer3*>( aThis );
    container->iWaitNoteTimer->Cancel();



    CCoeAppUi* ui = static_cast<CCoeAppUi*>( container->iCoeEnv->AppUi() );

    // Check whether wait note is displayed.
    if ( ui->IsDisplayingMenuOrDialog() )
    {
    TKeyEvent key;
    key.iCode = EKeyEscape;
    key.iModifiers = 0;
    container->iCoeEnv->SimulateKeyEventL( key, EEventKey );
    }

    return 0;
    }
    i am calling these function like this..
    1)show wait note...
    2)ReadInbox() at the end of first function
    3)close wait note will executed after specific interval of 6 sec.

  2. #2
    Registered User
    Join Date
    Feb 2008
    Location
    India, Nashik
    Posts
    816

    Re: wait note problem.

    Quote Originally Posted by abhi560 View Post
    i have one function which gets all msg from inbox and display on list.
    but this function takes more time so for that i need to show wait note untill function complete.

    I have write code for wait note but it displays after that function gets executed.

    i want it's process like this.

    1)show wait note
    2)execute the code for getting msg from inbox and display listbox.
    3)close wait note.

    following is my code snippet.
    //to start wait note..
    void CContainer3::ShowWaitNoteL(TDesC& text)
    {

    if ( iWaitNoteTimer->IsActive() )
    {
    iWaitNoteTimer->Cancel();
    }

    // Timer for deleting note is set if user cannot delete the note


    TCallBack callback( WaitNoteTimeoutL,this );
    iWaitNoteTimer->Start( ( TTimeIntervalMicroSeconds32 ) KMaxWaitNoteDelay,
    ( TTimeIntervalMicroSeconds32 ) KMaxWaitNoteShowTime,
    callback );


    // Create CAknWaitDialog instance
    CAknWaitDialog* waitDialog = new ( ELeave ) CAknWaitDialog( NULL, ETrue );

    // Show the Dialog
    waitDialog->ExecuteLD( R_AKNEXNOTE_WAIT_NOTE_SOFTKEY_EMPTY );
    ReadInbox(text);
    }

    //to close wait note after specific interval..
    TInt CContainer3::WaitNoteTimeoutL( TAny* aThis )
    {


    CContainer3* container = static_cast<CContainer3*>( aThis );
    container->iWaitNoteTimer->Cancel();



    CCoeAppUi* ui = static_cast<CCoeAppUi*>( container->iCoeEnv->AppUi() );

    // Check whether wait note is displayed.
    if ( ui->IsDisplayingMenuOrDialog() )
    {
    TKeyEvent key;
    key.iCode = EKeyEscape;
    key.iModifiers = 0;
    container->iCoeEnv->SimulateKeyEventL( key, EEventKey );
    }

    return 0;
    }
    i am calling these function like this..
    1)show wait note...
    2)ReadInbox() at the end of first function
    3)close wait note will executed after specific interval of 6 sec.
    If the function you are calling is resource consuming then it doesnt let the WAIT note get printed on the console
    untill it is over most of the time you may want to do the task in your function asynchronously

  3. #3
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: wait note problem.

    also check your timer implementation whether it is calling the wait dialog on time or waits for sometime and then calls it.

Similar Threads

  1. GoogleIt
    By deepika.mangla in forum Symbian
    Replies: 5
    Last Post: 2011-05-28, 11:04
  2. Replies: 8
    Last Post: 2007-09-10, 18:52
  3. Wait Dialog Note...
    By andreas84 in forum Symbian
    Replies: 3
    Last Post: 2006-07-25, 09:00
  4. problem with wait note
    By Rx-lee in forum Symbian
    Replies: 3
    Last Post: 2004-04-21, 13:22
  5. Stop Global Wait Note...
    By sbleriot in forum Symbian
    Replies: 1
    Last Post: 2003-02-20, 09:48

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×