Show
Ignore:
Timestamp:
06/11/07 09:12:09 (18 months ago)
Author:
jordi
Message:

Added a patch by Igor Vagulin which adds text selection and copy to clipboard features. This fixes bug #14.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/gtk/MainView.cxx

    r263 r277  
    7777static void main_window_zoom_out_cb (GtkWidget *, gpointer); 
    7878static void main_window_zoom_width_cb (GtkToggleAction *, gpointer); 
     79static void main_window_page_mode_scroll_cb (GtkToggleAction *, gpointer); 
     80static void main_window_page_mode_text_cb (GtkToggleAction *, gpointer); 
    7981 
    8082#if defined (HAVE_CUPS) 
     
    186188    { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL, 
    187189      N_("Make the current document fill the window width"), 
    188       G_CALLBACK (main_window_zoom_width_cb), FALSE } 
     190      G_CALLBACK (main_window_zoom_width_cb), FALSE }, 
     191 
     192    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL, 
     193      N_("Mouse scroll page"), 
     194      G_CALLBACK (main_window_page_mode_scroll_cb), FALSE }, 
     195 
     196    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL, 
     197      N_(" Mouse select text"), 
     198      G_CALLBACK (main_window_page_mode_text_cb), FALSE }, 
    189199 
    190200}; 
     
    273283} 
    274284 
     285void 
     286MainView::activePageModeScroll (gboolean active) 
     287{ 
     288    GtkAction *action = 
     289        gtk_ui_manager_get_action (m_UIManager, "/ToolBar/PageModeScroll"); 
     290    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active); 
     291} 
     292 
     293 
     294void 
     295MainView::activePageModeText (gboolean active) 
     296{ 
     297    GtkAction *action = 
     298        gtk_ui_manager_get_action (m_UIManager, "/ToolBar/PageModeText"); 
     299    gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), active); 
     300} 
     301 
    275302gchar * 
    276303MainView::openFileDialog (const gchar *lastFolder) 
     
    10371064        } 
    10381065    } 
     1066} 
     1067 
     1068void 
     1069MainView::copyTextToClibboard(const gchar* text) 
     1070{ 
     1071    GtkClipboard *clipboard = gtk_clipboard_get(GDK_SELECTION_PRIMARY); 
     1072    gtk_clipboard_set_text(clipboard, text, -1); 
    10391073} 
    10401074 
     
    14171451    pter->zoomWidthActivated (gtk_toggle_action_get_active (action)); 
    14181452} 
     1453 
     1454void 
     1455main_window_page_mode_scroll_cb (GtkToggleAction *action, gpointer data) 
     1456{ 
     1457    g_assert ( NULL != data && "The data parameter is NULL."); 
     1458 
     1459    MainPter *pter = (MainPter *)data; 
     1460    pter->pageModeScrollActivated (gtk_toggle_action_get_active (action)); 
     1461} 
     1462 
     1463void 
     1464main_window_page_mode_text_cb (GtkToggleAction *action, gpointer data) 
     1465{ 
     1466    g_assert ( NULL != data && "The data parameter is NULL."); 
     1467 
     1468    MainPter *pter = (MainPter *)data; 
     1469    pter->pageModeTextActivated (gtk_toggle_action_get_active (action)); 
     1470}