Changeset 103

Show
Ignore:
Timestamp:
04/21/06 04:30:50 (2 years ago)
Author:
jordi
Message:

The sidebar visibility is also handled by the presenter now.

Location:
trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/MainPter.cxx

    r102 r103  
    375375    m_Document->rotateRight (); 
    376376    showPage (); 
     377} 
     378 
     379/// 
     380/// @brief The "Show Sidebar" was activated. 
     381/// 
     382/// @param show TRUE if the sidebar should be shown, FALSE otherwise. 
     383/// 
     384void 
     385MainPter::showSidebarActivated (gboolean show) 
     386{ 
     387    getView ().showSidebar (show); 
    377388} 
    378389 
  • trunk/src/MainPter.h

    r102 r103  
    5858            void rotateLeftActivated (void); 
    5959            void rotateRightActivated (void); 
     60            void showSidebarActivated (gboolean show); 
    6061            void showStatusbarActivated (gboolean show); 
    6162            void showToolbarActivated (gboolean show); 
  • trunk/src/gtk/MainView.cxx

    r102 r103  
    968968    g_assert ( NULL != data && "The data parameter is NULL."); 
    969969 
    970 //    MainView *view = (MainView *)data; 
    971 //    view->showSidebar (gtk_toggle_action_get_active (action)); 
     970    MainPter *pter = (MainPter *)data; 
     971    pter->showSidebarActivated (gtk_toggle_action_get_active (action)); 
    972972} 
    973973 
  • trunk/tests/MainPterTest.cxx

    r102 r103  
    828828    CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 
    829829    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
     830 
     831    // When the user clicks on the "Show Sidebar" option, the 
     832    // side bar shown hide. Another click and the sidebar should 
     833    // appear. 
     834    m_MainPter->showSidebarActivated (FALSE); 
     835    CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 
     836    m_MainPter->showSidebarActivated (TRUE); 
     837    CPPUNIT_ASSERT (m_View->isShownSidebar ()); 
    830838} 
    831839