Changeset 123
- Timestamp:
- 04/28/06 03:54:38 (2 years ago)
- Location:
- trunk
- Files:
-
- 10 modified
-
data/epdfview-ui.xml (modified) (1 diff)
-
src/IMainView.h (modified) (2 diffs)
-
src/MainPter.cxx (modified) (2 diffs)
-
src/MainPter.h (modified) (1 diff)
-
src/gtk/MainView.cxx (modified) (8 diffs)
-
src/gtk/MainView.h (modified) (1 diff)
-
tests/DumbMainView.cxx (modified) (3 diffs)
-
tests/DumbMainView.h (modified) (3 diffs)
-
tests/MainPterTest.cxx (modified) (7 diffs)
-
tests/MainPterTest.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/epdfview-ui.xml
r68 r123 10 10 <menuitem name="ShowToolBar" action="ShowToolBar"/> 11 11 <menuitem name="ShowStatusBar" action="ShowStatusBar"/> 12 <menuitem name="Show SideBar" action="ShowSideBar"/>12 <menuitem name="ShowIndex" action="ShowIndex"/> 13 13 <separator/> 14 14 <menuitem name="ZoomIn" action="ZoomIn"/> -
trunk/src/IMainView.h
r117 r123 335 335 336 336 /// 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 /// 337 352 /// @brief Shows a document's page. 338 353 /// … … 353 368 354 369 /// 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 not359 /// when the main window will be displayed.360 ///361 /// After that, the presenter can call it to show or hide the362 /// sidebar when the user toggles the "Show sidebar" option.363 ///364 /// @param show Set to TRUE if the sidebar should be shown. FALSE365 /// otherwise.366 ///367 virtual void showSidebar (gboolean show) = 0;368 369 ///370 370 /// @brief Shows the statusbar. 371 371 /// -
trunk/src/MainPter.cxx
r122 r123 139 139 view.showStatusbar (config.showStatusbar ()); 140 140 view.setOutline (m_Document->getOutline ()); 141 view.show Sidebar(showSidebar);141 view.showIndex (showSidebar); 142 142 // Remove the status bar text. 143 143 view.setStatusBarText (NULL); … … 443 443 444 444 /// 445 /// @brief The "Show Sidebar" was activated.446 /// 447 /// @param show TRUE if the sidebarshould be shown, FALSE otherwise.448 /// 449 void 450 MainPter::show SidebarActivated (gboolean show)451 { 452 getView ().show Sidebar(show);445 /// @brief The "Show Index" was activated. 446 /// 447 /// @param show TRUE if the index should be shown, FALSE otherwise. 448 /// 449 void 450 MainPter::showIndexActivated (gboolean show) 451 { 452 getView ().showIndex (show); 453 453 } 454 454 -
trunk/src/MainPter.h
r120 r123 58 58 void rotateLeftActivated (void); 59 59 void rotateRightActivated (void); 60 void show SidebarActivated (gboolean show);60 void showIndexActivated (gboolean show); 61 61 void showStatusbarActivated (gboolean show); 62 62 void showToolbarActivated (gboolean show); -
trunk/src/gtk/MainView.cxx
r121 r123 50 50 outlineDataColumn, 51 51 outlineNumColumns 52 } outlineColumns;52 } indexColumns; 53 53 54 54 // Forward declarations. … … 79 79 GdkEventScroll *, gpointer); 80 80 static void main_window_quit_cb (GtkWidget *, gpointer); 81 static void main_window_show_ sidebar_cb (GtkToggleAction *, gpointer);81 static void main_window_show_index_cb (GtkToggleAction *, gpointer); 82 82 static void main_window_show_statusbar_cb (GtkToggleAction *, gpointer); 83 83 static void main_window_show_toolbar_cb (GtkToggleAction *, gpointer); … … 152 152 N_("Show or hide the statusbar"), 153 153 G_CALLBACK (main_window_show_statusbar_cb), TRUE }, 154 { "Show SideBar", NULL, N_("Show O_utline"), NULL,154 { "ShowIndex", NULL, N_("Show I_ndex"), "<control>I", 155 155 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 }, 157 157 158 158 { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL, … … 475 475 476 476 void 477 MainView::show Sidebar(gboolean show)477 MainView::showIndex (gboolean show) 478 478 { 479 479 if ( show ) … … 485 485 gtk_widget_hide (m_Sidebar); 486 486 } 487 GtkAction *show SideBar=487 GtkAction *showIndex = 488 488 gtk_ui_manager_get_action (m_UIManager, 489 "/MenuBar/ViewMenu/Show SideBar");490 gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (show SideBar), show);489 "/MenuBar/ViewMenu/ShowIndex"); 490 gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (showIndex), show); 491 491 } 492 492 … … 642 642 /// 643 643 /// Creates the image widget inside the scrolled window, but also creates 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.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. 649 649 /// 650 650 GtkWidget * … … 684 684 m_PageViewScroll); 685 685 686 // Create the side bar, with the outlinetree.686 // Create the side bar, with the index tree. 687 687 m_Outline = gtk_tree_store_new (outlineNumColumns, 688 688 G_TYPE_STRING, G_TYPE_INT, G_TYPE_POINTER); … … 1240 1240 1241 1241 /// 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->show SidebarActivated (gtk_toggle_action_get_active (action));1242 /// @brief Called when the user clicks on the "Show Index" action. 1243 /// 1244 void 1245 main_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)); 1251 1251 } 1252 1252 -
trunk/src/gtk/MainView.h
r117 r123 52 52 void showErrorMessage (const gchar *title, const gchar *body); 53 53 void showPage (DocumentPage *page, PageScroll scroll); 54 void show Sidebar(gboolean show);54 void showIndex (gboolean show); 55 55 void setCursor (ViewCursor cursorType); 56 56 void setTotalPages (gint pages); -
trunk/tests/DumbMainView.cxx
r117 r123 49 49 m_Shown = FALSE; 50 50 m_ShownError = FALSE; 51 m_Shown Sidebar= FALSE;51 m_ShownIndex = FALSE; 52 52 m_ShownStatusbar = FALSE; 53 53 m_ShownToolbar = FALSE; … … 241 241 242 242 void 243 DumbMainView::show Sidebar(gboolean show)244 { 245 m_Shown Sidebar= show;243 DumbMainView::showIndex (gboolean show) 244 { 245 m_ShownIndex = show; 246 246 } 247 247 … … 388 388 389 389 gboolean 390 DumbMainView::isShown Sidebar()391 { 392 return m_Shown Sidebar;390 DumbMainView::isShownIndex () 391 { 392 return m_ShownIndex; 393 393 } 394 394 -
trunk/tests/DumbMainView.h
r117 r123 56 56 void showErrorMessage (const gchar *title, const gchar *body); 57 57 void showPage (DocumentPage *page, PageScroll scroll); 58 void show Sidebar(gboolean show);58 void showIndex (gboolean show); 59 59 void showStatusbar (gboolean show); 60 60 void showToolbar (gboolean show); … … 81 81 gboolean isSensitiveZoomFit (void); 82 82 gboolean isSensitiveZoomWidth (void); 83 gboolean isShown Sidebar(void);83 gboolean isShownIndex (void); 84 84 gboolean isShownStatusbar (void); 85 85 gboolean isShownToolbar (void); … … 112 112 gboolean m_Shown; 113 113 gboolean m_ShownError; 114 gboolean m_Shown Sidebar;114 gboolean m_ShownIndex; 115 115 gboolean m_ShownStatusbar; 116 116 gboolean m_ShownToolbar; -
trunk/tests/MainPterTest.cxx
r122 r123 82 82 CPPUNIT_ASSERT (!m_View->isSensitiveZoomFit ()); 83 83 CPPUNIT_ASSERT (!m_View->isSensitiveZoomWidth ()); 84 CPPUNIT_ASSERT (!m_View->isShown Sidebar());84 CPPUNIT_ASSERT (!m_View->isShownIndex ()); 85 85 CPPUNIT_ASSERT (m_View->isShownToolbar ()); 86 86 CPPUNIT_ASSERT (m_View->isShownStatusbar ()); … … 118 118 CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 119 119 CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 120 CPPUNIT_ASSERT (!m_View->isShown Sidebar());120 CPPUNIT_ASSERT (!m_View->isShownIndex ()); 121 121 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 122 122 … … 140 140 CPPUNIT_ASSERT (m_View->isSensitiveZoomFit ()); 141 141 CPPUNIT_ASSERT (m_View->isSensitiveZoomWidth ()); 142 CPPUNIT_ASSERT (!m_View->isShown Sidebar());142 CPPUNIT_ASSERT (!m_View->isShownIndex ()); 143 143 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 144 144 } … … 885 885 886 886 /// 887 /// @brief Checks that the sidebaris shown when a document has outline.887 /// @brief Checks that the index is shown when a document has outline. 888 888 /// 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 ///892 889 /// When the presenter needs to show the outline, it just passes the root 893 890 /// outline item to the view, and the view must then render it whatever it … … 895 892 /// 896 893 void 897 MainPterTest::show Sidebar()894 MainPterTest::showIndex () 898 895 { 899 896 DocumentOutline *outline = new DocumentOutline (); … … 911 908 // Sleep to let the thread open the file. 912 909 usleep (SLEEP_TIME); 913 CPPUNIT_ASSERT (m_View->isShown Sidebar());910 CPPUNIT_ASSERT (m_View->isShownIndex ()); 914 911 CPPUNIT_ASSERT (outline == m_View->getOutline ()); 915 912 CPPUNIT_ASSERT (m_View->hasImagePageView ()); … … 922 919 CPPUNIT_ASSERT (m_View->hasImagePageView ()); 923 920 924 // When the user clicks on the "Show Sidebar" option, the925 // side bar shown hide. Another click and the sidebarshould921 // When the user clicks on the "Show Index" option, the 922 // index should hide. Another click and the index should 926 923 // appear. 927 m_MainPter->show SidebarActivated (FALSE);928 CPPUNIT_ASSERT (!m_View->isShown Sidebar());929 m_MainPter->show SidebarActivated (TRUE);930 CPPUNIT_ASSERT (m_View->isShown Sidebar());924 m_MainPter->showIndexActivated (FALSE); 925 CPPUNIT_ASSERT (!m_View->isShownIndex ()); 926 m_MainPter->showIndexActivated (TRUE); 927 CPPUNIT_ASSERT (m_View->isShownIndex ()); 931 928 } 932 929 -
trunk/tests/MainPterTest.h
r104 r123 44 44 CPPUNIT_TEST (reloadEncrypted); 45 45 CPPUNIT_TEST (reloadChangedPassword); 46 CPPUNIT_TEST (show Sidebar);46 CPPUNIT_TEST (showIndex); 47 47 CPPUNIT_TEST (showToolAndStatusBars); 48 48 CPPUNIT_TEST_SUITE_END(); … … 70 70 void reloadEncrypted (void); 71 71 void reloadChangedPassword (void); 72 void show Sidebar(void);72 void showIndex (void); 73 73 void showToolAndStatusBars (void); 74 74
