Skip to content

Commit

Permalink
Add "template-account" to schedxaction as a gobject property.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@18807 57a11ea4-9604-0410-9ed3-97b8803252fd
  • Loading branch information
Phil Longstaff committed Mar 4, 2010
1 parent b417269 commit 2eaa834
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/engine/SchedXaction.c
Expand Up @@ -57,7 +57,8 @@ enum
PROP_START_DATE,
PROP_END_DATE,
PROP_LAST_OCCURANCE_DATE,
PROP_INSTANCE_COUNT
PROP_INSTANCE_COUNT,
PROP_TEMPLATE_ACCOUNT
};

/* GObject initialization */
Expand Down Expand Up @@ -143,6 +144,9 @@ gnc_schedxaction_get_property (GObject *object,
case PROP_INSTANCE_COUNT:
g_value_set_int(value, sx->instance_num);
break;
case PROP_TEMPLATE_ACCOUNT:
g_value_set_object(value, sx->template_acct);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand Down Expand Up @@ -207,6 +211,9 @@ gnc_schedxaction_set_property (GObject *object,
case PROP_INSTANCE_COUNT:
gnc_sx_set_instance_count(sx, g_value_get_int(value));
break;
case PROP_TEMPLATE_ACCOUNT:
sx_set_template_account(sx, g_value_get_object(value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
break;
Expand Down Expand Up @@ -345,6 +352,15 @@ gnc_schedxaction_class_init (SchedXactionClass *klass)
G_MAXINT16,
0,
G_PARAM_READWRITE));

g_object_class_install_property
(gobject_class,
PROP_TEMPLATE_ACCOUNT,
g_param_spec_object("template-account",
"Template account",
"Account which holds the template transactions.",
GNC_TYPE_ACCOUNT,
G_PARAM_READWRITE));
}

static void
Expand Down

0 comments on commit 2eaa834

Please sign in to comment.