Commit 6cf4c5ac authored by Tristan Van Berkom's avatar Tristan Van Berkom
Browse files

New files.


	* help/ChangeLog, help/Makefile.am, help/glade.omf.in,
	  help/.cvsignore, help/C/glade.xml, help/C/legal.xml,
	  help/C/figures/main-window.png, m4/.cvsignore: New files.

	* configure.in:
	  - Check for gnome-doc-utils and scrollkeeper
	  - Use AC_CONFIG_FILES instead of AC_OUTPUT with args.
	    AC_OUTPUT with args is deprecated.
	  - set macro dir with AC_CONFIG_MACRO_DIR.

	* Makefile.am:
	  - Update for gnome-doc-utils integration.
	  - Conditionally set SUBDIRS if docs building is enabled.
	  - Set `ACLOCAL_AMFLAGS = -I m4' as recommended in
	    Autoconf manual.

	* .cvsignore: Add `gnome-doc-utils.make'.

	* src/glade-utils.[ch]: New function `glade_util_url_show'.

	* src/glade-project-window.c:
	  - Add functionality for launching the GNOME user manual.
	  - Set URL hook for GtkAboutDialog.
	  - If devhelp is not available, the online developer reference
	    is displayed instead.

	* src/glade-paths.sh.in: New variable GLADE_GNOMEHELPDIR.

	* glade-3.desktop.in: Add "X-GNOME-DocPath" entry.
	  Add "GTK" to "Categories".
parent 75c655e3
......@@ -23,3 +23,4 @@ libtool
Makefile
missing
mkinstalldirs
gnome-doc-utils.make
2006-12-07 Vincent Geddes <vincent.geddes@gmail.com>
* help/ChangeLog, help/Makefile.am, help/glade.omf.in,
help/.cvsignore, help/C/glade.xml, help/C/legal.xml,
help/C/figures/main-window.png, m4/.cvsignore: New files.
* configure.in:
- Check for gnome-doc-utils and scrollkeeper
- Use AC_CONFIG_FILES instead of AC_OUTPUT with args.
AC_OUTPUT with args is deprecated.
- set macro dir with AC_CONFIG_MACRO_DIR.
* Makefile.am:
- Update for gnome-doc-utils integration.
- Conditionally set SUBDIRS if docs building is enabled.
- Set `ACLOCAL_AMFLAGS = -I m4' as recommended in
Autoconf manual.
* .cvsignore: Add `gnome-doc-utils.make'.
* src/glade-utils.[ch]: New function `glade_util_url_show'.
* src/glade-project-window.c:
- Add functionality for launching the GNOME user manual.
- Set URL hook for GtkAboutDialog.
- If devhelp is not available, the online developer reference
is displayed instead.
* src/glade-paths.sh.in: New variable GLADE_GNOMEHELPDIR.
* glade-3.desktop.in: Add "X-GNOME-DocPath" entry.
Add "GTK" to "Categories".
2006-12-06 Juan Pablo Ugarte <juanpablougarte@gmail.com>
* configure.in: added AC_CHECK_HEADERS(Python.h)
......
## Process this file with automake to produce Makefile.in
if DISABLE_USER_MANUAL
SUBDIRS = src po pixmaps widgets doc
else
SUBDIRS = src po pixmaps widgets doc help
endif
ACLOCAL_AMFLAGS = -I m4
@INTLTOOL_DESKTOP_RULE@
......@@ -26,17 +32,22 @@ update-icon-cache:
echo "*** $(gtk_update_icon_cache)"; \
fi
EXTRA_DIST = \
COPYING.GPL \
COPYING.LGPL \
m4 \
glade-3.desktop.in \
glade-3.png \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
intltool-update.in \
gnome-doc-utils.make
CLEANFILES = $(DESKTOP_FILES)
DISTCLEANFILES = intltool-extract intltool-merge intltool-update
DISTCLEANFILES = intltool-extract \
intltool-merge \
intltool-update \
gnome-doc-utils.make
DISTCHECK_CONFIGURE_FLAGS = --disable-scrollkeeper --enable-gtk-doc
......@@ -29,6 +29,7 @@ window: suddenly can't add more children - (bug 364991)
capitals in catalog files translated to
underscores - (bug 377435) (Jeff Westerinen)
accelerator/atk relation regressions - (bug 383121)
add icons for new gtk+ 2.10 widgets
Priority list for 3.2
=========================================================
......
......@@ -9,7 +9,10 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_CONFIG_MACRO_DIR([m4])
IT_PROG_INTLTOOL([0.35.0])
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(DLLTOOL, dlltool)
......@@ -73,6 +76,33 @@ fi
AM_CONDITIONAL(BUILD_GNOME, test x"$have_gnome" = "xyes")
dnl ================================================================
dnl GNOME User Manual (requires gnome-doc-utils)
dnl ================================================================
AC_ARG_ENABLE(user_manual,
[ --enable-user-manual Build GNOME user manual],
enable_user_manual=yes, enable_user_manual=no)
if test x"$enable_user_manual" = "xyes"; then
GNOME_DOC_INIT
else
ENABLE_SK_TRUE="#"
ENABLE_SK_FALSE=""
fi
AM_CONDITIONAL(DISABLE_USER_MANUAL, test x"$enable_user_manual" = "xno")
dnl ================================================================
dnl Scrollkeeper
dnl ================================================================
if test x"$enable_gnome" = "xyes" ; then
AC_PATH_PROG(SK_CONFIG, scrollkeeper-config, no)
if test x"$SK_CONFIG" = "xno"; then
AC_MSG_ERROR(Couldn't find scrollkeeper-config. Please install the scrollkeeper package: http://scrollkeeper.sourceforge.net)
fi
fi
dnl ===============================================================
dnl Check for Python
dnl ================================================================
......@@ -145,7 +175,7 @@ AC_SUBST(glade_scriptsdir)
AC_SUBST(glade_icondir)
AC_SUBST(glade_localedir)
AC_OUTPUT([
AC_CONFIG_FILES([
Makefile
pixmaps/Makefile
pixmaps/16x16/Makefile
......@@ -158,14 +188,17 @@ src/glade-3.pc
src/glade-paths.sh
doc/Makefile
doc/version.xml
help/Makefile
])
AC_OUTPUT
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Compiler: ${CC}
GnomeUI Catalog: ${have_gnome}
Python Binding: ${have_python}
"
......@@ -8,8 +8,9 @@ Terminal=false
StartupNotify=true
Type=Application
Icon=glade-3
Categories=Application;Development;
Categories=GTK;Application;Development;
MimeType=application/x-glade;
X-GNOME-DocPath=glade/glade.xml
X-GNOME-Bugzilla-Bugzilla=GNOME
X-GNOME-Bugzilla-Product=glade3
X-GNOME-Bugzilla-Component=general
*.omf
Makefile.in
Makefile
This diff is collapsed.
<legalnotice id="legalnotice">
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License (GFDL), Version 1.1 or any later version published
by the Free Software Foundation with no Invariant Sections,
no Front-Cover Texts, and no Back-Cover Texts. You can find
a copy of the GFDL at this <ulink type="help"
url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS
distributed with this manual.
</para>
<para> This manual is part of a collection of GNOME manuals
distributed under the GFDL. If you want to distribute this
manual separately from the collection, you can do so by
adding a copy of the license to the manual, as described in
section 6 of the license.
</para>
<para>
Many of the names used by companies to distinguish their
products and services are claimed as trademarks. Where those
names appear in any GNOME documentation, and the members of
the GNOME Documentation Project are made aware of those
trademarks, then the names are in capital letters or initial
capital letters.
</para>
<para>
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED
UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE
WITH THE FURTHER UNDERSTANDING THAT:
<orderedlist>
<listitem>
<para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
THAT THE DOCUMENT OR MODIFIED VERSION OF THE
DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR
A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE
OF THE DOCUMENT OR MODIFIED VERSION OF THE
DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR
MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY
CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED
VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER
EXCEPT UNDER THIS DISCLAIMER; AND
UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE),
CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
INITIAL WRITER, ANY CONTRIBUTOR, OR ANY
DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
PARTIES, BE LIABLE TO ANY PERSON FOR ANY
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES OF ANY CHARACTER
INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
LOSSES ARISING OUT OF OR RELATING TO USE OF THE
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT,
EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
THE POSSIBILITY OF SUCH DAMAGES.
</para>
</listitem>
</orderedlist>
</para>
</legalnotice>
include $(top_srcdir)/gnome-doc-utils.make
dist-hook: doc-dist-hook
DOC_MODULE = glade
DOC_INCLUDES = legal.xml
DOC_FIGURES = figures/main-window.png
<?xml version="1.0" standalone="no"?>
<omf>
<resource>
<subject category="GNOME|Development|Applications"/>
<type>user's guide</type>
<relation seriesid="aeee6e58-266b-11db-9d4a-93a924887d12"/>
<rights type="GNU FDL" license.version="1.1" holder="Vincent Geddes"/>
</resource>
</omf>
intltool.m4
gnome-doc-utils.m4
gtk-doc.m4
......@@ -1287,7 +1287,7 @@ glade_app_command_redo (void)
* glade_app_set_accel_group:
*
* Sets @accel_group to @app.
* The acceleration group will be atached to every toplevel widget in this application.
* The acceleration group will be attached to every toplevel widget in this application.
*/
void
glade_app_set_accel_group (GtkAccelGroup *accel_group)
......
......@@ -19,6 +19,7 @@ glade_bindingsdir="@glade_bindingsdir@"
glade_pixmapsdir="@glade_pixmapsdir@"
glade_scriptsdir="@glade_scriptsdir@"
glade_icondir="@glade_icondir@"
glade_gnomehelpdir="@HELP_DIR@"
glade_localedir="@glade_localedir@"
cat <<EOF
......@@ -37,6 +38,7 @@ cat <<EOF
#define GLADE_PIXMAPSDIR "$glade_pixmapsdir"
#define GLADE_SCRIPTSDIR "$glade_scriptsdir"
#define GLADE_ICONDIR "$glade_icondir"
#define GLADE_GNOMEHELPDIR "$glade_gnomehelpdir"
#define GLADE_LOCALEDIR "$glade_localedir"
#endif /* GLADE_PATHS_H */
......
......@@ -26,11 +26,13 @@
#endif
#include <string.h>
#include <glib/gstdio.h>
#include <glib/gi18n.h>
#include <gdk/gdkkeysyms.h>
#include <gtk/gtkstock.h>
#include "glade.h"
#include "glade-paths.h"
#include "glade-design-view.h"
#include "glade-project-window.h"
#include "glade-binding.h"
......@@ -41,6 +43,9 @@
#define READONLY_INDICATOR (_("[Read Only]"))
#define GLADE_URL_USER_MANUAL "http://glade.gnome.org/doc/manual"
#define GLADE_URL_DEVELOPER_MANUAL "http://glade.gnome.org/docs/index.html"
#define GLADE_PROJECT_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), \
GLADE_TYPE_PROJECT_WINDOW, \
GladeProjectWindowPrivate))
......@@ -79,18 +84,110 @@ struct _GladeProjectWindowPrivate
};
const gint GLADE_WIDGET_TREE_WIDTH = 230;
const gint GLADE_WIDGET_TREE_HEIGHT = 300;
const gint GLADE_PALETTE_DEFAULT_HEIGHT = 450;
static gpointer parent_class = NULL;
static GladeAppClass *parent_class = NULL;
static void gpw_refresh_undo_redo (GladeProjectWindow *gpw);
static void gpw_recent_chooser_item_activated_cb (GtkRecentChooser *chooser, GladeProjectWindow *gpw);
G_DEFINE_TYPE(GladeProjectWindow, glade_project_window, GLADE_TYPE_APP)
static void
about_dialog_activate_link_func (GtkAboutDialog *dialog, const gchar *link, GladeProjectWindow *gpw)
{
GtkWidget *warning_dialog;
gboolean retval;
retval = glade_util_url_show (link);
if (!retval)
{
warning_dialog = gtk_message_dialog_new (GTK_WINDOW (gpw->priv->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_WARNING,
GTK_BUTTONS_OK,
_("Could not display the URL '%s'"),
link);
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (warning_dialog),
_("No suitable web browser executable could be found."));
gtk_window_set_title (GTK_WINDOW (warning_dialog), "");
g_signal_connect_swapped (warning_dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (warning_dialog);
}
}
/* locates the help file "glade.xml" with respect to current locale */
static gchar*
locate_help_file ()
{
const gchar* const* locales = g_get_language_names ();
/* check if user manual has been installed, if not, GLADE_GNOMEHELPDIR is empty */
if (strlen (GLADE_GNOMEHELPDIR) == 0)
return NULL;
for (; *locales; locales++)
{
gchar *path;
path = g_build_path (G_DIR_SEPARATOR_S, GLADE_GNOMEHELPDIR, "glade", *locales, "glade.xml", NULL);
if (g_file_test (path, G_FILE_TEST_EXISTS))
{
return (path);
}
g_free (path);
}
return NULL;
}
static gboolean
glade_project_window_help_show (const gchar *link_id)
{
gchar *file, *url, *command;
gboolean retval;
gint exit_status = -1;
GError *error = NULL;
file = locate_help_file ();
if (file == NULL)
return FALSE;
if (link_id != NULL) {
url = g_strconcat ("ghelp://", file, "?", link_id, NULL);
} else {
url = g_strconcat ("ghelp://", file, NULL);
}
command = g_strconcat ("gnome-open ", url, NULL);
retval = g_spawn_command_line_sync (command,
NULL,
NULL,
&exit_status,
&error);
if (!retval) {
g_error_free (error);
error = NULL;
}
g_free (command);
g_free (file);
g_free (url);
return retval && !exit_status;
}
static void
gpw_refresh_title (GladeProjectWindow *gpw)
{
......@@ -1303,10 +1400,78 @@ gpw_toggle_editor_help_cb (GtkAction *action, GladeProjectWindow *gpw)
glade_editor_hide_context_info (glade_app_get_editor ());
}
static void
gpw_show_help_cb (GtkAction *action, GladeProjectWindow *gpw)
{
GtkWidget *dialog;
gboolean retval;
retval = glade_project_window_help_show (NULL);
if (retval)
return;
/* fallback to displaying online user manual */
retval = glade_util_url_show (GLADE_URL_USER_MANUAL);
if (!retval)
{
dialog = gtk_message_dialog_new (GTK_WINDOW (gpw->priv->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("Could not display the online user manual"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("No suitable web browser executable could be found "
"to be executed and to display the URL: %s"),
GLADE_URL_USER_MANUAL);
gtk_window_set_title (GTK_WINDOW (dialog), "");
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (dialog);
}
}
static void
gpw_documentation_cb (GtkAction *action, GladeProjectWindow *gpw)
gpw_show_developer_manual_cb (GtkAction *action, GladeProjectWindow *gpw)
{
glade_util_search_devhelp ("gladeui", NULL, NULL);
GtkWidget *dialog;
gboolean retval;
if (glade_util_have_devhelp ())
{
glade_util_search_devhelp ("gladeui", NULL, NULL);
return;
}
retval = glade_util_url_show (GLADE_URL_DEVELOPER_MANUAL);
if (!retval)
{
dialog = gtk_message_dialog_new (GTK_WINDOW (gpw->priv->window),
GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR,
GTK_BUTTONS_OK,
_("Could not display the online developer reference manual"));
gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
_("No suitable web browser executable could be found "
"to be executed and to display the URL: %s"),
GLADE_URL_DEVELOPER_MANUAL);
gtk_window_set_title (GTK_WINDOW (dialog), "");
g_signal_connect_swapped (dialog, "response",
G_CALLBACK (gtk_widget_destroy),
dialog);
gtk_widget_show (dialog);
}
}
static void
......@@ -1426,7 +1591,8 @@ static const gchar *ui_info =
" <placeholder name='ProjectsListPlaceholder'/>\n"
" </menu>\n"
" <menu action='HelpMenu'>\n"
" <menuitem action='Manual'/>\n"
" <menuitem action='HelpContents'/>\n"
" <menuitem action='DeveloperReference'/>\n"
" <separator/>\n"
" <menuitem action='About'/>\n"
" </menu>\n"
......@@ -1469,10 +1635,13 @@ static GtkActionEntry static_entries[] = {
/* HelpMenu */
{ "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
N_("Shows the About Dialog"), G_CALLBACK (gpw_about_cb) },
N_("About this application"), G_CALLBACK (gpw_about_cb) },
{ "HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1",
N_("Display the user manual"), G_CALLBACK (gpw_show_help_cb) },
{ "Manual", NULL, N_("_Documentation"), NULL,
N_("Documentation about Glade"), G_CALLBACK (gpw_documentation_cb) }
{ "DeveloperReference", NULL, N_("_Developer Reference"), NULL,
N_("Display the developer reference manual"), G_CALLBACK (gpw_show_developer_manual_cb) }
};
static guint n_static_entries = G_N_ELEMENTS (static_entries);
......@@ -1778,7 +1947,7 @@ glade_project_window_create (GladeProjectWindow *gpw)
GtkWidget *toolbar;
GladeProjectView *project_view;
GtkWidget *statusbar;
GtkWidget *editor_item, *docs_item;
GtkWidget *editor_item;
GtkWidget *palette;
GtkWidget *editor;
GtkWidget *dockitem;
......@@ -1864,12 +2033,8 @@ glade_project_window_create (GladeProjectWindow *gpw)
/* devhelp */
editor_item = gtk_ui_manager_get_widget (gpw->priv->ui,
"/MenuBar/ViewMenu/PropertyEditorHelp");
docs_item = gtk_ui_manager_get_widget (gpw->priv->ui,
"/MenuBar/HelpMenu/Manual");
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (editor_item), FALSE);
gtk_widget_set_sensitive (editor_item, FALSE);
gtk_widget_set_sensitive (docs_item, FALSE);
/* Console */
gpw_construct_console (gpw);
......@@ -2119,7 +2284,9 @@ glade_project_window_init (GladeProjectWindow *gpw)
gpw->priv->label = NULL;
gpw->priv->default_path = NULL;
gtk_about_dialog_set_url_hook ((GtkAboutDialogActivateLinkFunc) about_dialog_activate_link_func, gpw, NULL);
}
GladeProjectWindow *
......@@ -2149,12 +2316,10 @@ glade_project_window_new (void)
void
glade_project_window_check_devhelp (GladeProjectWindow *gpw)
{
GtkWidget *editor_item, *docs_item;
GtkWidget *editor_item;
editor_item = gtk_ui_manager_get_widget (gpw->priv->ui,
"/MenuBar/ViewMenu/PropertyEditorHelp");
docs_item = gtk_ui_manager_get_widget (gpw->priv->ui,
"/MenuBar/HelpMenu/Manual");
"/MenuBar/ViewMenu/PropertyEditorHelp");
if (glade_util_have_devhelp ())
{
......@@ -2168,11 +2333,9 @@ glade_project_window_check_devhelp (GladeProjectWindow *gpw)
G_CALLBACK (gpw_doc_search_cb), gpw);
gtk_widget_set_sensitive (editor_item, TRUE);
gtk_widget_set_sensitive (docs_item, TRUE);
}
else
{
gtk_widget_set_sensitive (editor_item, FALSE);
gtk_widget_set_sensitive (docs_item, FALSE);
}
}
......@@ -44,6 +44,16 @@
#include "glade-clipboard.h"
#include "glade-fixed.h"
#ifdef G_OS_WIN32
long __stdcall
ShellExecuteA (long hwnd,
const char* lpOperation,
const char* lpFile,
const char* lpParameters,
const char* lpDirectory,
int nShowCmd);
#endif
#define GLADE_UTIL_SELECTION_NODE_SIZE 7
#define GLADE_UTIL_COPY_BUFFSIZE 1024
......@@ -1755,3 +1765,144 @@ glade_util_object_is_loading (GObject *object)
return glade_project_is_loading (project);
}
#ifdef G_OS_WIN32
#define SW_NORMAL 1