Reorganize menus in the register window.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@6977 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton 2002-06-18 17:47:51 +00:00
parent 5c3ba03796
commit 4ef5bd9cfb
7 changed files with 2218 additions and 912 deletions

View File

@ -1,3 +1,15 @@
2002-06-18 David Hampton <hampton@employees.org>
* src/gnome/window-main.c: Make a couple of functions globally
visible.
* src/gnome/window-register.c:
* src/gnome/glade/register.glade: Reorganize the menus in the
register window. Convert the register window over to a glade
based window using glade_xml_signal_autoconnect. Rename a bunch
of short named function to the form gnc_register_xxx to insure
uniqueness.
2002-06-16 Derek Atkins <derek@ihtfp.com> 2002-06-16 Derek Atkins <derek@ihtfp.com>
* Refactor a lot of the business code. Move the tax-table dialog * Refactor a lot of the business code. Move the tax-table dialog

View File

@ -26,6 +26,7 @@
#include <glade/glade.h> #include <glade/glade.h>
#include <gnome.h> #include <gnome.h>
#include <gmodule.h>
#include "dialog-utils.h" #include "dialog-utils.h"
#include "global-options.h" #include "global-options.h"
@ -1042,6 +1043,48 @@ gnc_glade_lookup_widget (GtkWidget *widget, const char *name)
return glade_xml_get_widget (xml, name); return glade_xml_get_widget (xml, name);
} }
/*
* The following function is built from a couple of glade functions.
*/
GModule *allsymbols = NULL;
void
gnc_glade_autoconnect_full_func(const gchar *handler_name,
GtkObject *signal_object,
const gchar *signal_name,
const gchar *signal_data,
GtkObject *other_object,
gboolean signal_after,
gpointer user_data)
{
GtkSignalFunc func;
if (allsymbols == NULL) {
/* get a handle on the main executable -- use this to find symbols */
allsymbols = g_module_open(NULL, 0);
}
if (!g_module_symbol(allsymbols, handler_name, (gpointer *)&func)) {
g_warning("could not find signal handler '%s'.", handler_name);
return;
}
if (other_object) {
if (signal_after)
gtk_signal_connect_object_after(signal_object, signal_name, func,
other_object);
else
gtk_signal_connect_object(signal_object, signal_name, func,
other_object);
} else {
if (signal_after)
gtk_signal_connect_after(signal_object, signal_name, func, user_data);
else
gtk_signal_connect(signal_object, signal_name, func, user_data);
}
}
gint gint
gnc_mbstowcs (GdkWChar **dest_p, const char *src) gnc_mbstowcs (GdkWChar **dest_p, const char *src)
{ {

View File

@ -96,7 +96,13 @@ void gnc_clist_columns_autosize (GtkCList *list);
GladeXML * gnc_glade_xml_new (const char *filename, const char *root); GladeXML * gnc_glade_xml_new (const char *filename, const char *root);
GtkWidget * gnc_glade_lookup_widget (GtkWidget *widget, const char *name); GtkWidget * gnc_glade_lookup_widget (GtkWidget *widget, const char *name);
void gnc_glade_autoconnect_full_func(const gchar *handler_name,
GtkObject *signal_object,
const gchar *signal_name,
const gchar *signal_data,
GtkObject *connect_object,
gboolean after,
gpointer user_data);
/* Multibyte/wide char string helper functions. */ /* Multibyte/wide char string helper functions. */

File diff suppressed because it is too large Load Diff

View File

@ -504,14 +504,14 @@ gnc_main_window_file_open_cb(GtkWidget * widget, gpointer data)
gnc_refresh_main_window_info (); gnc_refresh_main_window_info ();
} }
static void void
gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data) gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data)
{ {
gnc_file_save (); gnc_file_save ();
gnc_refresh_main_window_info (); gnc_refresh_main_window_info ();
} }
static void void
gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data) gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data)
{ {
gnc_file_save_as (); gnc_file_save_as ();
@ -729,7 +729,7 @@ gnc_main_window_sched_xaction_slr_cb (GtkWidget *widget, gpointer data) {
} }
} }
static void void
gnc_main_window_about_cb (GtkWidget *widget, gpointer data) gnc_main_window_about_cb (GtkWidget *widget, gpointer data)
{ {
GtkWidget *about; GtkWidget *about;
@ -763,7 +763,7 @@ gnc_main_window_commodities_cb(GtkWidget *widget, gpointer data) {
} }
static void void
gnc_main_window_totd_cb (GtkWidget *widget, gpointer data) gnc_main_window_totd_cb (GtkWidget *widget, gpointer data)
{ {
@ -771,13 +771,13 @@ gnc_main_window_totd_cb (GtkWidget *widget, gpointer data)
return; return;
} }
static void void
gnc_main_window_help_cb (GtkWidget *widget, gpointer data) gnc_main_window_help_cb (GtkWidget *widget, gpointer data)
{ {
helpWindow(NULL, NULL, HH_MAIN); helpWindow(NULL, NULL, HH_MAIN);
} }
static void void
gnc_main_window_exit_cb (GtkWidget *widget, gpointer data) gnc_main_window_exit_cb (GtkWidget *widget, gpointer data)
{ {
gnc_shutdown(0); gnc_shutdown(0);

View File

@ -28,4 +28,13 @@
GNCMDIInfo * gnc_main_window_new (void); GNCMDIInfo * gnc_main_window_new (void);
/*
* Functions used as callbacks from multiple dialogs.
*/
void gnc_main_window_about_cb (GtkWidget *widget, gpointer data);
void gnc_main_window_file_save_cb(GtkWidget * widget, gpointer data);
void gnc_main_window_file_save_as_cb(GtkWidget * widget, gpointer data);
void gnc_main_window_totd_cb (GtkWidget *widget, gpointer data);
void gnc_main_window_help_cb (GtkWidget *widget, gpointer data);
#endif #endif

File diff suppressed because it is too large Load Diff