diff --git a/ChangeLog b/ChangeLog index c97f633b85..333d9b6e30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2001-03-04 Dave Peticolas + + * src/pixmaps: add gnucash_long.png graphic + + * src/gnome/top-level.c (gnucash_ui_init): show splash screen + + * src/gnome/gnc-splash.{ch}: splash screen functionality + + * src/gnome/dialog-utils.{ch} (gnc_get_pixmap): new function + + * src/gnc-dir.h.in: add header file with directory info + + * src/guile/Makefile.am: use BUILT_SOURCES for *.in sources + 2001-03-04 Christian Stimming * src/scm/html-utilities.scm: Added different printing of stock diff --git a/src/Makefile.am b/src/Makefile.am index 60ca953ea4..b7b3feb9a0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -62,6 +62,7 @@ noinst_HEADERS = \ SplitLedger.h \ file-history.h \ gnc-component-manager.h \ + gnc-dir.h \ gnc-exp-parser.h \ gnc-ui.h \ gnc-ui-common.h \ @@ -69,7 +70,8 @@ noinst_HEADERS = \ messages.h EXTRA_DIST = \ - .cvsignore + .cvsignore \ + gnc-dir.h.in CFLAGS = @CFLAGS@ ${GNOME_INCLUDEDIR} ${GUILE_INCS} @@ -78,3 +80,20 @@ INCLUDES = \ -I./engine \ -I./guile \ -I./register + +## We borrow guile's convention and use @-...-@ as the substitution +## brackets here, instead of the usual @...@. This prevents autoconf +## from substituting the values directly into the left-hand sides of +## the sed substitutions. +gnc-dir.h: gnc-dir.h.in + rm -f $@.tmp + sed < $@.in > $@.tmp \ + -e 's:@-GNC_SHAREDIR-@:${GNC_SHAREDIR}:g' + mv $@.tmp $@ +BUILT_SOURCES += gnc-dir.h + +# We have to do this because otherwise automake insists on putting +# these files into the dist tarfile. If there's a a better way, +# by all means, let us know... +dist-hook: + rm ${distdir}/gnc-dir.h diff --git a/src/gnc-dir.h.in b/src/gnc-dir.h.in new file mode 100644 index 0000000000..ab52769e73 --- /dev/null +++ b/src/gnc-dir.h.in @@ -0,0 +1,28 @@ +/**-*- c -*-*********************************************************\ + * gnc-dir.h -- directories for GnuCash * + * Copyright (C) 2001 Gnumatic, Inc. * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#ifndef __GNC_DIR_H__ +#define __GNC_DIR_H__ + +#define GNC_SHAREDIR "@-GNC_SHAREDIR-@" + +#endif diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index 1c60b9127a..1f6ace2915 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -37,6 +37,7 @@ libgncgnome_a_SOURCES = \ gnc-html-embedded.c \ gnc-html-history.c \ gnc-html.c \ + gnc-splash.c \ gtkselect.c \ mainwindow-account-tree.c \ new-user-callbacks.c \ @@ -91,6 +92,7 @@ noinst_HEADERS = \ gnc-html-embedded.h \ gnc-html-history.h \ gnc-html.h \ + gnc-splash.h \ gtkselect.h \ mainwindow-account-tree.h \ new-user-callbacks.h \ diff --git a/src/gnome/dialog-utils.c b/src/gnome/dialog-utils.c index d9a9c0462c..47e57ca96e 100644 --- a/src/gnome/dialog-utils.c +++ b/src/gnome/dialog-utils.c @@ -31,6 +31,7 @@ #include "messages.h" #include "EuroUtils.h" #include "Group.h" +#include "gnc-dir.h" #include "gnc-engine-util.h" #include "gnc-ui-util.h" #include "gnc-ui.h" @@ -172,6 +173,29 @@ gnc_build_option_menu(GNCOptionInfo *option_info, gint num_options) } +/********************************************************************\ + * gnc_get_pixmap * + * returns a GnomePixmap widget given a pixmap filename * + * * + * Args: none * + * Returns: GnomePixmap widget or NULL if there was a problem * + \*******************************************************************/ +GtkWidget * +gnc_get_pixmap (const char *name) +{ + GtkWidget *pixmap; + char *fullname; + + g_return_val_if_fail (name != NULL, NULL); + + fullname = g_strconcat (GNC_SHAREDIR, "/", name, NULL); + pixmap = gnome_pixmap_new_from_file (fullname); + g_free (fullname); + + return pixmap; +} + + /********************************************************************\ * gnc_get_toolbar_style * * returns the current toolbar style for gnucash toolbars * diff --git a/src/gnome/dialog-utils.h b/src/gnome/dialog-utils.h index cfab386b08..9e27de3460 100644 --- a/src/gnome/dialog-utils.h +++ b/src/gnome/dialog-utils.h @@ -51,6 +51,8 @@ GtkWidget * gnc_ui_source_menu_create (Account *account); GtkWidget * gnc_build_option_menu (GNCOptionInfo *option_info, gint num_options); +GtkWidget * gnc_get_pixmap (const char *name); + GtkToolbarStyle gnc_get_toolbar_style (void); void gnc_get_deficit_color (GdkColor *color); diff --git a/src/gnome/gnc-splash.c b/src/gnome/gnc-splash.c new file mode 100644 index 0000000000..4c82e0a9ca --- /dev/null +++ b/src/gnome/gnc-splash.c @@ -0,0 +1,71 @@ +/********************************************************************\ + * gnc-splash.c -- splash screen for GnuCash * + * Copyright (C) 2001 Gnumatic, Inc. * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#include "config.h" + +#include + +#include "dialog-utils.h" +#include "gnc-splash.h" + + +static GtkWidget * splash = NULL; + + +static gint +splash_timeout (gpointer not_used) +{ + if (splash) + { + gtk_widget_destroy (splash); + splash = NULL; + } + + return FALSE; +} + +void +gnc_show_splash_screen (void) +{ + GtkWidget *pixmap; + + if (splash) return; + + splash = gtk_window_new (GTK_WINDOW_POPUP); + + gtk_window_set_position (GTK_WINDOW (splash), GTK_WIN_POS_CENTER); + + pixmap = gnc_get_pixmap ("gnucash_long.png"); + + if (!pixmap) + { + g_warning ("can't find splash pixmap"); + gtk_widget_destroy (splash); + return; + } + + gtk_container_add (GTK_CONTAINER (splash), pixmap); + + gtk_widget_show_all (splash); + + gtk_timeout_add (4000, splash_timeout, NULL); /* 4 seconds */ +} diff --git a/src/gnome/gnc-splash.h b/src/gnome/gnc-splash.h new file mode 100644 index 0000000000..2f9ecc0c32 --- /dev/null +++ b/src/gnome/gnc-splash.h @@ -0,0 +1,28 @@ +/********************************************************************\ + * gnc-splash.h -- splash screen for GnuCash * + * Copyright (C) 2001 Gnumatic, Inc. * + * * + * 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * +\********************************************************************/ + +#ifndef __GNC_SPLASH_H__ +#define __GNC_SPLASH_H__ + +void gnc_show_splash_screen (void); + +#endif diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c index cb108c649a..50ef75af1a 100644 --- a/src/gnome/top-level.c +++ b/src/gnome/top-level.c @@ -49,6 +49,7 @@ #include "global-options.h" #include "gnc-component-manager.h" #include "gnc-engine-util.h" +#include "gnc-splash.h" #include "gnc-ui.h" #include "gnc.h" #include "gnucash-color.h" @@ -91,6 +92,7 @@ static void gnc_configure_register_font(void); static void gnc_configure_register_hint_font_cb(gpointer); static void gnc_configure_register_hint_font(void); + /** GLOBALS *********************************************************/ /* This static indicates the debugging module that this .o belongs to. */ static short module = MOD_GUI; @@ -113,6 +115,7 @@ static SCM auto_decimal_places_callback_id = SCM_UNDEFINED; static SCM register_font_callback_id = SCM_UNDEFINED; static SCM register_hint_font_callback_id = SCM_UNDEFINED; + /* ============================================================== */ int @@ -214,6 +217,13 @@ gnucash_ui_init(void) guppi_tank_init(); #endif + /* put up splash screen */ + gnc_show_splash_screen (); + + /* make sure splash is up */ + while (gtk_events_pending ()) + gtk_main_iteration (); + app = gnome_app_new("GnuCash", "GnuCash"); gnc_configure_date_format(); @@ -292,7 +302,8 @@ gnucash_ui_init(void) } static gboolean hasstarted = FALSE; -void gnc_default_ui_start(void) +void +gnc_default_ui_start(void) { if(!hasstarted) { diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am index b782904cc3..5be0bf30c3 100644 --- a/src/pixmaps/Makefile.am +++ b/src/pixmaps/Makefile.am @@ -1,3 +1,8 @@ +gncpixmapdir = ${GNC_SHAREDIR} + +gncpixmap_DATA = \ + gnucash_long.png EXTRA_DIST = \ - .cvsignore + .cvsignore \ + ${gncpixmap_DATA} diff --git a/src/pixmaps/gnucash_long.png b/src/pixmaps/gnucash_long.png new file mode 100644 index 0000000000..7ad524335c Binary files /dev/null and b/src/pixmaps/gnucash_long.png differ