mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
More work on stock split druid.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@3557 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
e59e0c71b7
commit
935c8640ea
@ -4473,7 +4473,7 @@ xaccSRLoadRegister (SplitRegister *reg, GList * slist,
|
||||
Split *find_split;
|
||||
Split *split;
|
||||
Table *table;
|
||||
GList *gsplit;
|
||||
GList *node;
|
||||
|
||||
gboolean start_primary_color = TRUE;
|
||||
gboolean found_pending = FALSE;
|
||||
@ -4612,9 +4612,9 @@ xaccSRLoadRegister (SplitRegister *reg, GList * slist,
|
||||
trans_table = g_hash_table_new (g_direct_hash, g_direct_equal);
|
||||
|
||||
/* populate the table */
|
||||
for (gsplit = slist; gsplit; gsplit = gsplit->next)
|
||||
for (node = slist; node; node = node->next)
|
||||
{
|
||||
split = gsplit->data;
|
||||
split = node->data;
|
||||
trans = xaccSplitGetParent (split);
|
||||
|
||||
if (pending_trans == trans)
|
||||
|
@ -94,12 +94,17 @@ fill_account_list (StockSplitInfo *info)
|
||||
Account *account = node->data;
|
||||
GNCPrintAmountInfo print_info;
|
||||
const gnc_commodity *security;
|
||||
gnc_numeric balance;
|
||||
char *strings[4];
|
||||
gint row;
|
||||
|
||||
if (xaccAccountGetType (account) != STOCK)
|
||||
continue;
|
||||
|
||||
balance = xaccAccountGetShareBalance (account);
|
||||
if (gnc_numeric_zero_p (balance))
|
||||
continue;
|
||||
|
||||
security = xaccAccountGetSecurity (account);
|
||||
|
||||
print_info = gnc_account_quantity_print_info (account, FALSE);
|
||||
@ -107,8 +112,7 @@ fill_account_list (StockSplitInfo *info)
|
||||
strings[0] = xaccAccountGetFullName (account,
|
||||
gnc_get_account_separator ());
|
||||
strings[1] = (char *) gnc_commodity_get_mnemonic (security);
|
||||
strings[2] = (char *)
|
||||
xaccPrintAmount (xaccAccountGetShareBalance (account), print_info);
|
||||
strings[2] = (char *) xaccPrintAmount (balance, print_info);
|
||||
strings[3] = NULL;
|
||||
|
||||
row = gtk_clist_append (clist, strings);
|
||||
@ -173,7 +177,7 @@ refresh_details_page (StockSplitInfo *info)
|
||||
g_free (name);
|
||||
|
||||
amount = xaccAccountGetShareBalance (account);
|
||||
print_info = gnc_account_quantity_print_info (account, TRUE);
|
||||
print_info = gnc_account_quantity_print_info (account, FALSE);
|
||||
|
||||
amount_str = xaccPrintAmount(amount, print_info);
|
||||
gtk_entry_set_text (GTK_ENTRY (info->starting_entry), amount_str);
|
||||
|
@ -5896,6 +5896,20 @@ create_Stock_Split_Druid (void)
|
||||
GdkColor extra_page_logo_bg_color = { 0, 65535, 65535, 65535 };
|
||||
GdkColor extra_page_title_color = { 0, 65535, 65535, 65535 };
|
||||
GtkWidget *druid_vbox33;
|
||||
GtkWidget *label847687;
|
||||
GtkWidget *vbox102;
|
||||
GtkWidget *hbox87;
|
||||
GtkWidget *vbox103;
|
||||
GtkWidget *label847688;
|
||||
GtkWidget *label847689;
|
||||
GtkWidget *vbox104;
|
||||
GtkWidget *amount_box;
|
||||
GtkWidget *entry1;
|
||||
GtkWidget *hbox88;
|
||||
GtkWidget *frame43;
|
||||
GtkWidget *income_scroll;
|
||||
GtkWidget *frame44;
|
||||
GtkWidget *asset_scroll;
|
||||
GtkWidget *druidpagefinish1;
|
||||
GdkColor druidpagefinish1_bg_color = { 0, 6425, 6425, 28784 };
|
||||
GdkColor druidpagefinish1_textbox_color = { 0, 65535, 65535, 65535 };
|
||||
@ -6140,12 +6154,118 @@ create_Stock_Split_Druid (void)
|
||||
gnome_druid_page_standard_set_bg_color (GNOME_DRUID_PAGE_STANDARD (extra_page), &extra_page_bg_color);
|
||||
gnome_druid_page_standard_set_logo_bg_color (GNOME_DRUID_PAGE_STANDARD (extra_page), &extra_page_logo_bg_color);
|
||||
gnome_druid_page_standard_set_title_color (GNOME_DRUID_PAGE_STANDARD (extra_page), &extra_page_title_color);
|
||||
gnome_druid_page_standard_set_title (GNOME_DRUID_PAGE_STANDARD (extra_page), _("Cash Disbursement"));
|
||||
|
||||
druid_vbox33 = GNOME_DRUID_PAGE_STANDARD (extra_page)->vbox;
|
||||
gtk_widget_ref (druid_vbox33);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "druid_vbox33", druid_vbox33,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (druid_vbox33);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (druid_vbox33), 5);
|
||||
|
||||
label847687 = gtk_label_new (_("If you received a cash disbursement as a result of the stock split,\nenter the details of that payment here. Otherwise, just click `Next'."));
|
||||
gtk_widget_ref (label847687);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847687", label847687,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label847687);
|
||||
gtk_box_pack_start (GTK_BOX (druid_vbox33), label847687, FALSE, FALSE, 0);
|
||||
gtk_label_set_justify (GTK_LABEL (label847687), GTK_JUSTIFY_LEFT);
|
||||
|
||||
vbox102 = gtk_vbox_new (FALSE, 8);
|
||||
gtk_widget_ref (vbox102);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "vbox102", vbox102,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (vbox102);
|
||||
gtk_box_pack_start (GTK_BOX (druid_vbox33), vbox102, TRUE, TRUE, 0);
|
||||
gtk_container_set_border_width (GTK_CONTAINER (vbox102), 5);
|
||||
|
||||
hbox87 = gtk_hbox_new (FALSE, 2);
|
||||
gtk_widget_ref (hbox87);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "hbox87", hbox87,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hbox87);
|
||||
gtk_box_pack_start (GTK_BOX (vbox102), hbox87, FALSE, FALSE, 0);
|
||||
|
||||
vbox103 = gtk_vbox_new (TRUE, 2);
|
||||
gtk_widget_ref (vbox103);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "vbox103", vbox103,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (vbox103);
|
||||
gtk_box_pack_start (GTK_BOX (hbox87), vbox103, FALSE, FALSE, 0);
|
||||
|
||||
label847688 = gtk_label_new (_("Amount:"));
|
||||
gtk_widget_ref (label847688);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847688", label847688,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label847688);
|
||||
gtk_box_pack_start (GTK_BOX (vbox103), label847688, FALSE, FALSE, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label847688), 1, 0.5);
|
||||
|
||||
label847689 = gtk_label_new (_("Description:"));
|
||||
gtk_widget_ref (label847689);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "label847689", label847689,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (label847689);
|
||||
gtk_box_pack_start (GTK_BOX (vbox103), label847689, FALSE, FALSE, 0);
|
||||
gtk_misc_set_alignment (GTK_MISC (label847689), 1, 0.5);
|
||||
|
||||
vbox104 = gtk_vbox_new (TRUE, 2);
|
||||
gtk_widget_ref (vbox104);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "vbox104", vbox104,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (vbox104);
|
||||
gtk_box_pack_start (GTK_BOX (hbox87), vbox104, TRUE, TRUE, 0);
|
||||
|
||||
amount_box = gtk_hbox_new (FALSE, 0);
|
||||
gtk_widget_ref (amount_box);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "amount_box", amount_box,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (amount_box);
|
||||
gtk_box_pack_start (GTK_BOX (vbox104), amount_box, FALSE, FALSE, 0);
|
||||
|
||||
entry1 = gtk_entry_new ();
|
||||
gtk_widget_ref (entry1);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "entry1", entry1,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (entry1);
|
||||
gtk_box_pack_start (GTK_BOX (vbox104), entry1, FALSE, FALSE, 0);
|
||||
|
||||
hbox88 = gtk_hbox_new (TRUE, 2);
|
||||
gtk_widget_ref (hbox88);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "hbox88", hbox88,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (hbox88);
|
||||
gtk_box_pack_start (GTK_BOX (vbox102), hbox88, TRUE, TRUE, 0);
|
||||
|
||||
frame43 = gtk_frame_new (_("Income Account"));
|
||||
gtk_widget_ref (frame43);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "frame43", frame43,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame43);
|
||||
gtk_box_pack_start (GTK_BOX (hbox88), frame43, TRUE, TRUE, 0);
|
||||
|
||||
income_scroll = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_ref (income_scroll);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "income_scroll", income_scroll,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (income_scroll);
|
||||
gtk_container_add (GTK_CONTAINER (frame43), income_scroll);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (income_scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
frame44 = gtk_frame_new (_("Asset Account"));
|
||||
gtk_widget_ref (frame44);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "frame44", frame44,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (frame44);
|
||||
gtk_box_pack_start (GTK_BOX (hbox88), frame44, TRUE, TRUE, 0);
|
||||
|
||||
asset_scroll = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_ref (asset_scroll);
|
||||
gtk_object_set_data_full (GTK_OBJECT (Stock_Split_Druid), "asset_scroll", asset_scroll,
|
||||
(GtkDestroyNotify) gtk_widget_unref);
|
||||
gtk_widget_show (asset_scroll);
|
||||
gtk_container_add (GTK_CONTAINER (frame44), asset_scroll);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (asset_scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
|
||||
druidpagefinish1 = gnome_druid_page_finish_new ();
|
||||
gtk_widget_ref (druidpagefinish1);
|
||||
|
@ -8986,7 +8986,7 @@ words.
|
||||
<widget>
|
||||
<class>GnomeDruidPageStandard</class>
|
||||
<name>extra_page</name>
|
||||
<title></title>
|
||||
<title>Cash Disbursement</title>
|
||||
<title_color>255,255,255</title_color>
|
||||
<background_color>25,25,112</background_color>
|
||||
<logo_background_color>255,255,255</logo_background_color>
|
||||
@ -8995,6 +8995,7 @@ words.
|
||||
<class>GtkVBox</class>
|
||||
<child_name>GnomeDruidPageStandard:vbox</child_name>
|
||||
<name>druid-vbox33</name>
|
||||
<border_width>5</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
@ -9004,7 +9005,199 @@ words.
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
<class>GtkLabel</class>
|
||||
<name>label847687</name>
|
||||
<label>If you received a cash disbursement as a result of the stock split,
|
||||
enter the details of that payment here. Otherwise, just click `Next'.</label>
|
||||
<justify>GTK_JUSTIFY_LEFT</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>0.5</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox102</name>
|
||||
<border_width>5</border_width>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>8</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox87</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox103</name>
|
||||
<homogeneous>True</homogeneous>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label847688</name>
|
||||
<label>Amount:</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkLabel</class>
|
||||
<name>label847689</name>
|
||||
<label>Description:</label>
|
||||
<justify>GTK_JUSTIFY_CENTER</justify>
|
||||
<wrap>False</wrap>
|
||||
<xalign>1</xalign>
|
||||
<yalign>0.5</yalign>
|
||||
<xpad>0</xpad>
|
||||
<ypad>0</ypad>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkVBox</class>
|
||||
<name>vbox104</name>
|
||||
<homogeneous>True</homogeneous>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>amount_box</name>
|
||||
<homogeneous>False</homogeneous>
|
||||
<spacing>0</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkEntry</class>
|
||||
<name>entry1</name>
|
||||
<can_focus>True</can_focus>
|
||||
<editable>True</editable>
|
||||
<text_visible>True</text_visible>
|
||||
<text_max_length>0</text_max_length>
|
||||
<text></text>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>False</expand>
|
||||
<fill>False</fill>
|
||||
</child>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkHBox</class>
|
||||
<name>hbox88</name>
|
||||
<homogeneous>True</homogeneous>
|
||||
<spacing>2</spacing>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame43</name>
|
||||
<label>Income Account</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>income_scroll</name>
|
||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
||||
<widget>
|
||||
<class>GtkFrame</class>
|
||||
<name>frame44</name>
|
||||
<label>Asset Account</label>
|
||||
<label_xalign>0</label_xalign>
|
||||
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
|
||||
<child>
|
||||
<padding>0</padding>
|
||||
<expand>True</expand>
|
||||
<fill>True</fill>
|
||||
</child>
|
||||
|
||||
<widget>
|
||||
<class>GtkScrolledWindow</class>
|
||||
<name>asset_scroll</name>
|
||||
<hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
|
||||
<vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
|
||||
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
|
||||
<vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
|
||||
|
||||
<widget>
|
||||
<class>Placeholder</class>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
|
Loading…
Reference in New Issue
Block a user