commit 084bebb91d77a0bdc303aaad2108cab2424c9088
Author: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e>
Date:   Fri Dec 4 12:42:41 2009 +0000

    Gtk's FindView now disables the slash ("/") accelerator key when it is shown and restores its values when hidden.  This allows to enter actual slashes in the search text.
    
    
    git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@346 cb4bfb15-1111-0410-82e2-95233c8f1c7e

diff --git a/src/gtk/FindView.cxx b/src/gtk/FindView.cxx
index fecb804..0c605fc 100644
--- a/src/gtk/FindView.cxx
+++ b/src/gtk/FindView.cxx
@@ -25,6 +25,11 @@
 
 using namespace ePDFView;
 
+namespace
+{
+    const gchar *g_SlashAccelPath = "<Actions>/ePDFView/Slash";
+}
+
 // Forwards declarations.
 static void find_view_close_cb (GtkWidget *, gpointer);
 static void find_view_next_cb (GtkWidget *, gpointer);
@@ -37,6 +42,8 @@ static gboolean find_view_text_to_find_key_press_cb (GtkEntry *, GdkEventKey *,
 FindView::FindView ():
     IFindView ()
 {
+    gtk_accel_map_lookup_entry(g_SlashAccelPath, &m_SlashAccelKey);
+
     m_FindBar = gtk_toolbar_new ();
     // Set the toolbar style to horizontal, so most toolbuttons' labels won't be
     // shown.
@@ -92,6 +99,9 @@ FindView::getTextToFind ()
 void
 FindView::hide ()
 {
+    // Restore the slash accelerator's value when no longer searching.
+    gtk_accel_map_change_entry(g_SlashAccelPath, m_SlashAccelKey.accel_key,
+            m_SlashAccelKey.accel_mods, false);
     gtk_entry_set_text (GTK_ENTRY (m_TextToFind), "");
     gtk_widget_hide (m_FindBar);
 }
@@ -136,6 +146,11 @@ FindView::setPresenter (FindPter *pter)
 
     IFindView::setPresenter (pter);
 
+    // Map the slash ("/") accelerator to nothing, in order to be able
+    // to add an actual slash to the search text.
+    gtk_accel_map_change_entry(g_SlashAccelPath, 0,
+            m_SlashAccelKey.accel_mods, false);
+
     gtk_widget_show_all (m_FindBar);
     gtk_widget_grab_focus (m_TextToFind);
 
diff --git a/src/gtk/FindView.h b/src/gtk/FindView.h
index b858994..f136cd7 100644
--- a/src/gtk/FindView.h
+++ b/src/gtk/FindView.h
@@ -41,6 +41,7 @@ namespace ePDFView
             GtkToolItem *m_FindPrevious;
             GtkWidget *m_InformationText;
             GtkWidget *m_TextToFind;
+            GtkAccelKey m_SlashAccelKey;
     };
 }
 
