[devhelp: 6/22] Added new book manager dialog



commit 7d4debe491f55abf1120fd430a382793af3f8c07
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Wed May 19 23:17:25 2010 +0200

    Added new book manager dialog

 data/ui/devhelp.builder      |  276 +++++++++++++++++++++++-------------------
 data/ui/window.ui            |    1 +
 src/Makefile.am              |    2 +
 src/dh-book-manager-dialog.c |   90 ++++++++++++++
 src/dh-book-manager-dialog.h |   33 +++++
 src/dh-book-manager.c        |   19 ---
 src/dh-preferences.c         |   22 ++--
 src/dh-window.c              |   10 ++
 8 files changed, 299 insertions(+), 154 deletions(-)
---
diff --git a/data/ui/devhelp.builder b/data/ui/devhelp.builder
index 28cb1bd..287caeb 100644
--- a/data/ui/devhelp.builder
+++ b/data/ui/devhelp.builder
@@ -1,117 +1,61 @@
 <?xml version="1.0"?>
-<!--*- mode: xml -*-->
 <interface>
+  <!-- interface-requires gtk+ 2.12 -->
+  <!-- interface-naming-policy toplevel-contextual -->
   <object class="GtkDialog" id="preferences_dialog">
     <property name="border_width">5</property>
     <property name="title" translatable="yes">Preferences</property>
-    <property name="type">GTK_WINDOW_TOPLEVEL</property>
-    <property name="window_position">GTK_WIN_POS_NONE</property>
-    <property name="modal">False</property>
     <property name="resizable">False</property>
-    <property name="destroy_with_parent">False</property>
-    <property name="decorated">True</property>
-    <property name="skip_taskbar_hint">False</property>
-    <property name="skip_pager_hint">False</property>
-    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
-    <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
-    <property name="focus_on_map">True</property>
-    <property name="urgency_hint">False</property>
+    <property name="type_hint">dialog</property>
     <property name="has_separator">False</property>
     <child internal-child="vbox">
       <object class="GtkVBox" id="dialog-vbox1">
         <property name="visible">True</property>
-        <property name="homogeneous">False</property>
         <property name="spacing">2</property>
-        <child internal-child="action_area">
-          <object class="GtkHButtonBox" id="dialog-action_area1">
-            <property name="visible">True</property>
-            <property name="layout_style">GTK_BUTTONBOX_END</property>
-            <child>
-              <object class="GtkButton" id="close_button">
-                <property name="visible">True</property>
-                <property name="can_default">True</property>
-                <property name="can_focus">True</property>
-                <property name="label">gtk-close</property>
-                <property name="use_stock">True</property>
-                <property name="relief">GTK_RELIEF_NORMAL</property>
-                <property name="focus_on_click">True</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="padding">0</property>
-            <property name="expand">False</property>
-            <property name="fill">True</property>
-            <property name="pack_type">GTK_PACK_END</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkVBox" id="outer_vbox">
-            <property name="border_width">5</property>
             <property name="visible">True</property>
-            <property name="homogeneous">False</property>
+            <property name="border_width">5</property>
             <property name="spacing">18</property>
             <child>
               <object class="GtkVBox" id="font_vbox">
                 <property name="visible">True</property>
-                <property name="homogeneous">False</property>
                 <property name="spacing">6</property>
                 <child>
                   <object class="GtkLabel" id="label6">
                     <property name="visible">True</property>
+                    <property name="xalign">0</property>
                     <property name="label" translatable="yes">&lt;b&gt;Fonts&lt;/b&gt;</property>
-                    <property name="use_underline">False</property>
                     <property name="use_markup">True</property>
-                    <property name="justify">GTK_JUSTIFY_LEFT</property>
-                    <property name="wrap">False</property>
-                    <property name="selectable">False</property>
-                    <property name="xalign">0</property>
-                    <property name="yalign">0.5</property>
-                    <property name="xpad">0</property>
-                    <property name="ypad">0</property>
-                    <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-                    <property name="width_chars">-1</property>
-                    <property name="single_line_mode">False</property>
-                    <property name="angle">0</property>
                   </object>
                   <packing>
-                    <property name="padding">0</property>
                     <property name="expand">False</property>
                     <property name="fill">False</property>
+                    <property name="position">0</property>
                   </packing>
                 </child>
                 <child>
                   <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
-                    <property name="xalign">0.5</property>
-                    <property name="yalign">0.5</property>
-                    <property name="xscale">1</property>
-                    <property name="yscale">1</property>
-                    <property name="top_padding">0</property>
-                    <property name="bottom_padding">0</property>
                     <property name="left_padding">12</property>
-                    <property name="right_padding">0</property>
                     <child>
                       <object class="GtkVBox" id="vbox3">
                         <property name="visible">True</property>
-                        <property name="homogeneous">False</property>
                         <property name="spacing">6</property>
                         <child>
                           <object class="GtkCheckButton" id="system_fonts_button">
+                            <property name="label" translatable="yes">_Use system fonts</property>
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="label" translatable="yes">_Use system fonts</property>
+                            <property name="receives_default">False</property>
                             <property name="use_underline">True</property>
-                            <property name="relief">GTK_RELIEF_NORMAL</property>
-                            <property name="focus_on_click">True</property>
                             <property name="active">True</property>
-                            <property name="inconsistent">False</property>
                             <property name="draw_indicator">True</property>
                           </object>
                           <packing>
-                            <property name="padding">0</property>
                             <property name="expand">False</property>
                             <property name="fill">False</property>
+                            <property name="position">0</property>
                           </packing>
                         </child>
                         <child>
@@ -120,135 +64,219 @@
                             <property name="sensitive">False</property>
                             <property name="n_rows">2</property>
                             <property name="n_columns">2</property>
-                            <property name="homogeneous">False</property>
-                            <property name="row_spacing">6</property>
                             <property name="column_spacing">6</property>
+                            <property name="row_spacing">6</property>
                             <child>
                               <object class="GtkLabel" id="label8">
                                 <property name="visible">True</property>
+                                <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Variable width: </property>
                                 <property name="use_underline">True</property>
-                                <property name="use_markup">False</property>
-                                <property name="justify">GTK_JUSTIFY_LEFT</property>
-                                <property name="wrap">False</property>
-                                <property name="selectable">False</property>
-                                <property name="xalign">0</property>
-                                <property name="yalign">0.5</property>
-                                <property name="xpad">0</property>
-                                <property name="ypad">0</property>
                                 <property name="mnemonic_widget">variable_font_button</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-                                <property name="width_chars">-1</property>
-                                <property name="single_line_mode">False</property>
-                                <property name="angle">0</property>
                               </object>
                               <packing>
-                                <property name="left_attach">0</property>
-                                <property name="right_attach">1</property>
-                                <property name="top_attach">0</property>
-                                <property name="bottom_attach">1</property>
-                                <property name="x_options">fill</property>
-                                <property name="y_options"/>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkLabel" id="label9">
                                 <property name="visible">True</property>
+                                <property name="xalign">0</property>
                                 <property name="label" translatable="yes">_Fixed width:</property>
                                 <property name="use_underline">True</property>
-                                <property name="use_markup">False</property>
-                                <property name="justify">GTK_JUSTIFY_LEFT</property>
-                                <property name="wrap">False</property>
-                                <property name="selectable">False</property>
-                                <property name="xalign">0</property>
-                                <property name="yalign">0.5</property>
-                                <property name="xpad">0</property>
-                                <property name="ypad">0</property>
                                 <property name="mnemonic_widget">fixed_font_button</property>
-                                <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-                                <property name="width_chars">-1</property>
-                                <property name="single_line_mode">False</property>
-                                <property name="angle">0</property>
                               </object>
                               <packing>
-                                <property name="left_attach">0</property>
-                                <property name="right_attach">1</property>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
-                                <property name="x_options">fill</property>
-                                <property name="y_options"/>
+                                <property name="x_options">GTK_FILL</property>
+                                <property name="y_options"></property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkFontButton" id="variable_font_button">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="show_style">True</property>
-                                <property name="show_size">True</property>
+                                <property name="receives_default">False</property>
                                 <property name="use_font">True</property>
-                                <property name="use_size">False</property>
-                                <property name="focus_on_click">True</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
-                                <property name="top_attach">0</property>
-                                <property name="bottom_attach">1</property>
-                                <property name="y_options"/>
+                                <property name="y_options"></property>
                               </packing>
                             </child>
                             <child>
                               <object class="GtkFontButton" id="fixed_font_button">
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
-                                <property name="show_style">True</property>
-                                <property name="show_size">True</property>
+                                <property name="receives_default">False</property>
                                 <property name="use_font">True</property>
-                                <property name="use_size">False</property>
-                                <property name="focus_on_click">True</property>
                               </object>
                               <packing>
                                 <property name="left_attach">1</property>
                                 <property name="right_attach">2</property>
                                 <property name="top_attach">1</property>
                                 <property name="bottom_attach">2</property>
-                                <property name="y_options"/>
+                                <property name="y_options"></property>
                               </packing>
                             </child>
                           </object>
                           <packing>
-                            <property name="padding">0</property>
-                            <property name="expand">True</property>
-                            <property name="fill">True</property>
+                            <property name="position">1</property>
                           </packing>
                         </child>
                       </object>
                     </child>
                   </object>
                   <packing>
-                    <property name="padding">0</property>
-                    <property name="expand">True</property>
-                    <property name="fill">True</property>
+                    <property name="position">1</property>
                   </packing>
                 </child>
               </object>
               <packing>
-                <property name="padding">0</property>
                 <property name="expand">False</property>
                 <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area1">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="preferences_close_button">
+                <property name="label">gtk-close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="receives_default">False</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+    <action-widgets>
+      <action-widget response="-7">preferences_close_button</action-widget>
+    </action-widgets>
+  </object>
+  <object class="GtkListStore" id="book_manager_store">
+    <columns>
+      <!-- column-name name -->
+      <column type="gchararray"/>
+      <!-- column-name title -->
+      <column type="gchararray"/>
+      <!-- column-name enabled -->
+      <column type="gboolean"/>
+      <!-- column-name book -->
+      <column type="gpointer"/>
+    </columns>
+  </object>
+  <object class="GtkDialog" id="book_manager_dialog">
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Book Manager</property>
+    <property name="type_hint">normal</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <object class="GtkVBox" id="dialog-vbox2">
+        <property name="visible">True</property>
+        <property name="spacing">2</property>
+        <child>
+          <object class="GtkVBox" id="internal-vbox1">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkScrolledWindow" id="scrolledwindow1">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="hscrollbar_policy">automatic</property>
+                <property name="vscrollbar_policy">automatic</property>
+                <child>
+                  <object class="GtkTreeView" id="book-manager-treeview">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="model">book_manager_store</property>
+                    <property name="headers_clickable">False</property>
+                    <property name="enable_grid_lines">vertical</property>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="treeviewcolumn1">
+                        <property name="title">Enabled</property>
+                        <child>
+                          <object class="GtkCellRendererToggle" id="cellrenderertoggle1"/>
+                          <attributes>
+                            <attribute name="active">2</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkTreeViewColumn" id="treeviewcolumn2">
+                        <property name="title">Title</property>
+                        <child>
+                          <object class="GtkCellRendererText" id="cellrenderertext1"/>
+                          <attributes>
+                            <attribute name="text">1</attribute>
+                          </attributes>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <object class="GtkHButtonBox" id="dialog-action_area2">
+            <property name="visible">True</property>
+            <property name="layout_style">end</property>
+            <child>
+              <object class="GtkButton" id="book_manager_close_button">
+                <property name="label" translatable="yes">Close</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+                <property name="position">1</property>
               </packing>
             </child>
           </object>
           <packing>
-            <property name="padding">0</property>
-            <property name="expand">True</property>
-            <property name="fill">True</property>
+            <property name="expand">False</property>
+            <property name="pack_type">end</property>
+            <property name="position">0</property>
           </packing>
         </child>
       </object>
     </child>
     <action-widgets>
-      <action-widget response="-7">close_button</action-widget>
+      <action-widget response="0">book_manager_close_button</action-widget>
     </action-widgets>
   </object>
 </interface>
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 3018b54..b2b738f 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -18,6 +18,7 @@
       <menuitem action="Find Previous"/>
       <separator/>
       <menuitem action="Preferences"/>
+      <menuitem action="BookManager"/>
     </menu>
     <menu action="ViewMenu">
       <menuitem action="ZoomIn"/>
diff --git a/src/Makefile.am b/src/Makefile.am
index 0ea5bce..e315fa2 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -81,10 +81,12 @@ libdevhelp_1_la_SOURCES =				\
 	dh-search.c					\
 	dh-parser.c					\
 	dh-preferences.c				\
+	dh-book-manager-dialog.c			\
 	dh-util.c					\
 	dh-window.c					\
 	dh-parser.h					\
 	dh-preferences.h                                \
+	dh-book-manager-dialog.h			\
 	dh-util.h					\
 	eggfindbar.c					\
 	eggfindbar.h					\
diff --git a/src/dh-book-manager-dialog.c b/src/dh-book-manager-dialog.c
new file mode 100644
index 0000000..14f530a
--- /dev/null
+++ b/src/dh-book-manager-dialog.c
@@ -0,0 +1,90 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Lanedo GmbH
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#include "config.h"
+#include <gtk/gtk.h>
+#include <string.h>
+#include "dh-util.h"
+#include "dh-book-manager-dialog.h"
+#include "ige-conf.h"
+#include "dh-base.h"
+
+typedef struct {
+	GtkWidget *dialog;
+
+} DhBookManagerDialog;
+
+#define DH_CONF_PATH                  "/apps/devhelp"
+
+static DhBookManagerDialog *prefs;
+
+static void
+book_manager_dialog_init (void)
+{
+	if (!prefs) {
+                prefs = g_new0 (DhBookManagerDialog, 1);
+        }
+}
+
+static void
+book_manager_dialog_close_cb (GtkButton *button, gpointer user_data)
+{
+	DhBookManagerDialog *prefs = user_data;
+
+	gtk_widget_destroy (GTK_WIDGET (prefs->dialog));
+
+	prefs->dialog = NULL;
+}
+
+void
+dh_book_manager_dialog_show (GtkWindow *parent)
+{
+        gchar      *path;
+	GtkBuilder *builder;
+
+        book_manager_dialog_init ();
+
+	if (prefs->dialog != NULL) {
+		gtk_window_present (GTK_WINDOW (prefs->dialog));
+		return;
+	}
+
+        path = dh_util_build_data_filename ("devhelp", "ui",
+                                            "devhelp.builder",
+                                            NULL);
+	builder = dh_util_builder_get_file (
+                path,
+                "book_manager_dialog",
+                NULL,
+                "book_manager_dialog", &prefs->dialog,
+                NULL);
+        g_free (path);
+
+	dh_util_builder_connect (
+                builder,
+                prefs,
+                "book_manager_close_button", "clicked", book_manager_dialog_close_cb,
+                NULL);
+
+	g_object_unref (builder);
+
+	gtk_window_set_transient_for (GTK_WINDOW (prefs->dialog), parent);
+	gtk_widget_show_all (prefs->dialog);
+}
diff --git a/src/dh-book-manager-dialog.h b/src/dh-book-manager-dialog.h
new file mode 100644
index 0000000..51eb925
--- /dev/null
+++ b/src/dh-book-manager-dialog.h
@@ -0,0 +1,33 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2010 Lanedo Gmbh
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __DH_BOOK_MANAGER_DIALOG_H__
+#define __DH_BOOK_MANAGER_DIALOG_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+void dh_book_manager_dialog_show (GtkWindow *parent);
+
+G_END_DECLS
+
+#endif /* __DH_BOOK_MANAGER_DIALOG_H__ */
+
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index 949fbd5..f41251b 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -51,11 +51,6 @@ static void    book_manager_add_from_xcode_docset (DhBookManager *book_manager,
                                                    const gchar   *dir_path);
 #endif
 
-static void    unref_node_link                  (GNode *node,
-                                                 gpointer data);
-static void    ref_node_link                    (GNode *node,
-                                                 gpointer data);
-
 static void
 book_manager_finalize (GObject *object)
 {
@@ -94,20 +89,6 @@ dh_book_manager_init (DhBookManager *book_manager)
 }
 
 static void
-unref_node_link (GNode *node,
-                 gpointer data)
-{
-        dh_link_unref (node->data);
-}
-
-static void
-ref_node_link (GNode *node,
-               gpointer data)
-{
-        dh_link_ref (node->data);
-}
-
-static void
 book_manager_add_books_in_data_dir (DhBookManager *book_manager,
                                     const gchar   *data_dir)
 {
diff --git a/src/dh-preferences.c b/src/dh-preferences.c
index acd5463..f4986ba 100644
--- a/src/dh-preferences.c
+++ b/src/dh-preferences.c
@@ -21,7 +21,7 @@
 #include "config.h"
 #include <gtk/gtk.h>
 #include <string.h>
-#include "dh-util.h" 
+#include "dh-util.h"
 #include "dh-preferences.h"
 #include "ige-conf.h"
 #include "dh-base.h"
@@ -113,7 +113,7 @@ preferences_close_cb (GtkButton *button, gpointer user_data)
 }
 
 static void
-preferences_system_fonts_toggled_cb (GtkToggleButton *button, 
+preferences_system_fonts_toggled_cb (GtkToggleButton *button,
 				     gpointer         user_data)
 {
 	DhPreferences *prefs = user_data;
@@ -124,7 +124,7 @@ preferences_system_fonts_toggled_cb (GtkToggleButton *button,
 	ige_conf_set_bool (ige_conf_get (),
                            DH_CONF_USE_SYSTEM_FONTS,
                            active);
-	
+
 	gtk_widget_set_sensitive (prefs->fonts_table, !active);
 }
 
@@ -185,7 +185,7 @@ preferences_use_system_font_notify_cb (IgeConf     *client,
 		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->system_fonts_button),
 					      use_system_fonts);
 	}
-	
+
 	if (prefs->fonts_table) {
 		gtk_widget_set_sensitive (prefs->fonts_table, !use_system_fonts);
 	}
@@ -231,7 +231,7 @@ preferences_connect_conf_listeners (void)
 
 /* FIXME: Use the functions in dh-util.c for this. */
 static void
-preferences_get_font_names (gboolean   use_system_fonts, 
+preferences_get_font_names (gboolean   use_system_fonts,
 			    gchar    **variable,
 			    gchar    **fixed)
 {
@@ -254,7 +254,7 @@ preferences_get_font_names (gboolean   use_system_fonts,
 #endif
 	} else {
 		ige_conf_get_string (conf,
-                                     DH_CONF_VARIABLE_FONT, 
+                                     DH_CONF_VARIABLE_FONT,
                                      &var_font_name);
                 ige_conf_get_string (conf,
                                      DH_CONF_FIXED_FONT,
@@ -300,7 +300,7 @@ dh_preferences_show_dialog (GtkWindow *parent)
                 prefs,
                 "variable_font_button", "font_set", preferences_font_set_cb,
                 "fixed_font_button", "font_set", preferences_font_set_cb,
-                "close_button", "clicked", preferences_close_cb,
+                "preferences_close_button", "clicked", preferences_close_cb,
                 "system_fonts_button", "toggled", preferences_system_fonts_toggled_cb,
                 NULL);
 
@@ -312,7 +312,7 @@ dh_preferences_show_dialog (GtkWindow *parent)
 	gtk_widget_set_sensitive (prefs->fonts_table, !use_system_fonts);
 
 	preferences_get_font_names (FALSE, &var_font_name, &fixed_font_name);
-	
+
 	if (var_font_name) {
 		gtk_font_button_set_font_name (GTK_FONT_BUTTON (prefs->variable_font_button),
 					       var_font_name);
@@ -324,9 +324,9 @@ dh_preferences_show_dialog (GtkWindow *parent)
 					       fixed_font_name);
 		g_free (fixed_font_name);
 	}
-	
+
 	g_object_unref (builder);
-	
-	gtk_window_set_transient_for (GTK_WINDOW (prefs->dialog), parent); 
+
+	gtk_window_set_transient_for (GTK_WINDOW (prefs->dialog), parent);
 	gtk_widget_show_all (prefs->dialog);
 }
diff --git a/src/dh-window.c b/src/dh-window.c
index 99918a0..0650825 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -40,6 +40,7 @@
 #include "dh-book-manager.h"
 #include "dh-book.h"
 #include "dh-preferences.h"
+#include "dh-book-manager-dialog.h"
 #include "dh-search.h"
 #include "dh-window.h"
 #include "dh-util.h"
@@ -659,6 +660,13 @@ window_activate_preferences (GtkAction *action,
 }
 
 static void
+window_activate_book_manager (GtkAction *action,
+                              DhWindow *window)
+{
+        dh_book_manager_dialog_show (GTK_WINDOW (window));
+}
+
+static void
 window_activate_back (GtkAction *action,
                       DhWindow  *window)
 {
@@ -796,6 +804,8 @@ static const GtkActionEntry actions[] = {
           G_CALLBACK (window_find_previous_cb) },
         { "Preferences", GTK_STOCK_PREFERENCES, NULL, NULL, NULL,
           G_CALLBACK (window_activate_preferences) },
+        { "BookManager", GTK_STOCK_FILE, N_("Manage booksâ?¦"), NULL, NULL,
+          G_CALLBACK (window_activate_book_manager) },
 
         /* Go menu */
         { "Back", GTK_STOCK_GO_BACK, NULL, "<alt>Left",



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]