Changeset 123

Show
Ignore:
Timestamp:
04/28/06 03:54:38 (2 years ago)
Author:
jordi
Message:

Renamed the "Show Outline" option to "Show Index" and added a shortcut for it.

Location:
trunk
Files:
10 modified

Legend:

Unmodified
Added
Removed
  • trunk/data/epdfview-ui.xml

    r68 r123  
    1010      <menuitem name="ShowToolBar" action="ShowToolBar"/> 
    1111      <menuitem name="ShowStatusBar" action="ShowStatusBar"/> 
    12       <menuitem name="ShowSideBar" action="ShowSideBar"/> 
     12      <menuitem name="ShowIndex" action="ShowIndex"/> 
    1313      <separator/> 
    1414      <menuitem name="ZoomIn" action="ZoomIn"/> 
  • trunk/src/IMainView.h

    r117 r123  
    335335             
    336336            /// 
     337            /// @brief Shows the document's index. 
     338            /// 
     339            /// The presenter will call it just before to show the main window, 
     340            /// to let the view know if it must show the index or not 
     341            /// when the main window will be displayed. 
     342            /// 
     343            /// After that, the presenter can call it to show or hide the 
     344            /// index when the user toggles the "Show Index" option. 
     345            /// 
     346            /// @param show Set to TRUE if the index should be shown. FALSE 
     347            ///             otherwise. 
     348            /// 
     349            virtual void showIndex (gboolean show) = 0; 
     350 
     351            /// 
    337352            /// @brief Shows a document's page. 
    338353            /// 
     
    353368 
    354369            /// 
    355             /// @brief Shows the sidebar. 
    356             /// 
    357             /// The presenter will call it just before to show the main window, 
    358             /// to let the view know if it must show the sidebar or not 
    359             /// when the main window will be displayed. 
    360             /// 
    361             /// After that, the presenter can call it to show or hide the 
    362             /// sidebar when the user toggles the "Show sidebar" option. 
    363             /// 
    364             /// @param show Set to TRUE if the sidebar should be shown. FALSE 
    365             ///             otherwise. 
    366             /// 
    367             virtual void showSidebar (gboolean show) = 0; 
    368  
    369             /// 
    370370            /// @brief Shows the statusbar. 
    371371            /// 
  • trunk/src/MainPter.cxx

    r122 r123  
    139139    view.showStatusbar (config.showStatusbar ()); 
    140140    view.setOutline (m_Document->getOutline ()); 
    141     view.showSidebar (showSidebar); 
     141    view.showIndex (showSidebar); 
    142142    // Remove the status bar text. 
    143143    view.setStatusBarText (NULL); 
     
    443443 
    444444/// 
    445 /// @brief The "Show Sidebar" was activated. 
    446 /// 
    447 /// @param show TRUE if the sidebar should be shown, FALSE otherwise. 
    448 /// 
    449 void 
    450 MainPter::showSidebarActivated (gboolean show) 
    451 { 
    452     getView ().showSidebar (show); 
     445/// @brief The "Show Index" was activated. 
     446/// 
     447/// @param show TRUE if the index should be shown, FALSE otherwise. 
     448/// 
     449void 
     450MainPter::showIndexActivated (gboolean show) 
     451{ 
     452    getView ().showIndex (show); 
    453453} 
    454454 
  • trunk/src/MainPter.h

    r120 r123  
    5858            void rotateLeftActivated (void); 
    5959            void rotateRightActivated (void); 
    60             void showSidebarActivated (gboolean show); 
     60            void showIndexActivated (gboolean show); 
    6161            void showStatusbarActivated (gboolean show); 
    6262            void showToolbarActivated (gboolean show); 
  • trunk/src/gtk/MainView.cxx

    r121 r123  
    5050    outlineDataColumn, 
    5151    outlineNumColumns 
    52 } outlineColumns; 
     52} indexColumns; 
    5353 
    5454// Forward declarations. 
     
    7979                                                   GdkEventScroll *, gpointer); 
    8080static void main_window_quit_cb (GtkWidget *, gpointer); 
    81 static void main_window_show_sidebar_cb (GtkToggleAction *, gpointer); 
     81static void main_window_show_index_cb (GtkToggleAction *, gpointer); 
    8282static void main_window_show_statusbar_cb (GtkToggleAction *, gpointer); 
    8383static void main_window_show_toolbar_cb (GtkToggleAction *, gpointer); 
     
    152152      N_("Show or hide the statusbar"), 
    153153      G_CALLBACK (main_window_show_statusbar_cb), TRUE }, 
    154     { "ShowSideBar", NULL, N_("Show O_utline"), NULL, 
     154    { "ShowIndex", NULL, N_("Show I_ndex"), "<control>I", 
    155155      N_("Show or hide the document's outline"), 
    156       G_CALLBACK (main_window_show_sidebar_cb), FALSE }, 
     156      G_CALLBACK (main_window_show_index_cb), FALSE }, 
    157157 
    158158    { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, 
     
    475475 
    476476void 
    477 MainView::showSidebar (gboolean show) 
     477MainView::showIndex (gboolean show) 
    478478{ 
    479479    if ( show ) 
     
    485485        gtk_widget_hide (m_Sidebar); 
    486486    } 
    487     GtkAction *showSideBar =  
     487    GtkAction *showIndex =  
    488488        gtk_ui_manager_get_action (m_UIManager,  
    489                                    "/MenuBar/ViewMenu/ShowSideBar"); 
    490     gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showSideBar), show); 
     489                                   "/MenuBar/ViewMenu/ShowIndex"); 
     490    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showIndex), show); 
    491491} 
    492492 
     
    642642/// 
    643643/// Creates the image widget inside the scrolled window, but also creates 
    644 /// the sidebar. 
    645 /// 
    646 /// Put both the sidebar and the image to a HPaned container. 
    647 /// 
    648 /// @return The HPaned where the sidebar and the scrolled window are. 
     644/// the side bar. 
     645/// 
     646/// Put both the side bar and the image to a HPaned container. 
     647/// 
     648/// @return The HPaned where the side bar and the scrolled window are. 
    649649/// 
    650650GtkWidget * 
     
    684684                      m_PageViewScroll); 
    685685     
    686     // Create the side bar, with the outline tree. 
     686    // Create the side bar, with the index tree. 
    687687    m_Outline = gtk_tree_store_new (outlineNumColumns,  
    688688                                    G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER); 
     
    12401240 
    12411241/// 
    1242 /// @brief Called when the user clicks on the "Show Outline" action. 
    1243 /// 
    1244 void 
    1245 main_window_show_sidebar_cb (GtkToggleAction *action, gpointer data) 
    1246 { 
    1247     g_assert ( NULL != data && "The data parameter is NULL."); 
    1248  
    1249     MainPter *pter = (MainPter *)data; 
    1250     pter->showSidebarActivated (gtk_toggle_action_get_active (action)); 
     1242/// @brief Called when the user clicks on the "Show Index" action. 
     1243/// 
     1244void 
     1245main_window_show_index_cb (GtkToggleAction *action, gpointer data) 
     1246{ 
     1247    g_assert ( NULL != data && "The data parameter is NULL."); 
     1248 
     1249    MainPter *pter = (MainPter *)data; 
     1250    pter->showIndexActivated (gtk_toggle_action_get_active (action)); 
    12511251} 
    12521252 
  • trunk/src/gtk/MainView.h

    r117 r123  
    5252            void showErrorMessage (const gchar *title, const gchar *body); 
    5353            void showPage (DocumentPage *page, PageScroll scroll); 
    54             void showSidebar (gboolean show); 
     54            void showIndex (gboolean show); 
    5555            void setCursor (ViewCursor cursorType); 
    5656            void setTotalPages (gint pages); 
  • trunk/tests/DumbMainView.cxx

    r117 r123  
    4949    m_Shown = FALSE; 
    5050    m_ShownError = FALSE; 
    51     m_ShownSidebar = FALSE; 
     51    m_ShownIndex = FALSE; 
    5252    m_ShownStatusbar = FALSE; 
    5353    m_ShownToolbar = FALSE; 
     
    241241 
    242242void 
    243 DumbMainView::showSidebar (gboolean show) 
    244 { 
    245     m_ShownSidebar = show; 
     243DumbMainView::showIndex (gboolean show) 
     244{ 
     245    m_ShownIndex = show; 
    246246} 
    247247 
     
    388388 
    389389gboolean 
    390 DumbMainView::isShownSidebar () 
    391 { 
    392     return m_ShownSidebar; 
     390DumbMainView::isShownIndex () 
     391{ 
     392    return m_ShownIndex; 
    393393} 
    394394 
  • trunk/tests/DumbMainView.h

    r117 r123  
    5656            void showErrorMessage (const gchar *title, const gchar *body); 
    5757            void showPage (DocumentPage *page, PageScroll scroll); 
    58             void showSidebar (gboolean show); 
     58            void showIndex (gboolean show); 
    5959            void showStatusbar (gboolean show); 
    6060            void showToolbar (gboolean show); 
     
    8181            gboolean isSensitiveZoomFit (void); 
    8282            gboolean isSensitiveZoomWidth (void); 
    83             gboolean isShownSidebar (void); 
     83            gboolean isShownIndex (void); 
    8484            gboolean isShownStatusbar (void); 
    8585            gboolean isShownToolbar (void); 
     
    112112            gboolean m_Shown; 
    113113            gboolean m_ShownError; 
    114             gboolean m_ShownSidebar; 
     114            gboolean m_ShownIndex; 
    115115            gboolean m_ShownStatusbar; 
    116116            gboolean m_ShownToolbar; 
  • trunk/tests/MainPterTest.cxx

    r122 r123  
    8282    CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 
    8383    CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 
    84     CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 
     84    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
    8585    CPPUNIT_ASSERT (m_View->isShownToolbar ()); 
    8686    CPPUNIT_ASSERT (m_View->isShownStatusbar ()); 
     
    118118    CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 
    119119    CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 
    120     CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 
     120    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
    121121    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    122122 
     
    140140    CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 
    141141    CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 
    142     CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 
     142    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
    143143    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    144144} 
     
    885885 
    886886/// 
    887 /// @brief Checks that the sidebar is shown when a document has outline. 
     887/// @brief Checks that the index is shown when a document has outline. 
    888888///  
    889 /// From now, the sidebar is shown only for the outline (no thumbnails), 
    890 /// so if a document has outline the sidebar should be shown with it. 
    891 /// 
    892889/// When the presenter needs to show the outline, it just passes the root 
    893890/// outline item to the view, and the view must then render it whatever it 
     
    895892/// 
    896893void 
    897 MainPterTest::showSidebar () 
     894MainPterTest::showIndex () 
    898895{ 
    899896    DocumentOutline *outline = new DocumentOutline (); 
     
    911908    // Sleep to let the thread open the file. 
    912909    usleep (SLEEP_TIME); 
    913     CPPUNIT_ASSERT (m_View->isShownSidebar ()); 
     910    CPPUNIT_ASSERT (m_View->isShownIndex ()); 
    914911    CPPUNIT_ASSERT (outline == m_View->getOutline ()); 
    915912    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
     
    922919    CPPUNIT_ASSERT (m_View->hasImagePageView ()); 
    923920 
    924     // When the user clicks on the "Show Sidebar" option, the 
    925     // side bar shown hide. Another click and the sidebar should 
     921    // When the user clicks on the "Show Index" option, the 
     922    // index should hide. Another click and the index should 
    926923    // appear. 
    927     m_MainPter->showSidebarActivated (FALSE); 
    928     CPPUNIT_ASSERT (!m_View->isShownSidebar ()); 
    929     m_MainPter->showSidebarActivated (TRUE); 
    930     CPPUNIT_ASSERT (m_View->isShownSidebar ()); 
     924    m_MainPter->showIndexActivated (FALSE); 
     925    CPPUNIT_ASSERT (!m_View->isShownIndex ()); 
     926    m_MainPter->showIndexActivated (TRUE); 
     927    CPPUNIT_ASSERT (m_View->isShownIndex ()); 
    931928} 
    932929 
  • trunk/tests/MainPterTest.h

    r104 r123  
    4444        CPPUNIT_TEST (reloadEncrypted); 
    4545        CPPUNIT_TEST (reloadChangedPassword); 
    46         CPPUNIT_TEST (showSidebar); 
     46        CPPUNIT_TEST (showIndex); 
    4747        CPPUNIT_TEST (showToolAndStatusBars); 
    4848        CPPUNIT_TEST_SUITE_END(); 
     
    7070            void reloadEncrypted (void); 
    7171            void reloadChangedPassword (void); 
    72             void showSidebar (void); 
     72            void showIndex (void); 
    7373            void showToolAndStatusBars (void); 
    7474