summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2001-12-10 04:29:33 +0000
committerMikael Hallendal <hallski@src.gnome.org>2001-12-10 04:29:33 +0000
commit78bcb93c83d699a8a87c04933c8b71c92d68499f (patch)
tree8dbb8c63453168abb4433e9fb81afa943d0c7c06
parent0018e7408b71d0b4b228a716672851fd358d5e54 (diff)
downloadyelp-78bcb93c83d699a8a87c04933c8b71c92d68499f.tar.gz
Some fixes after discussion with seth. (yw_init): Yelp: GNOME Help Browser
2001-12-10 Mikael Hallendal <micke@codefactory.se> * src/yelp-window.c: Some fixes after discussion with seth. (yw_init): Yelp: GNOME Help Browser -> Help Browser. (yw_populate): readded the menu (yw_close_cb): removed (yw_new_window_cb): readded (yw_exit_cb): readded (yw_about_cb): readded (yw_create_toolbar): removed the Close-button * configure.in: changed Yelp->yelp in AM_INIT_AUTOMAKE.
-rw-r--r--ChangeLog11
-rw-r--r--configure.in2
-rw-r--r--src/yelp-window.c99
3 files changed, 89 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index ebd19fb4..54f19e0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2001-12-10 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-window.c: Some fixes after discussion with seth.
+ (yw_init): Yelp: GNOME Help Browser -> Help Browser.
+ (yw_populate): readded the menu
+ (yw_close_cb): removed
+ (yw_new_window_cb): readded
+ (yw_exit_cb): readded
+ (yw_about_cb): readded
+ (yw_create_toolbar): removed the Close-button
+
+ * configure.in: changed Yelp->yelp in AM_INIT_AUTOMAKE.
+
* src/yelp-view-home.c (yelp_view_home_new):
- updated color to white background, less difference between the
views now.
diff --git a/configure.in b/configure.in
index c3889298..e7b94ecd 100644
--- a/configure.in
+++ b/configure.in
@@ -1,6 +1,6 @@
AC_INIT(src/yelp-main.c)
AM_CONFIG_HEADER(config.h)
-AM_INIT_AUTOMAKE(Yelp, 0.01)
+AM_INIT_AUTOMAKE(yelp, 0.01)
AC_PROG_INTLTOOL
diff --git a/src/yelp-window.c b/src/yelp-window.c
index b6c54a44..14401e58 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -28,7 +28,7 @@
#include <gtk/gtk.h>
#include <libgtkhtml/gtkhtml.h>
#include <libgnomevfs/gnome-vfs.h>
-#include <libgnomeui/gnome-app.h>
+#include <libgnomeui/gnome-about.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
#include "yelp-html.h"
@@ -44,10 +44,6 @@ static void yw_class_init (YelpWindowClass *klass);
static void yw_populate (YelpWindow *window);
-static void yw_close_cb (gpointer data,
- guint section,
- GtkWidget *widget);
-
#if 0
static void yw_section_selected_cb (YelpWindow *window,
YelpSection *section);
@@ -64,6 +60,15 @@ static void yw_home_button_clicked (GtkWidget *button,
YelpWindow *window);
static void yw_index_button_clicked (GtkWidget *button,
YelpWindow *window);
+static void yw_new_window_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void yw_exit_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
+static void yw_about_cb (gpointer data,
+ guint section,
+ GtkWidget *widget);
static GtkWidget * yw_create_toolbar (YelpWindow *window);
enum {
@@ -89,6 +94,14 @@ struct _YelpWindowPriv {
GtkWidget *back_button;
};
+static GtkItemFactoryEntry menu_items[] = {
+ {N_("/_File"), NULL, 0, 0, "<Branch>"},
+ {N_("/File/_New window"), "<Control>N", yw_new_window_cb, 0, NULL},
+ {N_("/File/E_xit"), "<Control>Q", yw_exit_cb, 0, NULL },
+ {N_("/_Help"), NULL, 0, 0, "<Branch>"},
+ {N_("/Help/_About"), NULL, yw_about_cb, 0, NULL },
+};
+
GType
yelp_window_get_type (void)
{
@@ -133,7 +146,7 @@ yw_init (YelpWindow *window)
gtk_window_set_default_size (GTK_WINDOW (window), 800, 600);
- gtk_window_set_title (GTK_WINDOW (window), _("Yelp: GNOME Help Browser"));
+ gtk_window_set_title (GTK_WINDOW (window), _("Help Browser"));
}
static void
@@ -151,13 +164,27 @@ yw_populate (YelpWindow *window)
GtkWidget *toolbar;
GtkWidget *main_box;
GtkWidget *sw;
-
+ GtkItemFactory *item_factory;
+
priv = window->priv;
main_box = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (window), main_box);
+ item_factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR,
+ "<main>", NULL);
+
+ gtk_item_factory_create_items (item_factory,
+ G_N_ELEMENTS (menu_items),
+ menu_items,
+ window);
+
+ gtk_box_pack_start (GTK_BOX (main_box),
+ gtk_item_factory_get_widget (item_factory,
+ "<main>"),
+ FALSE, FALSE, 0);
+
toolbar = yw_create_toolbar (window);
priv->notebook = gtk_notebook_new ();
@@ -192,12 +219,6 @@ yw_populate (YelpWindow *window)
TRUE, TRUE, 0);
}
-static void
-yw_close_cb (gpointer data, guint section, GtkWidget *widget)
-{
- gtk_main_quit ();
-}
-
#if 0
static void
yw_section_selected_cb (YelpWindow *window,
@@ -299,6 +320,49 @@ yw_index_button_clicked (GtkWidget *button, YelpWindow *window)
PAGE_INDEX_VIEW);
}
+static void
+yw_new_window_cb (gpointer data, guint section, GtkWidget *widget)
+{
+/* YelpWindow *window; */
+
+ g_return_if_fail (YELP_IS_WINDOW (data));
+
+/* window = YELP_WINDOW (data); */
+
+ g_print ("FIXME: NEW WINDOW\n");
+
+ /* Emit new_window signal */
+/* new_window = yelp_base_new_window (window->priv->base); */
+
+/* gtk_widget_show_all (new_window); */
+}
+
+static void
+yw_exit_cb (gpointer data, guint section, GtkWidget *widget)
+{
+ gtk_main_quit ();
+}
+
+static void
+yw_about_cb (gpointer data, guint section, GtkWidget *widget)
+{
+ GtkWidget *about;
+ const gchar *authors[] = {
+ "Mikael Hallendal <micke@codefactory.se>",
+ NULL
+ };
+
+ about = gnome_about_new (PACKAGE, VERSION,
+ "(C) 2001 Mikael Hallendal <micke@codefactory.se>",
+ _("Help Browser for GNOME 2.0"),
+ authors,
+ NULL,
+ NULL,
+ NULL);
+
+ gtk_widget_show (about);
+}
+
static GtkWidget *
yw_create_toolbar (YelpWindow *window)
{
@@ -379,15 +443,6 @@ yw_create_toolbar (YelpWindow *window)
gtk_entry_new (),
"", "");
- button = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar),
- "gtk-close",
- "", "",
- NULL, NULL, -1);
-
- g_signal_connect (button, "clicked",
- G_CALLBACK (yw_close_cb),
- G_OBJECT (window));
-
return toolbar;
}