Show
Ignore:
Timestamp:
04/20/06 10:08:49 (3 years ago)
Author:
jordi
Message:

The Main presenter now pass the last folder used to open a file to the view, so it can change the shown folder on the open dialog. Also, the main presenter saves the last folder to the configuration class.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/tests/MainPterTest.cxx

    r80 r97  
    3636    m_View = new DumbMainView (m_MainPter); 
    3737    m_MainPter->setView (m_View); 
     38    Config::loadFile (FALSE); 
    3839} 
    3940 
     
    4748    // classes are deleted by it. 
    4849    delete m_MainPter; 
     50    // Drop the current configuration. 
     51    Config::destroy (); 
    4952} 
    5053 
     
    292295} 
    293296 
     297/// 
     298/// @brief Test the last folder used to open a file. 
     299/// 
     300/// When the presenter wants to open a file, it should pass to the 
     301/// view the last folder that was used to open a file, so the 
     302/// view can show it up when opening the dialog. 
     303/// 
     304void 
     305MainPterTest::lastFolder () 
     306{ 
     307    m_View->setOpenFileName ("/tmp/test.pdf"); 
     308    m_MainPter->openFileActivated (); 
     309    CPPUNIT_ASSERT (NULL == m_View->getLastOpenFileFolder ()); 
     310 
     311 
     312    m_View->setOpenFileName ("/usr/test.pdf"); 
     313    m_MainPter->openFileActivated (); 
     314    CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("/tmp",  
     315                                             m_View->getLastOpenFileFolder ())); 
     316     
     317    m_MainPter->openFileActivated (); 
     318    CPPUNIT_ASSERT (0 == g_ascii_strcasecmp ("/usr",  
     319                                             m_View->getLastOpenFileFolder ())); 
     320} 
    294321 
    295322///