Commit 36c73f74 authored by Richard Hult's avatar Richard Hult Committed by Richard Hult

Exit when the window is closed.

2001-12-01  Richard Hult  <rhult@codefactory.se>

	* src/main.c (main): Exit when the window is closed.

	* src/*.c: Mark strings as translatable.

	* src/main.c (main): Init gettext.

	* acconfig.h: Add.

	* configure.in: Gettextize and intltoolize.

	* autogen.sh: Redirect to the installed one for gnome 2.

	* yelp.desktop.in: Desktop file.

	* Makefile.am: Add a desktop file and intltool rule for it.
parent 57c850dc
2001-12-01 Richard Hult <rhult@codefactory.se>
* src/main.c (main): Exit when the window is closed.
* src/*.c: Mark strings as translatable.
* src/main.c (main): Init gettext.
* acconfig.h: Add.
* configure.in: Gettextize and intltoolize.
* autogen.sh: Redirect to the installed one for gnome 2.
* yelp.desktop.in: Desktop file.
* Makefile.am: Add a desktop file and intltool rule for it.
2001-12-01 Mikael Hallendal <micke@codefactory.se>
* src/scrollkeeper-parser.c: path uri's as strings instead of
......
SUBDIRS = src
SUBDIRS = src po
@INTLTOOL_DESKTOP_RULE@
DESKTOP_IN_FILES=yelp.desktop.in
DESKTOP_FILES=$(DESKTOP_IN_FILES:.desktop.in=.desktop)
Applicationsdir = $(datadir)/gnome/apps/Applications
Applications_DATA = $(DESKTOP_FILES)
EXTRA_DIST = \
intltool-extract.in \
intltool-merge.in \
intltool-update.in \
$(DESKTOP_IN_FILES) \
$(DESKTOP_FILES)
#undef ENABLE_NLS
#undef HAVE_CATGETS
#undef HAVE_GETTEXT
#undef HAVE_LC_MESSAGES
#undef GETTEXT_PACKAGE
#undef GNOMELOCALEDIR
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
(gettextize --version) < /dev/null > /dev/null 2>&1 || {
echo;
echo "You must have gettext installed to compile GtkHtml";
echo;
exit;
}
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo;
echo "You must have automake installed to compile GtkHtml";
echo;
exit;
}
PKG_NAME="Yelp"
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo;
echo "You must have autoconf installed to compile GtkHtml";
echo;
exit;
(test -f $srcdir/configure.in \
&& test -f $srcdir/src/main.c \
&& test -f $srcdir/README) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level yelp directory"
exit 1
}
echo "Generating configuration files for GtkHtml2, please wait...."
echo;
echo n | gettextize --copy --force;
aclocal $ACLOCAL_FLAGS;
autoheader;
automake --add-missing;
autoconf;
./configure $@ --enable-maintainer-mode --enable-compile-warnings
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME CVS"
exit 1
}
USE_GNOME2_MACROS=1 . gnome-autogen.sh
AC_INIT(src/main.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(Yelp, 0.01)
AC_PROG_INTLTOOL
AM_MAINTAINER_MODE
GNOME_COMMON_INIT
GNOME_PLATFORM_GNOME_2(yes)
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
......@@ -18,6 +23,20 @@ CFLAGS="$CFLAGS \
AC_SUBST(CFLAGS)
AC_SUBST(LDFLAGS)
GETTEXT_PACKAGE=yelp
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
ALL_LINGUAS="sv"
AM_GLIB_GNU_GETTEXT
if test "x$prefix" = "xNONE"; then
GNOMELOCALEDIR=$ac_default_prefix/share/locale
else
GNOMELOCALEDIR=$prefix/share/locale
fi
AC_DEFINE_UNQUOTED(GNOMELOCALEDIR, "$GNOMELOCALEDIR")
PKG_CHECK_MODULES(YELP, libgtkhtml-2.0 >= 1.99.2 \
gnome-vfs-2.0 >= 1.1 \
libgnomeui-2.0 >= 1.103.0)
......@@ -28,4 +47,5 @@ AC_SUBST(YELP_LIBS)
AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
])
src/devhelp-parser.c
src/ghelp-main.c
src/ghelp-uri.c
src/main.c
src/metadata-parser.c
src/scrollkeeper-parser.c
src/yelp-base.c
src/yelp-book.c
src/yelp-history.c
src/yelp-index.c
src/yelp-keyword-db.c
src/yelp-toc.c
src/yelp-view.c
src/yelp-window.c
yelp.desktop.in
# Yelp, GNOME Helo Browser
# Copyright (C) 2001 Free Software Foundation, Inc.
# Richard Hult <rhult@codefactory.se>, 2001.
#
msgid ""
msgstr ""
"Project-Id-Version: Yelp 0.01\n"
"POT-Creation-Date: 2001-12-01 12:40+0100\n"
"PO-Revision-Date: 2001-12-01 12:40+0100\n"
"Last-Translator: Richard Hult <rhult@codefactory.se>\n"
"Language-Team: Swedish <sv@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/ghelp-main.c:35
#, c-format
msgid "Usage '%s uri'\n"
msgstr ""
#: src/ghelp-main.c:43
#, c-format
msgid "Transformed URI: %s\n"
msgstr "Transformerad URI: %s\n"
#: src/ghelp-main.c:52
#, c-format
msgid "File not found: %s\n"
msgstr ""
#: src/ghelp-main.c:56
#, c-format
msgid "Invalid URI: %s\n"
msgstr "Ogiltig URI: %s\n"
#: src/yelp-toc.c:140
msgid "Section"
msgstr "Avdelning"
#: src/yelp-view.c:364
msgid ""
"<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></"
"head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help "
"browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the "
"README and TODO<br></body></html>"
msgstr ""
"<html><head><title>Detta r Yelp, en hjlpvisare fr GNOME 2.0</title></"
"head><body bgcolor=\"white\"><h3>Vlkommen till Yelp!</h3>Detta r en hjlpvisare "
"under utveckling, fr GNOME 2.0, skriven av Mikael Hallendal.<br><br>Ls grna filerna "
"README och TODO<br></body></html>"
#: src/yelp-window.c:79
msgid "/_File"
msgstr "/_Arkiv"
#: src/yelp-window.c:80
msgid "/File/_New window"
msgstr "/Arkiv/_Nytt fnster"
#: src/yelp-window.c:81
msgid "/File/E_xit"
msgstr "/Arkiv/_Avsluta"
#: src/yelp-window.c:82
msgid "/_Help"
msgstr "/_Hjlp"
#: src/yelp-window.c:83
msgid "/Help/_About"
msgstr "/Hjlp/_Om"
#: src/yelp-window.c:129
msgid "Yelp: GNOME Help Browser"
msgstr "Yelp: Hjlpvisare fr GNOME"
#: src/yelp-window.c:229
msgid "Contents"
msgstr "Innehll"
#: src/yelp-window.c:245
msgid "Index"
msgstr "Index"
#: src/yelp-window.c:334
msgid "Help Browser for GNOME 2.0"
msgstr "Hjlpvisare fr GNOME 2.0"
#: yelp.desktop.in.h:1
msgid "GNOME Helpbrowser"
msgstr "Hjlpvisare fr GNOME"
#: yelp.desktop.in.h:2
msgid "Yelp"
msgstr "Yelp"
......@@ -32,7 +32,7 @@ main (int argc, char **argv)
GnomeVFSURI *vfs_uri;
if (argc <= 1) {
g_print ("Usage '%s uri'\n", argv[0]);
g_print (_("Usage '%s uri'\n"), argv[0]);
exit (1);
}
......@@ -40,7 +40,7 @@ main (int argc, char **argv)
switch (result) {
case GNOME_VFS_OK:
g_print ("Transformed URI: %s\n", uri);
g_print (_("Transformed URI: %s\n"), uri);
vfs_uri = gnome_vfs_uri_new (uri);
if (!vfs_uri) {
g_print ("Eeeeeek\n");
......@@ -49,11 +49,11 @@ main (int argc, char **argv)
exit (0);
break;
case GNOME_VFS_ERROR_NOT_FOUND:
g_print ("File not found: %s\n", argv[1]);
g_print (_("File not found: %s\n"), argv[1]);
exit (1);
break;
case GNOME_VFS_ERROR_INVALID_URI:
g_print ("Invalid URI: %s\n", argv[1]);
g_print (_("Invalid URI: %s\n"), argv[1]);
exit (1);
break;
default:
......
......@@ -27,6 +27,7 @@
#include <gtk/gtkmain.h>
#include <gtk/gtkwidget.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-program.h>
#include <libgnomeui/gnome-ui-init.h>
#include <libgnomevfs/gnome-vfs.h>
......@@ -38,8 +39,15 @@ main (int argc, char **argv)
GnomeProgram *program;
YelpBase *base;
GtkWidget *window;
g_thread_init (NULL);
#ifdef ENABLE_NLS
bindtextdomain(GETTEXT_PACKAGE, GNOMELOCALEDIR);
textdomain(GETTEXT_PACKAGE);
#endif
setlocale (LC_ALL, "");
g_thread_init (NULL);
program = gnome_program_init (PACKAGE, VERSION,
LIBGNOMEUI_MODULE,
......@@ -54,6 +62,8 @@ main (int argc, char **argv)
if (argc >= 2) {
yelp_window_open_uri (window, argv[1]);
}
g_signal_connect (window, "delete-event", gtk_main_quit, NULL);
gtk_widget_show_all (window);
......
......@@ -25,6 +25,7 @@
#endif
#include <gtk/gtk.h>
#include <libgnome/gnome-i18n.h>
#include "yelp-toc.h"
static void yelp_toc_init (YelpToc *toc);
......@@ -136,7 +137,7 @@ yelp_toc_new (GtkTreeStore *model)
GTK_TREE_MODEL (model));
cell = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes ("Section", cell,
column = gtk_tree_view_column_new_with_attributes (_("Section"), cell,
"text", 0,
NULL);
......
......@@ -25,6 +25,7 @@
#endif
#include <libgnomevfs/gnome-vfs.h>
#include <libgnome/gnome-i18n.h>
#include <stdio.h>
#include "yelp-view.h"
......@@ -360,10 +361,10 @@ yelp_view_new (void)
html_document_open_stream (priv->doc, "text/html");
{
int len;
gchar *text = "<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the README and TODO<br></body></html>";
len = strlen (text);
gchar *text = N_("<html><head><title>This is Yelp, a help browser for GNOME 2.0</title></head><body bgcolor=\"white\"><h3>Welcome to Yelp!</h3>This is to be a help browser for GNOME 2.0 written by Mikael Hallendal.<br><br>Please read the README and TODO<br></body></html>");
len = strlen (_(text));
html_document_write_stream (priv->doc, text, len);
html_document_write_stream (priv->doc, _(text), len);
}
html_document_close_stream (priv->doc);
......
......@@ -2,7 +2,7 @@
/*
* Copyright (C) 2001 CodeFactory AB
* Copyright (C) 2001 Mikael Hallendal <micke@codefactory.se>
*
< *
* 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
......@@ -31,6 +31,7 @@
#include <libgnomevfs/gnome-vfs.h>
#include <libgnomeui/gnome-app.h>
#include <libgnomeui/gnome-about.h>
#include <libgnome/gnome-i18n.h>
#include <string.h>
#include "ghelp-uri.h"
#include "yelp-index.h"
......@@ -75,11 +76,11 @@ struct _YelpWindowPriv {
};
static GtkItemFactoryEntry menu_items[] = {
{ "/_File", NULL, 0, 0, "<Branch>" },
{ "/File/_New window", "<Control>N", yelp_window_new_window, 0, NULL},
{ "/File/E_xit", "<Control>Q", yelp_window_exit, 0, NULL },
{ "/_Help", NULL, 0, 0, "<Branch>" },
{ "/Help/_About", NULL, yelp_window_about, 0, NULL },
{ N_("/_File"), NULL, 0, 0, "<Branch>" },
{ N_("/File/_New window"), "<Control>N", yelp_window_new_window, 0, NULL},
{ N_("/File/E_xit"), "<Control>Q", yelp_window_exit, 0, NULL },
{ N_("/_Help"), NULL, 0, 0, "<Branch>" },
{ N_("/Help/_About"), NULL, yelp_window_about, 0, NULL },
};
GType
......@@ -125,7 +126,7 @@ yelp_window_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), _("Yelp: GNOME Help Browser"));
}
static void
......@@ -225,7 +226,7 @@ yelp_window_populate (YelpWindow *window)
GTK_POLICY_AUTOMATIC);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
tree_sw, gtk_label_new ("Contents"));
tree_sw, gtk_label_new (_("Contents")));
g_signal_connect_swapped (G_OBJECT (priv->yelp_toc),
"section_selected",
......@@ -241,7 +242,7 @@ yelp_window_populate (YelpWindow *window)
GTK_POLICY_AUTOMATIC);
gtk_notebook_append_page (GTK_NOTEBOOK (priv->notebook),
search_box, gtk_label_new ("Index"));
search_box, gtk_label_new (_("Index")));
gtk_box_pack_start (GTK_BOX (search_box),
yelp_index_get_entry (priv->index),
......@@ -330,7 +331,7 @@ yelp_window_about (gpointer data, guint section, GtkWidget *widget)
about = gnome_about_new (PACKAGE, VERSION,
"(C) 2001 Mikael Hallendal <micke@codefactory.se>",
"Help Browser for GNOME 2.0",
_("Help Browser for GNOME 2.0"),
authors,
NULL,
NULL,
......
[Desktop Entry]
_Name=Yelp
_Comment=GNOME Helpbrowser
Exec=yelp
Icon=gnome-unknown.png
Terminal=0
Type=Application
DocPath=
Categories=Application;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment