Show
Ignore:
Timestamp:
04/14/06 15:05:24 (3 years ago)
Author:
jordi
Message:

Added the reload action to the GTK's MainView?.

Also I fixed a weird bug (although I don't really know if it's mine) that deleted the m_FileName of the IDocument when reloaded the new file.

Files:
1 modified

Legend:

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

    r57 r64  
    4141static void main_window_go_to_page_cb (GtkWidget *, gpointer); 
    4242static 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); 
     43static void main_window_reload_cb (GtkWidget *, gpointer); 
     44static void main_window_rotate_left_cb (GtkWidget *, gpointer); 
     45static void main_window_rotate_right_cb (GtkWidget *, gpointer); 
    4546static void main_window_open_file_cb (GtkWidget *, gpointer); 
    4647static void main_window_quit_cb (GtkWidget *, gpointer); 
     
    6061    { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O",        
    6162      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) }, 
    6368     
    6469    { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",  
     
    8489    { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), NULL,  
    8590      N_("Rotate the document 90 degrees clockwise"),  
    86       G_CALLBACK (main_window_rotate_right) }, 
     91      G_CALLBACK (main_window_rotate_right_cb) }, 
    8792 
    8893    { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), NULL,  
    8994      N_("Rotate the document 90 degrees counter-clockwise"),  
    90       G_CALLBACK (main_window_rotate_left) }, 
     95      G_CALLBACK (main_window_rotate_left_cb) }, 
    9196 
    9297    { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home", 
     
    274279 
    275280void  
     281MainView::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 
     288void  
    276289MainView::sensitiveRotateLeft (gboolean sensitive) 
    277290{ 
     
    629642 
    630643/// 
     644/// @brief The user tried to reload the current document. 
     645/// 
     646void 
     647main_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/// 
    631656/// @brief The user tried to rotate the document counter-clockwise. 
    632657/// 
    633658void 
    634 main_window_rotate_left (GtkWidget *widget, gpointer data) 
     659main_window_rotate_left_cb (GtkWidget *widget, gpointer data) 
    635660{ 
    636661    g_assert ( NULL != data && "The data parameter is NULL."); 
     
    644669/// 
    645670void 
    646 main_window_rotate_right (GtkWidget *widget, gpointer data) 
     671main_window_rotate_right_cb (GtkWidget *widget, gpointer data) 
    647672{ 
    648673    g_assert ( NULL != data && "The data parameter is NULL.");