Changeset 64
- Timestamp:
- 04/14/06 15:05:24 (2 years ago)
- Location:
- trunk
- Files:
-
- 6 modified
-
data/epdfview-ui.xml (modified) (1 diff)
-
src/IDocument.cxx (modified) (1 diff)
-
src/MainPter.cxx (modified) (1 diff)
-
src/gtk/MainView.cxx (modified) (6 diffs)
-
src/gtk/MainView.h (modified) (1 diff)
-
tests/MainPterTest.cxx (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/data/epdfview-ui.xml
r42 r64 1 1 <ui> 2 <menubar name='MenuBar'> 3 <menu action='FileMenu'> 4 <menuitem name='OpenFile' action='OpenFile'/> 2 <menubar name="MenuBar"> 3 <menu action="FileMenu"> 4 <menuitem name="OpenFile" action="OpenFile"/> 5 <menuitem name="ReloadFile" action="ReloadFile"/> 5 6 <separator/> 6 <menuitem name= 'Quit' action='Quit'/>7 <menuitem name="Quit" action="Quit"/> 7 8 </menu> 8 <menu action= 'ViewMenu'>9 <menuitem name= 'ZoomIn' action='ZoomIn'/>10 <menuitem name= 'ZoomOut' action='ZoomOut'/>11 <menuitem name= 'ZoomFit' action='ZoomFit'/>12 <menuitem name= 'ZoomWidth' action='ZoomWidth'/>9 <menu action="ViewMenu"> 10 <menuitem name="ZoomIn" action="ZoomIn"/> 11 <menuitem name="ZoomOut" action="ZoomOut"/> 12 <menuitem name="ZoomFit" action="ZoomFit"/> 13 <menuitem name="ZoomWidth" action="ZoomWidth"/> 13 14 <separator /> 14 <menuitem name= 'RotateRight' action='RotateRight'/>15 <menuitem name= 'RotateLeft' action='RotateLeft'/>15 <menuitem name="RotateRight" action="RotateRight"/> 16 <menuitem name="RotateLeft" action="RotateLeft"/> 16 17 </menu> 17 <menu action= 'GoMenu'>18 <menuitem name= 'GoToFirstPage' action='GoToFirstPage'/>19 <menuitem name= 'GoToPreviousPage' action='GoToPreviousPage'/>20 <menuitem name= 'GoToNextPage' action='GoToNextPage'/>21 <menuitem name= 'GoToLastPage' action='GoToLastPage'/>18 <menu action="GoMenu"> 19 <menuitem name="GoToFirstPage" action="GoToFirstPage"/> 20 <menuitem name="GoToPreviousPage" action="GoToPreviousPage"/> 21 <menuitem name="GoToNextPage" action="GoToNextPage"/> 22 <menuitem name="GoToLastPage" action="GoToLastPage"/> 22 23 </menu> 23 <menu action= 'HelpMenu'>24 <menuitem name= 'About' action='About'/>24 <menu action="HelpMenu"> 25 <menuitem name="About" action="About"/> 25 26 </menu> 26 27 </menubar> 27 28 28 <toolbar name= 'ToolBar'>29 <toolitem name= 'OpenFile' action='OpenFile'/>29 <toolbar name="ToolBar"> 30 <toolitem name="OpenFile" action="OpenFile"/> 30 31 <separator/> 31 <toolitem name= 'GoToPreviousPage' action='GoToPreviousPage'/>32 <toolitem name= 'GoToNextPage' action='GoToNextPage'/>32 <toolitem name="GoToPreviousPage" action="GoToPreviousPage"/> 33 <toolitem name="GoToNextPage" action="GoToNextPage"/> 33 34 <separator/> 34 <toolitem name= 'ZoomIn' action='ZoomIn'/>35 <toolitem name= 'ZoomOut' action='ZoomOut'/>36 <toolitem name= 'ZoomFit' action='ZoomFit'/>37 <toolitem name= 'ZoomWidth' action='ZoomWidth'/>35 <toolitem name="ZoomIn" action="ZoomIn"/> 36 <toolitem name="ZoomOut" action="ZoomOut"/> 37 <toolitem name="ZoomFit" action="ZoomFit"/> 38 <toolitem name="ZoomWidth" action="ZoomWidth"/> 38 39 </toolbar> 39 40 </ui> -
trunk/src/IDocument.cxx
r63 r64 540 540 g_assert (NULL != fileName && "Tried to set a NULL file name."); 541 541 542 g_free (m_FileName); 542 // Don't ask me why, but then I set like this: 543 // g_free (m_FileName); 544 // m_FileName = fileName 545 // Somehow the g_free also frees the parameter ???????? 546 // 547 gchar *oldFileName = m_FileName; 543 548 m_FileName = g_strdup (fileName); 549 g_free (oldFileName); 544 550 } 545 551 -
trunk/src/MainPter.cxx
r63 r64 263 263 gdouble currentZoom = m_Document->getZoom (); 264 264 // Reopen the document. 265 openDocument (m_Document->getFileName (), FALSE); 265 openDocument (m_Document->getFileName (), FALSE); 266 266 // And restore the state 267 267 m_Document->setZoom (currentZoom); -
trunk/src/gtk/MainView.cxx
r57 r64 41 41 static void main_window_go_to_page_cb (GtkWidget *, gpointer); 42 42 static void main_window_go_to_previous_page_cb (GtkWidget *, gpointer); 43 static void main_window_rotate_left (GtkWidget *, gpointer); 44 static void main_window_rotate_right (GtkWidget *, gpointer); 43 static void main_window_reload_cb (GtkWidget *, gpointer); 44 static void main_window_rotate_left_cb (GtkWidget *, gpointer); 45 static void main_window_rotate_right_cb (GtkWidget *, gpointer); 45 46 static void main_window_open_file_cb (GtkWidget *, gpointer); 46 47 static void main_window_quit_cb (GtkWidget *, gpointer); … … 60 61 { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O", 61 62 N_("Open a PDF document"), 62 G_CALLBACK (main_window_open_file_cb) }, 63 G_CALLBACK (main_window_open_file_cb) }, 64 65 { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R", 66 N_("Reload the current document"), 67 G_CALLBACK (main_window_reload_cb) }, 63 68 64 69 { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W", … … 84 89 { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), NULL, 85 90 N_("Rotate the document 90 degrees clockwise"), 86 G_CALLBACK (main_window_rotate_right ) },91 G_CALLBACK (main_window_rotate_right_cb) }, 87 92 88 93 { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), NULL, 89 94 N_("Rotate the document 90 degrees counter-clockwise"), 90 G_CALLBACK (main_window_rotate_left ) },95 G_CALLBACK (main_window_rotate_left_cb) }, 91 96 92 97 { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home", … … 274 279 275 280 void 281 MainView::sensitiveReload (gboolean sensitive) 282 { 283 GtkAction *reload = 284 gtk_ui_manager_get_action (m_UIManager, "/MenuBar/FileMenu/ReloadFile"); 285 gtk_action_set_sensitive (reload, sensitive); 286 } 287 288 void 276 289 MainView::sensitiveRotateLeft (gboolean sensitive) 277 290 { … … 629 642 630 643 /// 644 /// @brief The user tried to reload the current document. 645 /// 646 void 647 main_window_reload_cb (GtkWidget *widget, gpointer data) 648 { 649 g_assert ( NULL != data && "The data parameter is NULL."); 650 651 MainPter *pter = (MainPter *)data; 652 pter->reloadActivated (); 653 } 654 655 /// 631 656 /// @brief The user tried to rotate the document counter-clockwise. 632 657 /// 633 658 void 634 main_window_rotate_left (GtkWidget *widget, gpointer data)659 main_window_rotate_left_cb (GtkWidget *widget, gpointer data) 635 660 { 636 661 g_assert ( NULL != data && "The data parameter is NULL."); … … 644 669 /// 645 670 void 646 main_window_rotate_right (GtkWidget *widget, gpointer data)671 main_window_rotate_right_cb (GtkWidget *widget, gpointer data) 647 672 { 648 673 g_assert ( NULL != data && "The data parameter is NULL."); -
trunk/src/gtk/MainView.h
r44 r64 39 39 void sensitiveGoToPage (gboolean sensitive); 40 40 void sensitiveGoToPreviousPage (gboolean sensitive); 41 void sensitiveReload (gboolean sensitive); 41 42 void sensitiveRotateLeft (gboolean sensitive); 42 43 void sensitiveRotateRight (gboolean sensitive); -
trunk/tests/MainPterTest.cxx
r63 r64 570 570 // Reload the document. 571 571 m_MainPter->reloadActivated (); 572 CPPUNIT_ASSERT_EQUAL (0, 573 g_ascii_strcasecmp ("/tmp/test.pdf", m_View->getTitle ())); 572 574 CPPUNIT_ASSERT_EQUAL (2, m_View->getCurrentPage ()); 573 575 CPPUNIT_ASSERT_EQUAL (90, m_Document->getRotation ());
