mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Create a gnome-utils module to hold gnome/gtk widgets and utility functions
used by GnuCash. Still some dependency-untangling left to do. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@5347 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
22e1d304a7
commit
ded89a4b2a
@ -22,8 +22,8 @@
|
||||
\********************************************************************/
|
||||
|
||||
|
||||
#ifndef __XACC_CONFIG_H__
|
||||
#define __XACC_CONFIG_H__
|
||||
#ifndef GNC_CONFIG_H
|
||||
#define GNC_CONFIG_H
|
||||
|
||||
/* Package name and version number */
|
||||
#undef PACKAGE
|
||||
@ -85,6 +85,7 @@
|
||||
/* Configure found the function malloc_usable_size */
|
||||
#undef HAVE_MALLOC_USABLE_SIZE
|
||||
|
||||
|
||||
/*** Begin i18n ***/
|
||||
|
||||
/* internationalization with gettext */
|
||||
|
@ -714,6 +714,7 @@ AC_OUTPUT(
|
||||
src/gnc-module/test/misc-mods/Makefile
|
||||
src/gnome/Makefile
|
||||
src/gnome/glade/Makefile
|
||||
src/gnome-utils/Makefile
|
||||
src/guile/Makefile
|
||||
src/import-export/Makefile
|
||||
src/import-export/qif-import/Makefile
|
||||
|
@ -8,6 +8,7 @@ SUBDIRS = \
|
||||
calculation \
|
||||
tax \
|
||||
app-utils \
|
||||
gnome-utils \
|
||||
register \
|
||||
import-export \
|
||||
report \
|
||||
@ -32,6 +33,7 @@ gnucash_LDADD = \
|
||||
-Lgnc-module -Lgnc-module/.libs \
|
||||
-Lcalculation -Lcalculation/.libs \
|
||||
gnc-module/libgncmodule.la \
|
||||
gnome-utils/libgncmod-gnome-utils.la \
|
||||
app-utils/libgncmod-app-utils.la \
|
||||
engine/libgncmod-engine.la \
|
||||
engine/libgw-engine.la \
|
||||
|
@ -39,4 +39,7 @@ report/stylesheets predefined style sheet templates
|
||||
app-utils utils for the gnucash app framework (component
|
||||
mgr, cmd line processing, gettext stuff, etc)
|
||||
|
||||
gnome-utils Extensions and utilities for using Gnome/Gtk
|
||||
with GnuCash, including new widgets.
|
||||
|
||||
tax/us US tax information
|
||||
|
131
src/gnome-utils/cursors.c
Normal file
131
src/gnome-utils/cursors.c
Normal file
@ -0,0 +1,131 @@
|
||||
/********************************************************************\
|
||||
* cursor.c -- functions for changing cursors *
|
||||
* *
|
||||
* Copyright (C) 1997 Robin D. Clark <rclark@cs.hmc.edu> *
|
||||
* Copyright (C) 1998-2000 Linas Vepstas <linas@linas.org> *
|
||||
* *
|
||||
* 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 <gnome.h>
|
||||
|
||||
#include "gnc-ui.h"
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GNC_CURSOR_NORMAL = -1,
|
||||
GNC_CURSOR_BUSY = GDK_WATCH
|
||||
} GNCCursorType;
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_ui_set_cursor *
|
||||
* sets the cursor to the specified type *
|
||||
* *
|
||||
* Args: w - the widget over which to change the cursor *
|
||||
* type - the type of cursor to make *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
static void
|
||||
gnc_ui_set_cursor (GdkWindow *win, GNCCursorType type, gboolean update_now)
|
||||
{
|
||||
GdkCursor *cursor = NULL;
|
||||
|
||||
if (win == NULL)
|
||||
return;
|
||||
|
||||
if (type != GNC_CURSOR_NORMAL)
|
||||
cursor = gdk_cursor_new (type);
|
||||
|
||||
gdk_window_set_cursor (win, cursor);
|
||||
|
||||
if (update_now && type != GNC_CURSOR_NORMAL)
|
||||
{
|
||||
while (gtk_events_pending ())
|
||||
gtk_main_iteration ();
|
||||
}
|
||||
|
||||
if (type != GNC_CURSOR_NORMAL)
|
||||
gdk_cursor_destroy (cursor);
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_set_busy_cursor *
|
||||
* sets the cursor to the busy watch for the given window. *
|
||||
* if the window is null, sets the cursor for all toplevel windows*
|
||||
* *
|
||||
* Args: w - the widget over which to make cursor busy *
|
||||
* update_now - if true the cursor will be changed when the *
|
||||
* call returns. *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_set_busy_cursor (GtkWidget *w, gboolean update_now)
|
||||
{
|
||||
if (w != NULL)
|
||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
|
||||
else
|
||||
{
|
||||
GList *node;
|
||||
|
||||
for (node = gtk_container_get_toplevels (); node; node = node->next)
|
||||
{
|
||||
w = node->data;
|
||||
|
||||
if (!w || !GTK_IS_WIDGET (w) || !w->window)
|
||||
continue;
|
||||
|
||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_BUSY, update_now);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_unset_busy_cursor *
|
||||
* sets the cursor to the default cursor for the given window. *
|
||||
* if the window is null, sets the cursor for all toplevel windows*
|
||||
* *
|
||||
* Args: w - the widget over which to make cursor normal *
|
||||
* Return: none *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_unset_busy_cursor (GtkWidget *w)
|
||||
{
|
||||
if (w != NULL)
|
||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
|
||||
else
|
||||
{
|
||||
GList *node;
|
||||
|
||||
for (node = gtk_container_get_toplevels (); node; node = node->next)
|
||||
{
|
||||
w = GTK_WIDGET (node->data);
|
||||
|
||||
if (!w || !w->window)
|
||||
continue;
|
||||
|
||||
gnc_ui_set_cursor (w->window, GNC_CURSOR_NORMAL, FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,13 +26,12 @@
|
||||
#include <gnome.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "FileDialog.h"
|
||||
#include "dialog-commodity.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "window-help.h"
|
||||
|
||||
|
@ -21,8 +21,10 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
********************************************************************/
|
||||
|
||||
#ifndef GNC_DIALOG_COMMODITY_H_
|
||||
#define GNC_DIALOG_COMMODITY_H_
|
||||
#ifndef GNC_DIALOG_COMMODITY_H
|
||||
#define GNC_DIALOG_COMMODITY_H
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-engine.h"
|
885
src/gnome-utils/dialog-utils.c
Normal file
885
src/gnome-utils/dialog-utils.c
Normal file
@ -0,0 +1,885 @@
|
||||
/********************************************************************\
|
||||
* dialog-utils.c -- utility functions for creating dialogs *
|
||||
* for GnuCash *
|
||||
* Copyright (C) 1999-2000 Linas Vepstas *
|
||||
* *
|
||||
* 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 <glade/glade.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "messages.h"
|
||||
#include "Group.h"
|
||||
#include "gnc-dir.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-euro.h"
|
||||
#include "gnc-ui-util.h"
|
||||
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_GUI;
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_ui_source_menu_create *
|
||||
* create the menu of stock quote sources *
|
||||
* *
|
||||
* Args: account - account to use to set default choice *
|
||||
* Returns: the menu *
|
||||
\*******************************************************************/
|
||||
GtkWidget *
|
||||
gnc_ui_source_menu_create(Account *account)
|
||||
{
|
||||
gint i;
|
||||
GtkMenu *menu;
|
||||
GtkWidget *item;
|
||||
GtkWidget *omenu;
|
||||
GNCAccountType type;
|
||||
|
||||
menu = GTK_MENU(gtk_menu_new());
|
||||
gtk_widget_show(GTK_WIDGET(menu));
|
||||
|
||||
for (i = 0; i < NUM_SOURCES; i++)
|
||||
{
|
||||
item = gtk_menu_item_new_with_label(gnc_get_source_name(i));
|
||||
gtk_widget_show(item);
|
||||
gtk_menu_append(menu, item);
|
||||
}
|
||||
|
||||
omenu = gtk_option_menu_new();
|
||||
gtk_widget_show(omenu);
|
||||
gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), GTK_WIDGET(menu));
|
||||
gnc_option_menu_init(omenu);
|
||||
|
||||
return omenu;
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* price quote timezone handling
|
||||
*/
|
||||
|
||||
static gchar *
|
||||
known_timezones[] =
|
||||
{
|
||||
"Asia/Tokyo",
|
||||
"Australia/Sydney",
|
||||
"America/New_York",
|
||||
"America/Chicago",
|
||||
"Europe/London",
|
||||
"Europe/Paris",
|
||||
NULL
|
||||
};
|
||||
|
||||
guint
|
||||
gnc_find_timezone_menu_position(const gchar *timezone)
|
||||
{
|
||||
/* returns 0 on failure, position otherwise. */
|
||||
gboolean found = FALSE;
|
||||
guint i = 0;
|
||||
while(!found && known_timezones[i]) {
|
||||
if(safe_strcmp(timezone, known_timezones[i]) != 0) {
|
||||
i++;
|
||||
} else {
|
||||
found = TRUE;
|
||||
}
|
||||
}
|
||||
if(found) return i + 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
gchar *
|
||||
gnc_timezone_menu_position_to_string(guint pos)
|
||||
{
|
||||
if(pos == 0) return NULL;
|
||||
return known_timezones[pos - 1];
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gnc_ui_quote_tz_menu_create(Account *account)
|
||||
{
|
||||
gint i;
|
||||
GtkMenu *menu;
|
||||
GtkWidget *item;
|
||||
GtkWidget *omenu;
|
||||
gchar **itemstr;
|
||||
|
||||
/* add items here as needed, but bear in mind that right now these
|
||||
must be timezones that GNU libc understands. Also, I'd prefer if
|
||||
we only add things here we *know* we need. That's because in
|
||||
order to be portable to non GNU OSes, we may have to support
|
||||
whatever we add here manually on those systems. */
|
||||
|
||||
menu = GTK_MENU(gtk_menu_new());
|
||||
gtk_widget_show(GTK_WIDGET(menu));
|
||||
|
||||
item = gtk_menu_item_new_with_label(_("Use local time"));
|
||||
/* set user data to non NULL so we can detect this item specially. */
|
||||
gtk_object_set_user_data(GTK_OBJECT(item), (gpointer) 1);
|
||||
gtk_widget_show(item);
|
||||
gtk_menu_append(menu, item);
|
||||
|
||||
for(itemstr = &known_timezones[0]; *itemstr; itemstr++) {
|
||||
item = gtk_menu_item_new_with_label(*itemstr);
|
||||
gtk_widget_show(item);
|
||||
gtk_menu_append(menu, item);
|
||||
}
|
||||
|
||||
omenu = gtk_option_menu_new();
|
||||
gtk_widget_show(omenu);
|
||||
gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), GTK_WIDGET(menu));
|
||||
gnc_option_menu_init(omenu);
|
||||
|
||||
return omenu;
|
||||
}
|
||||
|
||||
/* =========================================================== */
|
||||
|
||||
static void
|
||||
gnc_option_menu_cb(GtkWidget *w, gpointer data)
|
||||
{
|
||||
GNCOptionCallback cb;
|
||||
gpointer _index;
|
||||
gint index;
|
||||
|
||||
cb = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_cb");
|
||||
|
||||
_index = gtk_object_get_data(GTK_OBJECT(w), "gnc_option_index");
|
||||
index = GPOINTER_TO_INT(_index);
|
||||
|
||||
cb(w, index, data);
|
||||
}
|
||||
|
||||
static void
|
||||
option_menu_destroy_cb (GtkObject *obj, gpointer data)
|
||||
{
|
||||
GtkTooltips *tips = data;
|
||||
|
||||
gtk_object_unref (GTK_OBJECT (tips));
|
||||
}
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_ui_create_option_button *
|
||||
* create an option button given the option structure *
|
||||
* *
|
||||
* Args: option_info - the option structure to use *
|
||||
* num_options - the number of options *
|
||||
* Returns: void *
|
||||
\*******************************************************************/
|
||||
GtkWidget *
|
||||
gnc_build_option_menu(GNCOptionInfo *option_info, gint num_options)
|
||||
{
|
||||
GtkTooltips *tooltips;
|
||||
GtkWidget *omenu;
|
||||
GtkWidget *menu;
|
||||
GtkWidget *menu_item;
|
||||
gint i;
|
||||
|
||||
omenu = gtk_option_menu_new();
|
||||
gtk_widget_show(omenu);
|
||||
|
||||
menu = gtk_menu_new();
|
||||
gtk_widget_show(menu);
|
||||
|
||||
tooltips = gtk_tooltips_new();
|
||||
|
||||
gtk_object_ref (GTK_OBJECT (tooltips));
|
||||
gtk_object_sink (GTK_OBJECT (tooltips));
|
||||
|
||||
for (i = 0; i < num_options; i++)
|
||||
{
|
||||
menu_item = gtk_menu_item_new_with_label(option_info[i].name);
|
||||
gtk_tooltips_set_tip(tooltips, menu_item, option_info[i].tip, NULL);
|
||||
gtk_widget_show(menu_item);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_cb",
|
||||
option_info[i].callback);
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
|
||||
gtk_object_set_data(GTK_OBJECT(menu_item),
|
||||
"gnc_option_menu",
|
||||
omenu);
|
||||
|
||||
if (option_info[i].callback != NULL)
|
||||
gtk_signal_connect(GTK_OBJECT(menu_item), "activate",
|
||||
GTK_SIGNAL_FUNC(gnc_option_menu_cb),
|
||||
option_info[i].user_data);
|
||||
|
||||
gtk_menu_append(GTK_MENU(menu), menu_item);
|
||||
}
|
||||
|
||||
gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), menu);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (omenu), "destroy",
|
||||
GTK_SIGNAL_FUNC (option_menu_destroy_cb), tooltips);
|
||||
|
||||
return omenu;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* 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_PIXMAP_DIR, "/", name, NULL);
|
||||
pixmap = gnome_pixmap_new_from_file (fullname);
|
||||
g_free (fullname);
|
||||
|
||||
return pixmap;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_get_imlib_image *
|
||||
* returns a GdkImlibImage object given a pixmap filename *
|
||||
* *
|
||||
* Args: none *
|
||||
* Returns: GnomePixmap widget or NULL if there was a problem *
|
||||
\*******************************************************************/
|
||||
GdkImlibImage *
|
||||
gnc_get_gdk_imlib_image (const char *name)
|
||||
{
|
||||
GdkImlibImage *image;
|
||||
|
||||
char *fullname;
|
||||
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
fullname = g_strconcat (GNC_PIXMAP_DIR, "/", name, NULL);
|
||||
image = gdk_imlib_load_image (fullname);
|
||||
g_free (fullname);
|
||||
|
||||
return image;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_get_toolbar_style *
|
||||
* returns the current toolbar style for gnucash toolbars *
|
||||
* *
|
||||
* Args: none *
|
||||
* Returns: toolbar style *
|
||||
\*******************************************************************/
|
||||
GtkToolbarStyle
|
||||
gnc_get_toolbar_style(void)
|
||||
{
|
||||
GtkToolbarStyle tbstyle = GTK_TOOLBAR_BOTH;
|
||||
char *style_string;
|
||||
|
||||
style_string = gnc_lookup_multichoice_option("General",
|
||||
"Toolbar Buttons",
|
||||
"icons_and_text");
|
||||
|
||||
if (safe_strcmp(style_string, "icons_and_text") == 0)
|
||||
tbstyle = GTK_TOOLBAR_BOTH;
|
||||
else if (safe_strcmp(style_string, "icons_only") == 0)
|
||||
tbstyle = GTK_TOOLBAR_ICONS;
|
||||
else if (safe_strcmp(style_string, "text_only") == 0)
|
||||
tbstyle = GTK_TOOLBAR_TEXT;
|
||||
|
||||
if (style_string != NULL)
|
||||
free(style_string);
|
||||
|
||||
return tbstyle;
|
||||
}
|
||||
|
||||
/********************************************************************
|
||||
* gnc_get_mdi_mode *
|
||||
* returns the current Gnome MDI mode preference *
|
||||
********************************************************************/
|
||||
GnomeMDIMode
|
||||
gnc_get_mdi_mode(void) {
|
||||
GnomeMDIMode mode = GNOME_MDI_DEFAULT_MODE;
|
||||
char * mode_string = gnc_lookup_multichoice_option("General",
|
||||
"Application MDI mode",
|
||||
"");
|
||||
if(!safe_strcmp(mode_string, "mdi-notebook")) {
|
||||
mode = GNOME_MDI_NOTEBOOK;
|
||||
}
|
||||
else if(!safe_strcmp(mode_string, "mdi-toplevel")) {
|
||||
mode = GNOME_MDI_TOPLEVEL;
|
||||
}
|
||||
else if(!safe_strcmp(mode_string, "mdi-modal")) {
|
||||
mode = GNOME_MDI_MODAL;
|
||||
}
|
||||
else if(!safe_strcmp(mode_string, "mdi-default")) {
|
||||
mode = GNOME_MDI_DEFAULT_MODE;
|
||||
}
|
||||
|
||||
if(mode_string) free(mode_string);
|
||||
return mode;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_get_deficit_color *
|
||||
* fill in the 3 color values for the color of deficit values *
|
||||
* *
|
||||
* Args: color - color structure *
|
||||
* Returns: none *
|
||||
\*******************************************************************/
|
||||
void
|
||||
gnc_get_deficit_color(GdkColor *color)
|
||||
{
|
||||
color->red = 50000;
|
||||
color->green = 0;
|
||||
color->blue = 0;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_set_label_color *
|
||||
* sets the color of the label given the value *
|
||||
* *
|
||||
* Args: label - gtk label widget *
|
||||
* value - value to use to set color *
|
||||
* Returns: none *
|
||||
\*******************************************************************/
|
||||
void
|
||||
gnc_set_label_color(GtkWidget *label, gnc_numeric value)
|
||||
{
|
||||
gboolean deficit;
|
||||
GdkColormap *cm;
|
||||
GtkStyle *style;
|
||||
|
||||
if (!gnc_color_deficits())
|
||||
return;
|
||||
|
||||
cm = gtk_widget_get_colormap(GTK_WIDGET(label));
|
||||
style = gtk_widget_get_style(GTK_WIDGET(label));
|
||||
|
||||
style = gtk_style_copy(style);
|
||||
|
||||
deficit = gnc_numeric_negative_p (value);
|
||||
|
||||
if (deficit)
|
||||
{
|
||||
gnc_get_deficit_color(&style->fg[GTK_STATE_NORMAL]);
|
||||
gdk_colormap_alloc_color(cm, &style->fg[GTK_STATE_NORMAL], FALSE, TRUE);
|
||||
}
|
||||
else
|
||||
style->fg[GTK_STATE_NORMAL] = style->black;
|
||||
|
||||
gtk_widget_set_style(label, style);
|
||||
|
||||
gtk_style_unref(style);
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_get_window_size *
|
||||
* returns the window size to use for the given option prefix, *
|
||||
* if window sizes are being saved, otherwise returns 0 for both. *
|
||||
* *
|
||||
* Args: prefix - the option name prefix *
|
||||
* width - pointer to width *
|
||||
* height - pointer to height *
|
||||
* Returns: nothing *
|
||||
\*******************************************************************/
|
||||
void
|
||||
gnc_get_window_size(const char *prefix, int *width, int *height)
|
||||
{
|
||||
int w, h;
|
||||
char *name;
|
||||
|
||||
if (gnc_lookup_boolean_option("General", "Save Window Geometry", TRUE))
|
||||
{
|
||||
name = g_strconcat(prefix, "_width", NULL);
|
||||
w = gnc_lookup_number_option("__gui", name, 0.0);
|
||||
g_free(name);
|
||||
|
||||
name = g_strconcat(prefix, "_height", NULL);
|
||||
h = gnc_lookup_number_option("__gui", name, 0.0);
|
||||
g_free(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
w = 0;
|
||||
h = 0;
|
||||
}
|
||||
|
||||
if (width != NULL)
|
||||
*width = w;
|
||||
|
||||
if (height != NULL)
|
||||
*height = h;
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_save_window_size *
|
||||
* save the window size into options whose names are determined *
|
||||
* by the string prefix. *
|
||||
* *
|
||||
* Args: prefix - determines the options used to save the values *
|
||||
* width - width of the window to save *
|
||||
* height - height of the window to save *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_save_window_size(const char *prefix, int width, int height)
|
||||
{
|
||||
char *name;
|
||||
gboolean save;
|
||||
|
||||
save = gnc_lookup_boolean_option("General", "Save Window Geometry", FALSE);
|
||||
|
||||
name = g_strconcat(prefix, "_width", NULL);
|
||||
if (save)
|
||||
gnc_set_number_option("__gui", name, width);
|
||||
else
|
||||
gnc_set_option_default("__gui", name);
|
||||
g_free(name);
|
||||
|
||||
name = g_strconcat(prefix, "_height", NULL);
|
||||
if (save)
|
||||
gnc_set_number_option("__gui", name, height);
|
||||
else
|
||||
gnc_set_option_default("__gui", name);
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_fill_menu_with_data *
|
||||
* fill the user data values in the menu structure with the given *
|
||||
* value. The filling is done recursively. *
|
||||
* *
|
||||
* Args: info - the menu to fill *
|
||||
* data - the value to fill with *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_fill_menu_with_data(GnomeUIInfo *info, gpointer data)
|
||||
{
|
||||
if (info == NULL)
|
||||
return;
|
||||
|
||||
while (1)
|
||||
{
|
||||
switch (info->type)
|
||||
{
|
||||
case GNOME_APP_UI_RADIOITEMS:
|
||||
case GNOME_APP_UI_SUBTREE:
|
||||
case GNOME_APP_UI_SUBTREE_STOCK:
|
||||
gnc_fill_menu_with_data((GnomeUIInfo *) info->moreinfo, data);
|
||||
break;
|
||||
case GNOME_APP_UI_ENDOFINFO:
|
||||
return;
|
||||
default:
|
||||
info->user_data = data;
|
||||
break;
|
||||
}
|
||||
|
||||
info++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnc_option_menu_init(GtkWidget * w)
|
||||
{
|
||||
GtkWidget * menu;
|
||||
GtkWidget * active;
|
||||
int i;
|
||||
|
||||
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
|
||||
|
||||
for(i = 0; i < g_list_length(GTK_MENU_SHELL(menu)->children); i++)
|
||||
{
|
||||
gtk_option_menu_set_history(GTK_OPTION_MENU(w), i);
|
||||
active = gtk_menu_get_active(GTK_MENU(menu));
|
||||
gtk_object_set_data(GTK_OBJECT(active),
|
||||
"option_index",
|
||||
GINT_TO_POINTER(i));
|
||||
}
|
||||
|
||||
gtk_option_menu_set_history(GTK_OPTION_MENU(w), 0);
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
gnc_option_menu_get_active(GtkWidget * w)
|
||||
{
|
||||
GtkWidget * menu;
|
||||
GtkWidget * menuitem;
|
||||
|
||||
menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(w));
|
||||
menuitem = gtk_menu_get_active(GTK_MENU(menu));
|
||||
|
||||
return GPOINTER_TO_INT(gtk_object_get_data(GTK_OBJECT(menuitem),
|
||||
"option_index"));
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************\
|
||||
* gnc_window_adjust_for_screen *
|
||||
* adjust the window size if it is bigger than the screen size. *
|
||||
* *
|
||||
* Args: window - the window to adjust *
|
||||
* Returns: nothing *
|
||||
\********************************************************************/
|
||||
void
|
||||
gnc_window_adjust_for_screen(GtkWindow * window)
|
||||
{
|
||||
gint screen_width;
|
||||
gint screen_height;
|
||||
gint width;
|
||||
gint height;
|
||||
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
g_return_if_fail(GTK_IS_WINDOW(window));
|
||||
if (GTK_WIDGET(window)->window == NULL)
|
||||
return;
|
||||
|
||||
screen_width = gdk_screen_width();
|
||||
screen_height = gdk_screen_height();
|
||||
gdk_window_get_size(GTK_WIDGET(window)->window, &width, &height);
|
||||
|
||||
if ((width <= screen_width) && (height <= screen_height))
|
||||
return;
|
||||
|
||||
width = MIN(width, screen_width - 10);
|
||||
width = MAX(width, 0);
|
||||
|
||||
height = MIN(height, screen_height - 10);
|
||||
height = MAX(height, 0);
|
||||
|
||||
gdk_window_resize(GTK_WIDGET(window)->window, width, height);
|
||||
gtk_widget_queue_resize(GTK_WIDGET(window));
|
||||
}
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int row;
|
||||
int col;
|
||||
gboolean checked;
|
||||
} GNCCListCheckNode;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkPixmap *on_pixmap;
|
||||
GdkPixmap *off_pixmap;
|
||||
GdkBitmap *mask;
|
||||
|
||||
GList *pending_checks;
|
||||
} GNCCListCheckInfo;
|
||||
|
||||
static void
|
||||
free_check_list (GList *list)
|
||||
{
|
||||
GList *node;
|
||||
|
||||
for (node = list; node; node = node->next)
|
||||
g_free (node->data);
|
||||
|
||||
g_list_free (list);
|
||||
}
|
||||
|
||||
static void
|
||||
check_realize (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
GNCCListCheckInfo *check_info = user_data;
|
||||
GdkGCValues gc_values;
|
||||
GtkCList *clist;
|
||||
gint font_height;
|
||||
gint check_size;
|
||||
GdkColormap *cm;
|
||||
GtkStyle *style;
|
||||
GList *list;
|
||||
GList *node;
|
||||
GdkGC *gc;
|
||||
|
||||
if (check_info->mask)
|
||||
return;
|
||||
|
||||
style = gtk_widget_get_style (widget);
|
||||
|
||||
font_height = style->font->ascent + style->font->descent;
|
||||
check_size = (font_height > 0) ? font_height - 3 : 9;
|
||||
|
||||
check_info->mask = gdk_pixmap_new (NULL, check_size, check_size, 1);
|
||||
|
||||
check_info->on_pixmap = gdk_pixmap_new (widget->window,
|
||||
check_size, check_size, -1);
|
||||
|
||||
check_info->off_pixmap = gdk_pixmap_new (widget->window,
|
||||
check_size, check_size, -1);
|
||||
|
||||
gc_values.foreground = style->white;
|
||||
gc = gtk_gc_get (1, gtk_widget_get_colormap (widget),
|
||||
&gc_values, GDK_GC_FOREGROUND);
|
||||
|
||||
gdk_draw_rectangle (check_info->mask, gc, TRUE,
|
||||
0, 0, check_size, check_size);
|
||||
|
||||
gtk_gc_release (gc);
|
||||
|
||||
gc = style->base_gc[GTK_STATE_NORMAL];
|
||||
|
||||
gdk_draw_rectangle (check_info->on_pixmap, gc, TRUE,
|
||||
0, 0, check_size, check_size);
|
||||
gdk_draw_rectangle (check_info->off_pixmap, gc, TRUE,
|
||||
0, 0, check_size, check_size);
|
||||
|
||||
cm = gtk_widget_get_colormap (widget);
|
||||
|
||||
gc_values.foreground.red = 0;
|
||||
gc_values.foreground.green = 65535 / 2;
|
||||
gc_values.foreground.blue = 0;
|
||||
|
||||
gdk_colormap_alloc_color (cm, &gc_values.foreground, FALSE, TRUE);
|
||||
|
||||
gc = gdk_gc_new_with_values (widget->window, &gc_values, GDK_GC_FOREGROUND);
|
||||
|
||||
gdk_draw_line (check_info->on_pixmap, gc,
|
||||
1, check_size / 2,
|
||||
check_size / 3, check_size - 5);
|
||||
gdk_draw_line (check_info->on_pixmap, gc,
|
||||
1, check_size / 2 + 1,
|
||||
check_size / 3, check_size - 4);
|
||||
|
||||
gdk_draw_line (check_info->on_pixmap, gc,
|
||||
check_size / 3, check_size - 5,
|
||||
check_size - 3, 2);
|
||||
gdk_draw_line (check_info->on_pixmap, gc,
|
||||
check_size / 3, check_size - 4,
|
||||
check_size - 3, 1);
|
||||
|
||||
gdk_gc_unref (gc);
|
||||
|
||||
clist = GTK_CLIST (widget);
|
||||
|
||||
list = check_info->pending_checks;
|
||||
check_info->pending_checks = NULL;
|
||||
|
||||
/* reverse so we apply in the order of the calls */
|
||||
list = g_list_reverse (list);
|
||||
|
||||
for (node = list; node; node = node->next)
|
||||
{
|
||||
GNCCListCheckNode *cl_node = node->data;
|
||||
|
||||
gnc_clist_set_check (clist, cl_node->row, cl_node->col, cl_node->checked);
|
||||
}
|
||||
|
||||
free_check_list (list);
|
||||
}
|
||||
|
||||
static void
|
||||
check_unrealize (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
GNCCListCheckInfo *check_info = user_data;
|
||||
|
||||
if (check_info->mask)
|
||||
gdk_bitmap_unref (check_info->mask);
|
||||
|
||||
if (check_info->on_pixmap)
|
||||
gdk_pixmap_unref (check_info->on_pixmap);
|
||||
|
||||
if (check_info->off_pixmap)
|
||||
gdk_pixmap_unref (check_info->off_pixmap);
|
||||
|
||||
check_info->mask = NULL;
|
||||
check_info->on_pixmap = NULL;
|
||||
check_info->off_pixmap = NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
check_destroy (GtkWidget *widget, gpointer user_data)
|
||||
{
|
||||
GNCCListCheckInfo *check_info = user_data;
|
||||
|
||||
free_check_list (check_info->pending_checks);
|
||||
check_info->pending_checks = NULL;
|
||||
|
||||
g_free (check_info);
|
||||
}
|
||||
|
||||
static GNCCListCheckInfo *
|
||||
gnc_clist_add_check (GtkCList *list)
|
||||
{
|
||||
GNCCListCheckInfo *check_info;
|
||||
GtkObject *object;
|
||||
|
||||
object = GTK_OBJECT (list);
|
||||
|
||||
check_info = gtk_object_get_data (object, "gnc-check-info");
|
||||
if (check_info)
|
||||
{
|
||||
PWARN ("clist already has check");
|
||||
return check_info;
|
||||
}
|
||||
|
||||
check_info = g_new0 (GNCCListCheckInfo, 1);
|
||||
|
||||
gtk_object_set_data (object, "gnc-check-info", check_info);
|
||||
|
||||
gtk_signal_connect (object, "realize",
|
||||
GTK_SIGNAL_FUNC (check_realize), check_info);
|
||||
gtk_signal_connect (object, "unrealize",
|
||||
GTK_SIGNAL_FUNC (check_unrealize), check_info);
|
||||
gtk_signal_connect (object, "destroy",
|
||||
GTK_SIGNAL_FUNC (check_destroy), check_info);
|
||||
|
||||
if (GTK_WIDGET_REALIZED (GTK_WIDGET (list)))
|
||||
check_realize (GTK_WIDGET (list), check_info);
|
||||
|
||||
return check_info;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gnc_clist_set_check (GtkCList *list, int row, int col, gboolean checked)
|
||||
{
|
||||
GNCCListCheckInfo *check_info;
|
||||
GdkPixmap *pixmap;
|
||||
|
||||
g_return_if_fail (GTK_IS_CLIST (list));
|
||||
|
||||
check_info = gtk_object_get_data (GTK_OBJECT (list), "gnc-check-info");
|
||||
if (!check_info)
|
||||
check_info = gnc_clist_add_check (list);
|
||||
|
||||
if (!GTK_WIDGET_REALIZED (GTK_WIDGET (list)))
|
||||
{
|
||||
GNCCListCheckNode *node;
|
||||
|
||||
node = g_new0 (GNCCListCheckNode, 1);
|
||||
|
||||
node->row = row;
|
||||
node->col = col;
|
||||
node->checked = checked;
|
||||
|
||||
check_info->pending_checks =
|
||||
g_list_prepend (check_info->pending_checks, node);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
pixmap = checked ? check_info->on_pixmap : check_info->off_pixmap;
|
||||
|
||||
if (checked)
|
||||
gtk_clist_set_pixmap (list, row, col, pixmap, check_info->mask);
|
||||
else
|
||||
gtk_clist_set_text (list, row, col, "");
|
||||
}
|
||||
|
||||
void
|
||||
gnc_clist_columns_autosize (GtkCList *list)
|
||||
{
|
||||
GtkStyle *style;
|
||||
GdkFont *font;
|
||||
gint i;
|
||||
|
||||
if (!list) return;
|
||||
g_return_if_fail (GTK_IS_CLIST (list));
|
||||
|
||||
style = gtk_widget_get_style (GTK_WIDGET(list));
|
||||
if (!style)
|
||||
return;
|
||||
|
||||
font = style->font;
|
||||
if (!font)
|
||||
return;
|
||||
|
||||
for (i = 0; TRUE; i++)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
char *title;
|
||||
gint width;
|
||||
|
||||
widget = gtk_clist_get_column_widget (list, i);
|
||||
if (!widget)
|
||||
break;
|
||||
|
||||
if (!GTK_IS_LABEL (widget))
|
||||
continue;
|
||||
|
||||
gtk_label_get (GTK_LABEL (widget), &title);
|
||||
|
||||
width = gdk_string_width (font, title);
|
||||
gtk_clist_set_column_min_width (list, i, width + 5);
|
||||
}
|
||||
|
||||
gtk_clist_columns_autosize (list);
|
||||
}
|
||||
|
||||
|
||||
static gboolean glade_inited = FALSE;
|
||||
|
||||
GladeXML *
|
||||
gnc_glade_xml_new (const char *filename, const char *root)
|
||||
{
|
||||
GladeXML *xml;
|
||||
char *fname;
|
||||
|
||||
g_return_val_if_fail (filename != NULL, NULL);
|
||||
g_return_val_if_fail (root != NULL, NULL);
|
||||
|
||||
if (!glade_inited)
|
||||
{
|
||||
glade_gnome_init ();
|
||||
glade_inited = TRUE;
|
||||
}
|
||||
|
||||
fname = g_strconcat (GNC_GLADE_DIR, "/", filename, NULL);
|
||||
|
||||
xml = glade_xml_new (fname, root);
|
||||
|
||||
g_free (fname);
|
||||
|
||||
return xml;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gnc_glade_lookup_widget (GtkWidget *widget, const char *name)
|
||||
{
|
||||
GladeXML *xml;
|
||||
|
||||
if (!widget || !name) return NULL;
|
||||
|
||||
xml = glade_get_widget_tree (widget);
|
||||
if (!xml) return NULL;
|
||||
|
||||
return glade_xml_get_widget (xml, name);
|
||||
}
|
95
src/gnome-utils/dialog-utils.h
Normal file
95
src/gnome-utils/dialog-utils.h
Normal file
@ -0,0 +1,95 @@
|
||||
/********************************************************************\
|
||||
* dialog-utils.h -- utility functions for creating dialogs *
|
||||
* for GnuCash *
|
||||
* Copyright (C) 1999-2000 Linas Vepstas *
|
||||
* *
|
||||
* 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 DIALOG_UTILS_H
|
||||
#define DIALOG_UTILS_H
|
||||
|
||||
#include <glade/glade.h>
|
||||
#include <gnome.h>
|
||||
|
||||
#include "Account.h"
|
||||
|
||||
|
||||
/* option button callback function */
|
||||
typedef void (*GNCOptionCallback) (GtkWidget *, gint index,
|
||||
gpointer user_data);
|
||||
|
||||
/* Structure for building option buttons */
|
||||
typedef struct _GNCOptionInfo GNCOptionInfo;
|
||||
struct _GNCOptionInfo
|
||||
{
|
||||
char *name;
|
||||
char *tip;
|
||||
GNCOptionCallback callback;
|
||||
gpointer user_data;
|
||||
};
|
||||
|
||||
|
||||
/**** PROTOTYPES *************************************************/
|
||||
GtkWidget * gnc_ui_source_menu_create (Account *account);
|
||||
|
||||
guint gnc_find_timezone_menu_position(const gchar *timezone);
|
||||
gchar * gnc_timezone_menu_position_to_string(guint pos);
|
||||
GtkWidget * gnc_ui_quote_tz_menu_create (Account *account);
|
||||
|
||||
GtkWidget * gnc_build_option_menu (GNCOptionInfo *option_info,
|
||||
gint num_options);
|
||||
|
||||
GtkWidget * gnc_get_pixmap (const char *name);
|
||||
GdkImlibImage * gnc_get_gdk_imlib_image (const char *name);
|
||||
|
||||
GtkToolbarStyle gnc_get_toolbar_style (void);
|
||||
GnomeMDIMode gnc_get_mdi_mode(void);
|
||||
|
||||
void gnc_get_deficit_color (GdkColor *color);
|
||||
void gnc_set_label_color (GtkWidget *label, gnc_numeric value);
|
||||
|
||||
void gnc_get_window_size (const char *prefix, int *width, int *height);
|
||||
void gnc_save_window_size (const char *prefix, int width, int height);
|
||||
|
||||
void gnc_fill_menu_with_data (GnomeUIInfo *info, gpointer data);
|
||||
|
||||
void gnc_option_menu_init (GtkWidget * option_menu);
|
||||
int gnc_option_menu_get_active (GtkWidget * option_menu);
|
||||
|
||||
void gnc_window_adjust_for_screen (GtkWindow * window);
|
||||
|
||||
|
||||
/* This function sets or clears a check mark in a GtkCList row.
|
||||
* There are some restrictions on using this function. If you mix
|
||||
* this function with gtk_clist_{insert, prepend, remove} before
|
||||
* the clist is realized, then the checks may appear in the wrong
|
||||
* place. Stick to gtk_clist_append, or use gnc_clist_set_check
|
||||
* after you have built the list. This only applies to unrealized
|
||||
* widgets. */
|
||||
void gnc_clist_set_check (GtkCList *list, int row, int col, gboolean checked);
|
||||
|
||||
/* This function is similar to gtk_clist_columns_autosize, but
|
||||
* also takes into account the column titles. */
|
||||
void gnc_clist_columns_autosize (GtkCList *list);
|
||||
|
||||
GladeXML * gnc_glade_xml_new (const char *filename, const char *root);
|
||||
GtkWidget * gnc_glade_lookup_widget (GtkWidget *widget, const char *name);
|
||||
|
||||
#endif
|
151
src/gnome-utils/druid-utils.c
Normal file
151
src/gnome-utils/druid-utils.c
Normal file
@ -0,0 +1,151 @@
|
||||
/********************************************************************\
|
||||
* druid-utils.c -- utility functions for creating druids *
|
||||
* Copyright (C) 2001 Jeremy Collins *
|
||||
* Copyright (C) 2001 Dave Peticolas <dave@krondo.com> *
|
||||
* *
|
||||
* 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 "dialog-utils.h"
|
||||
#include "druid-utils.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_GUI;
|
||||
|
||||
void
|
||||
gnc_druid_set_watermark_image (GnomeDruid *druid, char *image_path)
|
||||
{
|
||||
GdkImlibImage *image;
|
||||
GList *pages = GNOME_DRUID(druid)->children;
|
||||
|
||||
while(pages != NULL) {
|
||||
|
||||
image = gnc_get_gdk_imlib_image(image_path);
|
||||
|
||||
if (g_list_previous(pages) == NULL) {
|
||||
gnome_druid_page_start_set_watermark
|
||||
(GNOME_DRUID_PAGE_START(pages->data), image);
|
||||
} else if (g_list_next(pages) == NULL) {
|
||||
gnome_druid_page_finish_set_watermark
|
||||
(GNOME_DRUID_PAGE_FINISH(pages->data), image);
|
||||
}
|
||||
|
||||
pages = g_list_next(pages);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gnc_druid_set_title_image (GnomeDruid *druid, char *image_path)
|
||||
{
|
||||
GtkWidget *canvas;
|
||||
GnomeCanvasItem *item;
|
||||
GnomeCanvasItem *title_item;
|
||||
GdkImlibImage *image;
|
||||
GList *pages = GNOME_DRUID(druid)->children;
|
||||
|
||||
while(pages != NULL) {
|
||||
|
||||
image = gnc_get_gdk_imlib_image(image_path);
|
||||
|
||||
if (g_list_previous(pages) == NULL) {
|
||||
canvas = GNOME_DRUID_PAGE_START(pages->data)->canvas;
|
||||
title_item = GNOME_DRUID_PAGE_START(pages->data)->title_item;
|
||||
} else if (g_list_next(pages) == NULL) {
|
||||
canvas = GNOME_DRUID_PAGE_FINISH(pages->data)->canvas;
|
||||
title_item = GNOME_DRUID_PAGE_FINISH(pages->data)->title_item;
|
||||
} else {
|
||||
canvas = GNOME_DRUID_PAGE_STANDARD(pages->data)->canvas;
|
||||
title_item = GNOME_DRUID_PAGE_STANDARD(pages->data)->title_item;
|
||||
}
|
||||
|
||||
item = gnome_canvas_item_new (gnome_canvas_root (GNOME_CANVAS (canvas)),
|
||||
gnome_canvas_image_get_type (),
|
||||
"image", image,
|
||||
"x", 0.0,
|
||||
"y", 0.0,
|
||||
"anchor", GTK_ANCHOR_NORTH_WEST,
|
||||
"width", (gfloat) 462,
|
||||
"height", (gfloat) 67,
|
||||
NULL);
|
||||
|
||||
gnome_canvas_item_raise_to_top (title_item);
|
||||
|
||||
pages = g_list_next(pages);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gnc_druid_set_colors (GnomeDruid *druid)
|
||||
{
|
||||
GList *pages;
|
||||
GdkColor color;
|
||||
GdkColormap *cm;
|
||||
|
||||
if (!druid) return;
|
||||
if (!GNOME_IS_DRUID (druid)) return;
|
||||
|
||||
color.red = (gushort) (.60 * 65535);
|
||||
color.green = (gushort) (.75 * 65535);
|
||||
color.blue = (gushort) (.60 * 65535);
|
||||
|
||||
cm = gtk_widget_get_colormap (GTK_WIDGET (druid));
|
||||
|
||||
gdk_colormap_alloc_color(cm, &color, FALSE, TRUE);
|
||||
|
||||
pages = GNOME_DRUID(druid)->children;
|
||||
|
||||
while (pages != NULL)
|
||||
{
|
||||
GnomeDruidPage *page = GNOME_DRUID_PAGE (pages->data);
|
||||
|
||||
if (GNOME_IS_DRUID_PAGE_START (page))
|
||||
{
|
||||
GnomeDruidPageStart *page_start;
|
||||
|
||||
page_start = GNOME_DRUID_PAGE_START (page);
|
||||
|
||||
gnome_druid_page_start_set_bg_color (page_start, &color);
|
||||
gnome_druid_page_start_set_logo_bg_color (page_start, &color);
|
||||
}
|
||||
else if (GNOME_IS_DRUID_PAGE_STANDARD (page))
|
||||
{
|
||||
GnomeDruidPageStandard *page_standard;
|
||||
|
||||
page_standard = GNOME_DRUID_PAGE_STANDARD (page);
|
||||
|
||||
gnome_druid_page_standard_set_bg_color (page_standard, &color);
|
||||
gnome_druid_page_standard_set_logo_bg_color (page_standard, &color);
|
||||
}
|
||||
else if (GNOME_IS_DRUID_PAGE_FINISH (page))
|
||||
{
|
||||
GnomeDruidPageFinish *page_finish;
|
||||
|
||||
page_finish = GNOME_DRUID_PAGE_FINISH (page);
|
||||
|
||||
gnome_druid_page_finish_set_bg_color (page_finish, &color);
|
||||
gnome_druid_page_finish_set_logo_bg_color (page_finish, &color);
|
||||
}
|
||||
|
||||
pages = g_list_next (pages);
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
/********************************************************************\
|
||||
* RegWindow.h -- the register window for xacc (X-Accountant) *
|
||||
* Copyright (C) 1997 Robin D. Clark *
|
||||
* Copyright (C) 1998-2000 Linas Vepstas *
|
||||
* druid-utils.h -- utility functions for creating druids *
|
||||
* Copyright (C) 2001 Jeremy Collins *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU General Public License as *
|
||||
@ -14,29 +13,22 @@
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA. *
|
||||
* 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 *
|
||||
* *
|
||||
* Author: Rob Clark *
|
||||
* Internet: rclark@cs.hmc.edu *
|
||||
* Address: 609 8th Street *
|
||||
* Huntington Beach, CA 92648-4632 *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef REGWINDOW_H
|
||||
#define REGWINDOW_H
|
||||
#ifndef DRUID_UTILS_H
|
||||
#define DRUID_UTILS_H
|
||||
|
||||
#include "config.h"
|
||||
#include <gnome.h>
|
||||
|
||||
#include "Account.h"
|
||||
void gnc_druid_set_title_image (GnomeDruid *druid, char *image_path);
|
||||
void gnc_druid_set_watermark_image (GnomeDruid *druid, char *image_path);
|
||||
|
||||
/** GLOBALS *********************************************************/
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
typedef struct _RegWindow RegWindow;
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
RegWindow *regWindowSimple(Account *account);
|
||||
RegWindow *regWindowAccGroup(Account *account_group);
|
||||
void gnc_druid_set_colors (GnomeDruid *druid);
|
||||
|
||||
#endif
|
@ -28,16 +28,14 @@
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "FileDialog.h"
|
||||
#include "account-tree.h"
|
||||
#include "Group.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnucash.h"
|
||||
#include "messages.h"
|
||||
#include "window-main.h"
|
||||
|
||||
#define ACCOUNT_TREE_CM_CLASS "account-tree"
|
||||
|
@ -37,7 +37,6 @@
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-exp-parser.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "dialog-commodity.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "guile-util.h"
|
||||
#include "messages.h"
|
||||
|
@ -32,13 +32,14 @@
|
||||
* Author: Dave Peticolas <peticola@cs.ucdavis.edu>
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h> /* atoi */
|
||||
#include <ctype.h> /* isdigit */
|
||||
#include <stdio.h>
|
||||
|
||||
#include "gnc-datedelta.h"
|
||||
#include "gnc-date-delta.h"
|
||||
#include "messages.h"
|
||||
#include "date.h"
|
||||
|
@ -41,7 +41,7 @@
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "messages.h"
|
||||
#include "date.h"
|
||||
|
@ -20,8 +20,8 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __GNC_DIR_H__
|
||||
#define __GNC_DIR_H__
|
||||
#ifndef GNC_DIR_H
|
||||
#define GNC_DIR_H
|
||||
|
||||
#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
|
||||
#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************\
|
||||
* query-user.c -- functions for creating dialogs for GnuCash *
|
||||
* gnc-gui-query.c -- functions for creating dialogs for GnuCash *
|
||||
* Copyright (C) 1998, 1999, 2000 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -24,10 +24,10 @@
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************\
|
||||
* query-user.h -- functions for creating dialogs for GnuCash *
|
||||
* gnc-gui-query.h -- functions for creating dialogs for GnuCash *
|
||||
* Copyright (C) 1998, 1999, 2000 Linas Vepstas *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
@ -44,7 +44,6 @@
|
||||
|
||||
#include "Account.h"
|
||||
#include "Group.h"
|
||||
#include "RegWindow.h"
|
||||
#include "file-utils.h"
|
||||
#include "FileBox.h"
|
||||
#include "FileDialog.h"
|
||||
@ -54,13 +53,13 @@
|
||||
#include "global-options.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gpg.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-http.h"
|
||||
#include "gnc-html-history.h"
|
||||
#include "gnc-network.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "query-user.h"
|
||||
#include "window-help.h"
|
||||
#include "window-main.h"
|
||||
#include "window-report.h"
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************\
|
||||
* extensions.c -- functions to build dynamic extensions *
|
||||
* gnc-menu-extensions.c -- functions to build dynamic menus *
|
||||
* Copyright (C) 1999 Rob Browning *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -24,9 +24,9 @@
|
||||
|
||||
#include <gnome.h>
|
||||
|
||||
#include "extensions.h"
|
||||
#include "guile-util.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
#include "gnc-ui.h"
|
||||
|
||||
typedef struct _ExtensionInfo ExtensionInfo;
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************\
|
||||
* extensions.h -- functions to build the dynamic extensions *
|
||||
* gnc-menu-extensions.h -- functions to build dynamic menus *
|
||||
* Copyright (C) 1999 Rob Browning *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@ -20,8 +20,8 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef EXTENSIONS_H
|
||||
#define EXTENSIONS_H
|
||||
#ifndef GNC_MENU_EXTENSIONS_H
|
||||
#define GNC_MENU_EXTENSIONS_H
|
||||
|
||||
#include <guile/gh.h>
|
||||
#include <gnome.h>
|
58
src/gnome-utils/gncmod-gnome-utils.c
Normal file
58
src/gnome-utils/gncmod-gnome-utils.c
Normal file
@ -0,0 +1,58 @@
|
||||
/*********************************************************************
|
||||
* gncmod-gnome-utils.c
|
||||
* module definition/initialization for the gnome utilities
|
||||
*
|
||||
* Copyright (c) 2001 Linux Developers Group, Inc.
|
||||
*********************************************************************/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <guile/gh.h>
|
||||
#include <glib.h>
|
||||
#include <libguile/strports.h>
|
||||
#include <libguile/modules.h>
|
||||
|
||||
#include "gnc-module.h"
|
||||
#include "gnc-module-api.h"
|
||||
|
||||
/* version of the gnc module system interface we require */
|
||||
int gnc_module_system_interface = 0;
|
||||
|
||||
/* module versioning uses libtool semantics. */
|
||||
int gnc_module_current = 0;
|
||||
int gnc_module_revision = 0;
|
||||
int gnc_module_age = 0;
|
||||
|
||||
char *
|
||||
gnc_module_path(void) {
|
||||
return g_strdup("gnucash/gnome-utils");
|
||||
}
|
||||
|
||||
char *
|
||||
gnc_module_description(void) {
|
||||
return g_strdup("Utilities for using Gnome/Gtk with GnuCash");
|
||||
}
|
||||
|
||||
int
|
||||
gnc_module_init(int refcount) {
|
||||
/* load the engine (we depend on it) */
|
||||
if(!gnc_module_load("gnucash/engine", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* load the calculation module (we depend on it) */
|
||||
if(!gnc_module_load("gnucash/calculation", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* load the calculation module (we depend on it) */
|
||||
if(!gnc_module_load("gnucash/app-utils", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int
|
||||
gnc_module_end(int refcount) {
|
||||
return TRUE;
|
||||
}
|
@ -2,10 +2,5 @@ Makefile
|
||||
Makefile.in
|
||||
.deps
|
||||
*.diff
|
||||
backup.glade
|
||||
glade-cb-gnc-dialogs.c
|
||||
#glade-gnc-dialogs.c
|
||||
#glade-cb-gnc-dialogs.h
|
||||
#glade-gnc-dialogs.h
|
||||
gnc-dir.h
|
||||
gnucash.keys
|
||||
|
@ -3,13 +3,10 @@ SUBDIRS = glade
|
||||
noinst_LIBRARIES = libgncgnome.a
|
||||
|
||||
libgncgnome_a_SOURCES = \
|
||||
account-tree.c \
|
||||
argv-list-converters.c \
|
||||
cursors.c \
|
||||
dialog-account.c \
|
||||
dialog-column-view.c \
|
||||
dialog-commodities.c \
|
||||
dialog-commodity.c \
|
||||
dialog-dup-trans.c \
|
||||
dialog-filebox.c \
|
||||
dialog-fincalc.c \
|
||||
@ -25,32 +22,18 @@ libgncgnome_a_SOURCES = \
|
||||
dialog-totd.c \
|
||||
dialog-transfer.c \
|
||||
dialog-userpass.c \
|
||||
dialog-utils.c \
|
||||
dialog-scheduledxaction.c \
|
||||
druid-commodity.c \
|
||||
druid-hierarchy.c \
|
||||
druid-stock-split.c \
|
||||
druid-utils.c \
|
||||
extensions.c \
|
||||
file-history.c \
|
||||
file-utils.c \
|
||||
gnc-amount-edit.c \
|
||||
gnc-commodity-edit.c \
|
||||
gnc-currency-edit.c \
|
||||
gnc-datedelta.c \
|
||||
gnc-dateedit.c \
|
||||
gnc-gpg.c \
|
||||
gnc-frequency.c \
|
||||
gnc-html-history.c \
|
||||
gnc-html-guppi.c \
|
||||
gnc-html.c \
|
||||
gnc-http.c \
|
||||
gnc-network.c \
|
||||
gnc-splash.c \
|
||||
gtkselect.c \
|
||||
mainwindow-account-tree.c \
|
||||
print-session.c \
|
||||
query-user.c \
|
||||
reconcile-list.c \
|
||||
top-level.c \
|
||||
window-acct-tree.c \
|
||||
@ -73,11 +56,9 @@ mimedir = $(datadir)/mime-info
|
||||
mime_DATA = gnucash.keys gnucash.mime
|
||||
|
||||
noinst_HEADERS = \
|
||||
account-tree.h \
|
||||
argv-list-converters.h \
|
||||
dialog-account.h \
|
||||
dialog-column-view.h \
|
||||
dialog-commodity.h \
|
||||
dialog-fincalc.h \
|
||||
dialog-find-transactions.h \
|
||||
dialog-new-user.h \
|
||||
@ -88,31 +69,16 @@ noinst_HEADERS = \
|
||||
dialog-sx-from-trans.h \
|
||||
dialog-totd.h \
|
||||
dialog-transfer.h \
|
||||
dialog-utils.h \
|
||||
dialog-scheduledxaction.h \
|
||||
druid-commodity.h \
|
||||
druid-hierarchy.h \
|
||||
druid-utils.h \
|
||||
extensions.h \
|
||||
file-utils.h \
|
||||
gnc-amount-edit.h \
|
||||
gnc-commodity-edit.h \
|
||||
gnc-currency-edit.h \
|
||||
gnc-datedelta.h \
|
||||
gnc-dateedit.h \
|
||||
gnc-dir.h \
|
||||
gnc-gpg.h \
|
||||
gnc-frequency.h \
|
||||
gnc-html-history.h \
|
||||
gnc-html-guppi.h \
|
||||
gnc-html.h \
|
||||
gnc-http.h \
|
||||
gnc-network.h \
|
||||
gnc-splash.h \
|
||||
gtkselect.h \
|
||||
mainwindow-account-tree.h \
|
||||
print-session.h \
|
||||
query-user.h \
|
||||
reconcile-list.h \
|
||||
top-level.h \
|
||||
window-acct-tree.h \
|
||||
@ -127,7 +93,6 @@ noinst_HEADERS = \
|
||||
|
||||
EXTRA_DIST = \
|
||||
.cvsignore \
|
||||
gnc-dir.h.in \
|
||||
gnucash.desktop \
|
||||
gnucash.keys.in \
|
||||
gnucash.mime
|
||||
@ -147,6 +112,7 @@ INCLUDES = \
|
||||
-I${top_srcdir}/src/app-utils \
|
||||
-I${top_srcdir}/src/backend/file \
|
||||
-I${top_srcdir}/src/g-wrap \
|
||||
-I${top_srcdir}/src/gnome-utils \
|
||||
-I${top_srcdir}/src/guile \
|
||||
-I${top_srcdir}/src/register/ledger-core \
|
||||
-I${top_srcdir}/src/register/register-core \
|
||||
@ -166,22 +132,3 @@ gnucash.keys: gnucash.keys.in
|
||||
-e 's:@-icondir-@:${appicondir}:g'
|
||||
chmod +x $@.tmp
|
||||
mv $@.tmp $@
|
||||
|
||||
## 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_ACCOUNTS_DIR-@:${GNC_ACCOUNTS_DIR}:g' \
|
||||
-e 's:@-GNC_GLADE_DIR-@:${GNC_GLADE_DIR}:g' \
|
||||
-e 's:@-GNC_PIXMAP_DIR-@:${GNC_PIXMAP_DIR}: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
|
||||
|
@ -28,21 +28,21 @@
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "FileDialog.h"
|
||||
#include "account-tree.h"
|
||||
#include "dialog-account.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "top-level.h"
|
||||
#include "window-help.h"
|
||||
#include "window-main.h"
|
||||
|
@ -27,7 +27,7 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
|
@ -34,10 +34,10 @@
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
|
||||
|
||||
#define DIALOG_FINCALC_CM_CLASS "dialog-fincalc"
|
||||
|
@ -32,13 +32,12 @@
|
||||
|
||||
#include "FileDialog.h"
|
||||
#include "Query.h"
|
||||
#include "RegWindow.h"
|
||||
#include "account-tree.h"
|
||||
#include "dialog-find-transactions.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-ui.h"
|
||||
|
@ -26,21 +26,20 @@
|
||||
|
||||
#include "dialog-options.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "option-util.h"
|
||||
#include "guile-util.h"
|
||||
#include "query-user.h"
|
||||
#include "engine-helpers.h"
|
||||
#include "account-tree.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "gnc-currency-edit.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "global-options.h"
|
||||
#include "query-user.h"
|
||||
#include "window-help.h"
|
||||
#include "messages.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "guile-util.h"
|
||||
#include "messages.h"
|
||||
#include "option-util.h"
|
||||
#include "window-help.h"
|
||||
|
||||
/* This static indicates the debugging module that this .o belongs to. */
|
||||
static short module = MOD_GUI;
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-currency-edit.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-ui.h"
|
||||
|
@ -40,12 +40,12 @@
|
||||
#include "dialog-scheduledxaction.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-frequency.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
|
||||
static short module = MOD_SX;
|
||||
|
||||
|
@ -26,8 +26,8 @@
|
||||
#include <gnome.h>
|
||||
#include <guile/gh.h>
|
||||
|
||||
#include "account-tree.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-ui.h"
|
||||
|
@ -28,9 +28,9 @@
|
||||
|
||||
#include "dialog-totd.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "tip-of-the-day.h"
|
||||
|
||||
|
||||
|
@ -30,16 +30,17 @@
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-euro.h"
|
||||
#include "gnc-exp-parser.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "window-reconcile.h"
|
||||
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
#define DIALOG_TRANSFER_H
|
||||
|
||||
#include "Account.h"
|
||||
#include "account-tree.h"
|
||||
#include "QuickFill.h"
|
||||
|
||||
typedef struct _xferDialog XferDialog;
|
||||
|
@ -37,9 +37,9 @@
|
||||
#include "druid-commodity.h"
|
||||
#include "druid-utils.h"
|
||||
#include "dialog-commodity.h"
|
||||
#include "query-user.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-pricedb-p.h"
|
||||
|
||||
|
@ -37,8 +37,8 @@
|
||||
#include "gnc-commodity-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dir.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "io-example-account.h"
|
||||
#include "query-user.h"
|
||||
#include "top-level.h"
|
||||
|
||||
static GtkWidget *hierarchy_window = NULL;
|
||||
|
@ -27,18 +27,18 @@
|
||||
|
||||
#include "FileDialog.h"
|
||||
#include "Group.h"
|
||||
#include "account-tree.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "druid-utils.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-currency-edit.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-exp-parser.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
|
||||
|
||||
#define DRUID_STOCK_SPLIT_CM_CLASS "druid-stock-split"
|
||||
|
@ -22,6 +22,7 @@
|
||||
********************************************************************/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gnome.h>
|
||||
#include <gtkhtml/gtkhtml.h>
|
||||
#include <gtkhtml/gtkhtml-embedded.h>
|
||||
@ -29,9 +30,9 @@
|
||||
#include "global-options.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnc-gpg.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-network.h"
|
||||
#include "query-user.h"
|
||||
#include "messages.h"
|
||||
|
||||
/********************************************************************
|
||||
|
@ -23,11 +23,12 @@
|
||||
* Boston, MA 02111-1307, USA gnu@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
#ifndef __GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
#define __GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
#ifndef GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
#define GNC_MAINWIN_ACCOUNT_TREE_H
|
||||
|
||||
#include <gnome.h>
|
||||
#include "account-tree.h"
|
||||
|
||||
#include "gnc-account-tree.h"
|
||||
#include "Account.h"
|
||||
|
||||
#define GNC_MAINWIN_ACCOUNT_TREE(obj) GTK_CHECK_CAST (obj, gnc_mainwin_account_tree_get_type (), GNCMainWinAccountTree)
|
||||
|
@ -44,12 +44,12 @@
|
||||
#include "dialog-account.h"
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "extensions.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-splash.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
#include "gnc-network.h"
|
||||
#include "gnc-splash.h"
|
||||
#ifdef USE_GUPPI
|
||||
#include "gnc-html-guppi.h"
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* window-main.c -- the main window, and associated helpers *
|
||||
* window-acct-tree.c -- the main window account tree *
|
||||
* Copyright (C) 1998,1999 Jeremy Collins *
|
||||
* Copyright (C) 1998,1999,2000 Linas Vepstas *
|
||||
* Copyright (C) 2001 Bill Gribble *
|
||||
@ -29,17 +29,16 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "RegWindow.h"
|
||||
#include "FileBox.h"
|
||||
#include "FileDialog.h"
|
||||
#include "Scrub.h"
|
||||
|
||||
#include "account-tree.h"
|
||||
#include "dialog-account.h"
|
||||
#include "dialog-transfer.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "file-history.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-account-tree.h"
|
||||
#include "gnc-commodity.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
|
@ -35,11 +35,11 @@
|
||||
|
||||
#include "gfec.h"
|
||||
#include "gnc-engine.h"
|
||||
#include "gnc-menu-extensions.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnucash.h"
|
||||
#include "io-utils.h"
|
||||
#include "top-level.h"
|
||||
#include "extensions.h"
|
||||
|
||||
#include "FileBox.h"
|
||||
#include "FileDialog.h"
|
||||
@ -66,9 +66,9 @@
|
||||
#include "file-history.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "mainwindow-account-tree.h"
|
||||
#include "option-util.h"
|
||||
#include "query-user.h"
|
||||
|
||||
#define WINDOW_MAIN_CM_CLASS "window-main"
|
||||
|
||||
|
@ -35,7 +35,6 @@
|
||||
#include <time.h>
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "RegWindow.h"
|
||||
#include "Scrub.h"
|
||||
#include "date.h"
|
||||
#include "dialog-transfer.h"
|
||||
@ -44,14 +43,14 @@
|
||||
#include "global-options.h"
|
||||
#include "gnc-amount-edit.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "guile-util.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "reconcile-list.h"
|
||||
#include "window-help.h"
|
||||
#include "window-reconcile.h"
|
||||
|
@ -35,7 +35,6 @@
|
||||
|
||||
#include "AccWindow.h"
|
||||
#include "FileDialog.h"
|
||||
#include "RegWindow.h"
|
||||
#include "Scrub.h"
|
||||
#include "dialog-find-transactions.h"
|
||||
#include "dialog-transfer.h"
|
||||
@ -43,16 +42,16 @@
|
||||
#include "dialog-sx-from-trans.h"
|
||||
#include "global-options.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-dateedit.h"
|
||||
#include "gnc-date-edit.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-euro.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
#include "gnc-pricedb.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "gnucash-sheet.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "table-allgui.h"
|
||||
#include "window-help.h"
|
||||
#include "window-reconcile.h"
|
||||
|
@ -24,9 +24,14 @@
|
||||
#ifndef WINDOW_REGISTER_H
|
||||
#define WINDOW_REGISTER_H
|
||||
|
||||
#include "RegWindow.h"
|
||||
#include "gnc-ledger-display.h"
|
||||
|
||||
/** STRUCTS *********************************************************/
|
||||
typedef struct _RegWindow RegWindow;
|
||||
|
||||
/** PROTOTYPES ******************************************************/
|
||||
RegWindow * regWindowSimple(Account *account);
|
||||
RegWindow * regWindowAccGroup(Account *account_group);
|
||||
RegWindow * regWindowLedger(GNCLedgerDisplay *ledger);
|
||||
|
||||
void gnc_register_raise(RegWindow *regData);
|
||||
|
@ -36,11 +36,11 @@
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-html-history.h"
|
||||
#include "gnc-html.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "option-util.h"
|
||||
#include "query-user.h"
|
||||
#include "top-level.h"
|
||||
#include "window-main.h"
|
||||
#include "window-report.h"
|
||||
|
@ -48,6 +48,7 @@ INCLUDES = \
|
||||
-I${top_srcdir}/src/app-utils \
|
||||
-I${top_srcdir}/src/guile \
|
||||
-I${top_srcdir}/src/gnome \
|
||||
-I${top_srcdir}/src/gnome-utils \
|
||||
${GLIB_CFLAGS} \
|
||||
${GNOME_INCLUDEDIR} \
|
||||
${GUILE_INCS}
|
||||
|
@ -30,8 +30,8 @@
|
||||
#include "dialog-account-picker.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "druid-qif-import.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "query-user.h"
|
||||
|
||||
struct _accountpickerdialog {
|
||||
GtkWidget * dialog;
|
||||
|
@ -42,10 +42,10 @@
|
||||
#include "global-options.h"
|
||||
#include "gnc-component-manager.h"
|
||||
#include "gnc-engine-util.h"
|
||||
#include "gnc-gui-query.h"
|
||||
#include "gnc-ui-util.h"
|
||||
#include "gnc-ui.h"
|
||||
#include "messages.h"
|
||||
#include "query-user.h"
|
||||
#include "window-help.h"
|
||||
|
||||
#include <g-wrap-runtime-guile.h>
|
||||
|
@ -38,7 +38,14 @@ gnc_module_init(int refcount)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!gnc_module_load("gnucash/gnome-utils", 0))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gh_eval_str("(use-modules (gnucash import-export qif-import))");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@ -47,4 +54,3 @@ gnc_module_end(int refcount)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ libgncmod_ledger_core_la_SOURCES = \
|
||||
|
||||
noinst_HEADERS = \
|
||||
gnc-ledger-display.h \
|
||||
RegWindow.h \
|
||||
split-register.h \
|
||||
split-register-control.h \
|
||||
split-register-layout.h \
|
||||
|
@ -39,6 +39,10 @@ gnc_module_init(int refcount) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!gnc_module_load("gnucash/gnome-utils", 0)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gnc_register_add_cell_type (COMBO_CELL_TYPE_NAME, gnc_combo_cell_new);
|
||||
|
||||
gnc_register_add_cell_type (DATE_CELL_TYPE_NAME, gnc_date_cell_new);
|
||||
|
Loading…
Reference in New Issue
Block a user