|
|
|
|
@ -58,28 +58,7 @@
|
|
|
|
|
#include <libguile.h>
|
|
|
|
|
#include "dialog-utils.h"
|
|
|
|
|
|
|
|
|
|
static QofLogModule log_module = GNC_MOD_SX;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* TODO list:
|
|
|
|
|
*
|
|
|
|
|
* X alpha-necessary
|
|
|
|
|
* X fill out gnc-split-reg.h interface
|
|
|
|
|
* X calendar/date-picker
|
|
|
|
|
* . beta-necessary
|
|
|
|
|
* X date-inclusion on jumping
|
|
|
|
|
* . pass in, use number-of-lines
|
|
|
|
|
* . title-renaming in read-only case.
|
|
|
|
|
* X size-allocation
|
|
|
|
|
* X default schedule/recur handling for from-SX items.
|
|
|
|
|
* X handle destruction/cleanup more cleanly
|
|
|
|
|
* X conditional creation
|
|
|
|
|
* X handle widget-visibility callbacks
|
|
|
|
|
* X fix regWindow{Simple,Ledger,Account}
|
|
|
|
|
* X fix jumping-to-split
|
|
|
|
|
* X fix window-raising
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
|
|
// static QofLogModule log_module = GNC_MOD_SX;
|
|
|
|
|
|
|
|
|
|
/***** PROTOTYPES ***************************************************/
|
|
|
|
|
void gnc_split_reg_raise( GNCSplitReg *gsr );
|
|
|
|
|
@ -92,14 +71,9 @@ static void gnc_split_reg_determine_read_only( GNCSplitReg *gsr );
|
|
|
|
|
static GNCPlaceholderType gnc_split_reg_get_placeholder( GNCSplitReg *gsr );
|
|
|
|
|
static gncUIWidget gnc_split_reg_get_parent( GNCLedgerDisplay *ledger );
|
|
|
|
|
|
|
|
|
|
static void gsr_create_menus( GNCSplitReg *gsr );
|
|
|
|
|
static void gsr_setup_menu_widgets( GNCSplitReg *gsr, GladeXML *xml );
|
|
|
|
|
static void gsr_create_toolbar( GNCSplitReg *gsr );
|
|
|
|
|
static void gsr_create_table( GNCSplitReg *gsr );
|
|
|
|
|
static void gsr_setup_table( GNCSplitReg *gsr );
|
|
|
|
|
static void gsr_setup_status_widgets( GNCSplitReg *gsr );
|
|
|
|
|
static GtkWidget* gsr_create_popup_menu( GNCSplitReg *gsr );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void gsr_update_summary_label( GtkWidget *label,
|
|
|
|
|
xaccGetBalanceFn getter,
|
|
|
|
|
@ -339,16 +313,14 @@ GtkWidget*
|
|
|
|
|
gnc_split_reg_new( GNCLedgerDisplay *ld,
|
|
|
|
|
GtkWindow *parent,
|
|
|
|
|
gint numberOfLines,
|
|
|
|
|
gint createFlags,
|
|
|
|
|
gint disallowCaps )
|
|
|
|
|
gboolean read_only )
|
|
|
|
|
{
|
|
|
|
|
GNCSplitReg *gsrToRet;
|
|
|
|
|
|
|
|
|
|
gsrToRet = g_object_new( gnc_split_reg_get_type(), NULL );
|
|
|
|
|
|
|
|
|
|
gsrToRet->disallowedCaps = disallowCaps;
|
|
|
|
|
gsrToRet->numRows = numberOfLines;
|
|
|
|
|
gsrToRet->createFlags = createFlags;
|
|
|
|
|
gsrToRet->read_only = read_only;
|
|
|
|
|
|
|
|
|
|
gsrToRet->ledger = ld;
|
|
|
|
|
gsrToRet->window = GTK_WIDGET(parent);
|
|
|
|
|
@ -364,24 +336,10 @@ gnc_split_reg_init( GNCSplitReg *gsr )
|
|
|
|
|
gsr->sort_type = BY_STANDARD;
|
|
|
|
|
gsr->width = -1;
|
|
|
|
|
gsr->height = -1;
|
|
|
|
|
gsr->disallowedCaps = 0;
|
|
|
|
|
gsr->numRows = gnc_gconf_get_float(GCONF_GENERAL_REGISTER,
|
|
|
|
|
KEY_NUMBER_OF_ROWS, NULL);
|
|
|
|
|
gsr->read_only = FALSE;
|
|
|
|
|
|
|
|
|
|
/* IMPORTANT: If we set this to anything other than GTK_RESIZE_QUEUE, we
|
|
|
|
|
* enter into a very bad back-and-forth between the sheet and a containing
|
|
|
|
|
* GnomeDruid [in certain conditions and circumstances not detailed here],
|
|
|
|
|
* resulting in either a single iteration of the Druid resizing or infinite
|
|
|
|
|
* iterations of the Druid resizing without bound. Contact
|
|
|
|
|
* jsled@asynchronous.org for details. -- 2002.04.15
|
|
|
|
|
*/
|
|
|
|
|
/* This function call causes several problems in gnome2 port. I do
|
|
|
|
|
* not see any problems with the code when it is removed.
|
|
|
|
|
* hampton@employees.org -- 2003-10-06
|
|
|
|
|
*/
|
|
|
|
|
//gtk_container_set_resize_mode( GTK_CONTAINER(gsr), GTK_RESIZE_QUEUE );
|
|
|
|
|
|
|
|
|
|
g_signal_connect( gsr, "destroy",
|
|
|
|
|
G_CALLBACK (gnc_split_reg_destroy_cb), gsr );
|
|
|
|
|
}
|
|
|
|
|
@ -393,23 +351,10 @@ gnc_split_reg_init2( GNCSplitReg *gsr )
|
|
|
|
|
|
|
|
|
|
gnc_split_reg_determine_read_only( gsr );
|
|
|
|
|
|
|
|
|
|
if ( gsr->createFlags & CREATE_MENUS ) {
|
|
|
|
|
gsr_create_menus( gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->createFlags & CREATE_TOOLBAR ) {
|
|
|
|
|
gsr_create_toolbar( gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->createFlags & CREATE_SUMMARYBAR ) {
|
|
|
|
|
gsr_create_summary_bar( gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gsr_setup_status_widgets( gsr );
|
|
|
|
|
/* ordering is important here... setup_status before create_table */
|
|
|
|
|
gsr_create_table( gsr );
|
|
|
|
|
gsr_setup_table( gsr );
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
@ -418,13 +363,6 @@ gsr_setup_table( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
SplitRegister *sr;
|
|
|
|
|
|
|
|
|
|
if ( gsr->createFlags & CREATE_POPUP ) {
|
|
|
|
|
if ( !gsr->popup_menu ) {
|
|
|
|
|
gsr->popup_menu = gsr_create_popup_menu (gsr);
|
|
|
|
|
}
|
|
|
|
|
gnucash_register_attach_popup( gsr->reg, gsr->popup_menu, gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sr = gnc_ledger_display_get_split_register( gsr->ledger );
|
|
|
|
|
gnc_split_register_show_present_divider( sr, TRUE );
|
|
|
|
|
/* events should be sufficient to redraw this */
|
|
|
|
|
@ -432,91 +370,6 @@ gsr_setup_table( GNCSplitReg *gsr )
|
|
|
|
|
gnc_split_reg_refresh_toolbar( gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
gsr_create_menus( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
GladeXML *xml;
|
|
|
|
|
GtkWidget *mbar, *mi;
|
|
|
|
|
xml = gnc_glade_xml_new( "register.glade", "register_menubar" );
|
|
|
|
|
glade_xml_signal_autoconnect_full( xml,
|
|
|
|
|
gnc_glade_autoconnect_full_func,
|
|
|
|
|
gsr );
|
|
|
|
|
|
|
|
|
|
mbar = glade_xml_get_widget( xml, "register_menubar" );
|
|
|
|
|
gtk_widget_hide( mbar );
|
|
|
|
|
|
|
|
|
|
gsr->edit_menu = glade_xml_get_widget( xml, "menu_edit_menu" );
|
|
|
|
|
g_object_ref( gsr->edit_menu );
|
|
|
|
|
mi = glade_xml_get_widget( xml, "menu_edit" );
|
|
|
|
|
gtk_menu_item_remove_submenu( GTK_MENU_ITEM( mi ) );
|
|
|
|
|
|
|
|
|
|
gsr->view_menu = glade_xml_get_widget( xml, "menu_view_menu" );
|
|
|
|
|
g_object_ref( gsr->view_menu );
|
|
|
|
|
mi = glade_xml_get_widget( xml, "menu_view" );
|
|
|
|
|
gtk_menu_item_remove_submenu( GTK_MENU_ITEM(mi) );
|
|
|
|
|
|
|
|
|
|
gsr->style_submenu = glade_xml_get_widget( xml, "menu_style_menu" );
|
|
|
|
|
gsr->sort_submenu = glade_xml_get_widget( xml, "menu_sort_order_menu" );
|
|
|
|
|
|
|
|
|
|
gsr->action_menu = glade_xml_get_widget( xml, "menu_actions_menu" );
|
|
|
|
|
g_object_ref( gsr->action_menu );
|
|
|
|
|
mi = glade_xml_get_widget( xml, "menu_actions" );
|
|
|
|
|
gtk_menu_item_remove_submenu( GTK_MENU_ITEM(mi) );
|
|
|
|
|
|
|
|
|
|
gsr->double_line_check =
|
|
|
|
|
glade_xml_get_widget (xml, "menu_style_double_line");
|
|
|
|
|
gsr->split_menu_check =
|
|
|
|
|
glade_xml_get_widget (xml, "menu_splits");
|
|
|
|
|
|
|
|
|
|
gsr_setup_menu_widgets( gsr, xml );
|
|
|
|
|
|
|
|
|
|
/* we've ref'd the objects we need to. */
|
|
|
|
|
gtk_widget_destroy( mbar );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
gsr_create_toolbar( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
#if 0
|
|
|
|
|
GladeXML *xml;
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
SCM id;
|
|
|
|
|
|
|
|
|
|
xml = gnc_glade_xml_new( "register.glade", "toolbar" );
|
|
|
|
|
glade_xml_signal_autoconnect_full( xml,
|
|
|
|
|
gnc_glade_autoconnect_full_func,
|
|
|
|
|
gsr );
|
|
|
|
|
|
|
|
|
|
gsr->toolbar = glade_xml_get_widget( xml, "toolbar" );
|
|
|
|
|
gsr->split_button = glade_xml_get_widget( xml, "toolbar_split" );
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_DELETE ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "toolbar_delete" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_JUMP ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "toolbar_jump" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_SCHEDULE ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "toolbar_schedule" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gsr->read_only) {
|
|
|
|
|
widget = glade_xml_get_widget (xml, "toolbar_delete");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "toolbar_duplicate");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
gsr_create_table( GNCSplitReg *gsr )
|
|
|
|
|
@ -553,27 +406,12 @@ gsr_setup_status_widgets( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
SplitRegister *sr;
|
|
|
|
|
gboolean use_double_line;
|
|
|
|
|
GtkCheckMenuItem *check;
|
|
|
|
|
|
|
|
|
|
sr = gnc_ledger_display_get_split_register( gsr->ledger );
|
|
|
|
|
use_double_line = gnc_ledger_display_default_double_line( gsr->ledger );
|
|
|
|
|
|
|
|
|
|
/* be sure to initialize the gui elements associated with the cursor */
|
|
|
|
|
gnc_split_register_config( sr, sr->type, sr->style, use_double_line );
|
|
|
|
|
|
|
|
|
|
if ( ! (gsr->createFlags & CREATE_MENUS) ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
check = GTK_CHECK_MENU_ITEM( gsr->double_line_check );
|
|
|
|
|
|
|
|
|
|
g_signal_handlers_block_by_func( check,
|
|
|
|
|
gnc_split_reg_double_line_cb, gsr );
|
|
|
|
|
|
|
|
|
|
gtk_check_menu_item_set_active(check, use_double_line);
|
|
|
|
|
|
|
|
|
|
g_signal_handlers_unblock_by_func( check,
|
|
|
|
|
gnc_split_reg_double_line_cb, gsr );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
@ -1998,136 +1836,6 @@ gsr_create_summary_bar( GNCSplitReg *gsr )
|
|
|
|
|
return gsr->summarybar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
void
|
|
|
|
|
gsr_setup_menu_widgets(GNCSplitReg *gsr, GladeXML *xml)
|
|
|
|
|
{
|
|
|
|
|
/* Make sure the right style radio item is active */
|
|
|
|
|
SplitRegister *reg;
|
|
|
|
|
GtkWidget *widget;
|
|
|
|
|
char *widget_name;
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_DELETE ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "menu_delete" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_JUMP ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "menu_jump" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_SCHEDULE ) {
|
|
|
|
|
widget = glade_xml_get_widget( xml, "menu_schedule" );
|
|
|
|
|
gtk_widget_set_sensitive( widget, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (gsr->read_only) {
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_paste");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_cut_trans");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_paste_trans");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_delete");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_duplicate");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_reinitialize");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
widget = glade_xml_get_widget (xml, "menu_exchange");
|
|
|
|
|
gtk_widget_set_sensitive(widget, FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
reg = gnc_ledger_display_get_split_register( gsr->ledger );
|
|
|
|
|
|
|
|
|
|
switch (reg->style)
|
|
|
|
|
{
|
|
|
|
|
default:
|
|
|
|
|
case REG_STYLE_LEDGER:
|
|
|
|
|
widget_name = "menu_style_basic_ledger";
|
|
|
|
|
break;
|
|
|
|
|
case REG_STYLE_AUTO_LEDGER:
|
|
|
|
|
widget_name = "menu_style_auto_split_ledger";
|
|
|
|
|
break;
|
|
|
|
|
case REG_STYLE_JOURNAL:
|
|
|
|
|
widget_name = "menu_style_transaction_journal";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* registers with more than one account can only use journal mode */
|
|
|
|
|
if (reg->type >= NUM_SINGLE_REGISTER_TYPES)
|
|
|
|
|
{
|
|
|
|
|
widget = glade_xml_get_widget(xml, "menu_style_basic_ledger");
|
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
|
|
|
|
|
widget = glade_xml_get_widget(xml, "menu_style_auto_split_ledger");
|
|
|
|
|
gtk_widget_set_sensitive (widget, FALSE);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
widget = glade_xml_get_widget(xml, widget_name);
|
|
|
|
|
g_signal_handlers_block_matched(widget, G_SIGNAL_MATCH_DATA,
|
|
|
|
|
0, 0, NULL, NULL, gsr);
|
|
|
|
|
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), TRUE);
|
|
|
|
|
g_signal_handlers_unblock_matched(widget, G_SIGNAL_MATCH_DATA,
|
|
|
|
|
0, 0, NULL, NULL, gsr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static
|
|
|
|
|
GtkWidget *
|
|
|
|
|
gsr_create_popup_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *popup, *menuitem;
|
|
|
|
|
GladeXML *xml;
|
|
|
|
|
|
|
|
|
|
xml = gnc_glade_xml_new( "register.glade", "register_popup" );
|
|
|
|
|
popup = glade_xml_get_widget( xml, "register_popup" );
|
|
|
|
|
glade_xml_signal_autoconnect_full( xml,
|
|
|
|
|
gnc_glade_autoconnect_full_func,
|
|
|
|
|
gsr );
|
|
|
|
|
|
|
|
|
|
/* Glade insists on making this a tearoff menu. */
|
|
|
|
|
if (gnc_gconf_menus_have_tearoff()) {
|
|
|
|
|
GtkMenuShell *ms = GTK_MENU_SHELL(popup);
|
|
|
|
|
GtkWidget *tearoff;
|
|
|
|
|
|
|
|
|
|
tearoff = g_list_nth_data(ms->children, 0);
|
|
|
|
|
ms->children = g_list_remove(ms->children, tearoff);
|
|
|
|
|
gtk_widget_destroy(tearoff);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gsr->split_popup_check = glade_xml_get_widget( xml, "popup_splits" );
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_DELETE ) {
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_delete" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_JUMP ) {
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_jump" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_SCHEDULE ) {
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_schedule" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (gsr->read_only) {
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_delete" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_duplicate" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_reinitialize" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
menuitem = glade_xml_get_widget( xml, "sr_popup_exchange" );
|
|
|
|
|
gtk_widget_set_sensitive( menuitem, FALSE );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return popup;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Opens up a register window for a group of Accounts.
|
|
|
|
|
* @param gsr the register window instance
|
|
|
|
|
@ -2216,15 +1924,7 @@ gnc_split_reg_determine_read_only( GNCSplitReg *gsr )
|
|
|
|
|
dialog_args *args = g_malloc(sizeof(dialog_args));
|
|
|
|
|
SplitRegister *reg;
|
|
|
|
|
|
|
|
|
|
gsr->read_only = FALSE;
|
|
|
|
|
|
|
|
|
|
if ( gsr->disallowedCaps & CAP_READ_ONLY ) {
|
|
|
|
|
|
|
|
|
|
/* FIXME: this is not ideal, as whatever window-title solution we come up
|
|
|
|
|
* with should be used in this case as well. */
|
|
|
|
|
gsr->read_only = TRUE;
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
if ( !gsr->read_only ) {
|
|
|
|
|
|
|
|
|
|
switch (gnc_split_reg_get_placeholder(gsr)) {
|
|
|
|
|
case PLACEHOLDER_NONE:
|
|
|
|
|
@ -2315,48 +2015,6 @@ gnc_split_reg_set_sort_type( GNCSplitReg *gsr, SortType t )
|
|
|
|
|
gnc_split_reg_sort( gsr, t );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_edit_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->edit_menu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_view_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->view_menu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_style_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->style_submenu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_sort_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->sort_submenu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_action_menu( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->action_menu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_toolbar( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->toolbar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_summarybar( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
@ -2364,53 +2022,6 @@ gnc_split_reg_get_summarybar( GNCSplitReg *gsr )
|
|
|
|
|
return gsr->summarybar;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
|
gnc_split_reg_get_popup( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
if ( !gsr ) return NULL;
|
|
|
|
|
return gsr->popup_menu;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gnc_split_reg_set_split_state( GNCSplitReg *gsr, gboolean split )
|
|
|
|
|
{
|
|
|
|
|
g_assert( gsr );
|
|
|
|
|
/* FIXME */
|
|
|
|
|
PERR( "Unimplemented" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gnc_split_reg_set_double_line( GNCSplitReg *gsr, gboolean doubleLine )
|
|
|
|
|
{
|
|
|
|
|
g_assert( gsr );
|
|
|
|
|
/* FIXME */
|
|
|
|
|
PERR( "unimplemented" );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
gnc_split_reg_use_extended_popup( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
GtkWidget *popup, *tmpMenu, *tmpMI;
|
|
|
|
|
|
|
|
|
|
g_assert( gsr );
|
|
|
|
|
|
|
|
|
|
popup = gsr->popup_menu;
|
|
|
|
|
|
|
|
|
|
gtk_menu_shell_append( GTK_MENU_SHELL(popup), gtk_menu_item_new() );
|
|
|
|
|
|
|
|
|
|
tmpMenu = gnc_split_reg_get_edit_menu( gsr );
|
|
|
|
|
tmpMI = gtk_menu_item_new_with_label( N_("Edit") );
|
|
|
|
|
gtk_menu_item_set_submenu( GTK_MENU_ITEM(tmpMI), tmpMenu );
|
|
|
|
|
gtk_menu_shell_append( GTK_MENU_SHELL(popup), tmpMI );
|
|
|
|
|
|
|
|
|
|
tmpMenu = gnc_split_reg_get_view_menu( gsr );
|
|
|
|
|
tmpMI = gtk_menu_item_new_with_label( N_("View") );
|
|
|
|
|
gtk_menu_item_set_submenu( GTK_MENU_ITEM(tmpMI), tmpMenu );
|
|
|
|
|
gtk_menu_shell_append( GTK_MENU_SHELL(popup), tmpMI );
|
|
|
|
|
|
|
|
|
|
gtk_widget_show_all( popup );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
gboolean
|
|
|
|
|
gnc_split_reg_get_read_only( GNCSplitReg *gsr )
|
|
|
|
|
{
|
|
|
|
|
|