Re: [GNC-dev] Co-Owner (v0.3.3)

Robert Fewell <[email protected]>
Newsgroups gmane.comp.gnome.apps.gnucash.devel
Message-ID <CAMY+hkvhOBkhYhki9SXcFSjTrABmnbRh-2QXT=C=bU1krDnhsg@mail.gmail.com>
Ralf,
I have had a look and was able to pull your branch and build it but needed
to replace the de.po file with one from maint but that is besides the point.

I have added a patch file with some changes I have noticed but you will
need to fix / test them.
I am not sure whether you have changed dialog-customer.glade by mistake or
in the middle of a change but there were some changes to coowner.

As for the menus, they are present and the Co-Owner Overview page displays
but I could not create a new Co-Owner due to issues with the glade files.

Regards,
Bob

On Thu, 30 Jun 2022 at 14:03, Ralf Zerres <[email protected]> wrote:

> Rob,
>
> thanks for anwering. And yes, i do have a specific problem.
> It's more a comprehension problem when creating new menu entries.
>
> What i extended
> ===============
>
> This is an extact just to explain the involed gui stuff:
>
>
> inside  "gnucash/gnome/gnc-plugin-business.c" i did create new/needed
>  "BusinessActions"
>
>  /* Co-Owner submenu */
>  { "CoOwnerMenuAction", NULL, N_("Co-Owner"), NULL, NULL, NULL },
>
>  {
>         "CoOwnerOverviewPageAction", NULL, N_("Co-Owners
> Overview"),NULL,
>         N_("Open a Co-Owner overview page"),
>         G_CALLBACK (gnc_plugin_business_cmd_coowner_page)
>     },
>
> ...
>
> {
>         "CoOwnerNewSettlementOpenAction", NULL, N_("New
> _Settlement..."), NULL,
>         N_("Open the New Settlement dialog"),
>         G_CALLBACK (gnc_plugin_business_cmd_coowner_new_settlement)
>     },
>
> As well as the associated callbacks.
>
> UI definitions are in
>
> * gnucash/ui/gnc-plugin-business-ui.xml
>
> that introduce a new menu "CoOwnerMenuAction" with menuitems
> "COOwnerNewCoOwnerOpenAction", etc. They extend the given placeholder
> "AdditionalMenusPlacehoder" inside menu "Business". Fine until here.
>
> The book handling will use "Set" and "Get" functions from
>  "libgnucash/engine/gncCoOwner.c". To make that accessible, funtions in
> "libgnucash/engine/gncOwner.c" are extended to handle the CoOwner
> cases. That means, we now handle a new "owner->type =
> GNC_OWNER_COOWNER".
>
> Bindings have been enhanced
>
> * bindings/business-core.i
> * bindings/python/gnucash_business.py
> * bindings/python/gnucash_core.i
>
> Next i had to extend the "OT" actions to have the needed new callbacks
> for the owner_tree.
>
> * gnucash/gnome/gnc-plugin-page-owner-tree.c
> * gnc-plugin-page-owner-tree-ui.xml
>
> This should make them accessible as "plugin-page"-s, right?
>
> conlusion
> =========
>
> All that stuff compiles.
> But i never see any new submenu entry "CoOwner" nor do i get the GUI
> for the Owner-Tree stuff.
> I'm on arch, all the depends like in "util/ci/actions/archlinux-
> test/Dockerfile".
>
> What is needed to make the subsystem use the new Menus?
>
> Greetings
> Ralf
>
> PS: you will find my coowner branch at
> https://github.com/rzerres/gnucash/tree/coowner
>
> Am Donnerstag, dem 30.06.2022 um 08:39 +0100 schrieb Robert Fewell:
> > Ralf,
> > The current minimum Gtk3 version is 3.22.30. All the glade files have
> > been generated with Glade 3.38.2 with the minimum Gtk version set to
> > 3.22.
> >
> > Is there a specific problem you have found that you need help with?
> >
> > Regards,
> > Bob
> >
> > >
>

_______________________________________________
gnucash-devel mailing list
[email protected]
https://lists.gnucash.org/mailman/listinfo/gnucash-devel
0001-changes.patch (text/x-patch, 9 KB)
diff --git a/gnucash/gnome/dialog-coowner.c b/gnucash/gnome/dialog-coowner.c
index 18fb14fc4..7bc509537 100644
--- a/gnucash/gnome/dialog-coowner.c
+++ b/gnucash/gnome/dialog-coowner.c
@@ -596,8 +596,9 @@ gnc_coowner_new_window (GtkWindow *parent,
 
     /* Find the dialog */
     builder = gtk_builder_new();
-    gnc_builder_add_from_file (builder, "dialog-coowner.glade", "taxincluded_store");
+    gnc_builder_add_from_file (builder, "dialog-coowner.glade", "tax_included_store");
     gnc_builder_add_from_file (builder, "dialog-coowner.glade", "taxtable_store");
+    gnc_builder_add_from_file (builder, "dialog-coowner.glade", "terms_store");
     gnc_builder_add_from_file (builder, "dialog-coowner.glade", "coowner_dialog");
     ow->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "coowner_dialog"));
     gtk_window_set_transient_for (GTK_WINDOW(ow->dialog), parent);
@@ -633,17 +634,17 @@ gnc_coowner_new_window (GtkWindow *parent,
     ow->apt_share = edit;
     gtk_widget_show (edit);
 
-    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "apt_share_box"));
-    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);
+//FIXME     hbox = GTK_WIDGET(gtk_builder_get_object (builder, "apt_share_box")); //apt_share_box missing
+//FIXME     gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);
 
     /* Property unit value */
-    ow->property_unit = GTK_WIDGET(gtk_builder_get_object (builder, "property_unit"));
+//FIXME     ow->property_unit = GTK_WIDGET(gtk_builder_get_object (builder, "property_unit")); //propert_unit missing
 
-    ow->distribution_key = GTK_WIDGET(gtk_builder_get_object (builder, "distribution_key"));
+//FIXME    ow->distribution_key = GTK_WIDGET(gtk_builder_get_object (builder, "distribution_key")); //distribution_key missing
 
 
     /* Language */
-    ow->language_entry = GTK_WIDGET(gtk_builder_get_object (builder, "language_entry"));
+//FIXME    ow->language_entry = GTK_WIDGET(gtk_builder_get_object (builder, "language_entry")); //language_entry missing
 
     /* Credit: Monetary Value */
     edit = gnc_amount_edit_new();
@@ -670,8 +671,8 @@ gnc_coowner_new_window (GtkWindow *parent,
     ow->ccard_acct_sel = edit;
     gtk_widget_show (edit);
 
-    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "ccard_acct_hbox"));
-    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);
+//FIXME    hbox = GTK_WIDGET(gtk_builder_get_object (builder, "ccard_acct_hbox")); // ccard_acct_hbox missing
+//    gtk_box_pack_start (GTK_BOX (hbox), edit, TRUE, TRUE, 0);
 
     /* Currency */
     edit = gnc_currency_edit_new();
@@ -708,6 +709,8 @@ gnc_coowner_new_window (GtkWindow *parent,
     /* Username  */
     ow->username_entry = GTK_WIDGET(gtk_builder_get_object (builder, "username_entry"));
 
+//FIXME no call backs for the shipping address.
+
     /* Setup signals */
     gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, ow);
 
@@ -804,16 +807,17 @@ gnc_coowner_new_window (GtkWindow *parent,
 
     /* Set Credit-Card entities */
     ccard_acct = gncCoOwnerGetCCard (coowner);
-    if (ccard_acct == NULL)
-    {
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ow->ccard_acct_check), FALSE);
-        gtk_widget_set_sensitive (ow->ccard_acct_sel, FALSE);
-    }
-    else
-    {
-        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ow->ccard_acct_check), TRUE);
-        gnc_account_sel_set_account (GNC_ACCOUNT_SEL (ow->ccard_acct_sel), ccard_acct, FALSE);
-    }
+//FIXME see above
+//    if (ccard_acct == NULL)
+//    {
+//        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ow->ccard_acct_check), FALSE);
+//        gtk_widget_set_sensitive (ow->ccard_acct_sel, FALSE);
+//    }
+//    else
+//    {
+//        gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (ow->ccard_acct_check), TRUE);
+//        gnc_account_sel_set_account (GNC_ACCOUNT_SEL (ow->ccard_acct_sel), ccard_acct, FALSE);
+//    }
 
     /* Set billing terms */
     gnc_billterms_combo (GTK_COMBO_BOX(ow->terms_menu), bookp, TRUE, ow->terms);
diff --git a/gnucash/gnome/gnc-plugin-business.c b/gnucash/gnome/gnc-plugin-business.c
index f0a9f92b4..ab91f91f9 100644
--- a/gnucash/gnome/gnc-plugin-business.c
+++ b/gnucash/gnome/gnc-plugin-business.c
@@ -210,6 +210,11 @@ static GtkActionEntry gnc_plugin_actions [] =
         N_("Open the New Co-Owner dialog"),
         G_CALLBACK (gnc_plugin_business_cmd_coowner_new_coowner)
     },
+    {
+        "CoOwnerFindInvoiceOpenAction", NULL, N_("Find In_voice..."), NULL,
+        N_("Open the Find Invoice dialog"),
+        G_CALLBACK (gnc_plugin_business_cmd_coowner_find_invoice)
+    },
     {
         "CoOwnerNewInvoiceOpenAction", NULL, N_("New In_voice..."), NULL,
         N_("Open the New Invoice dialog"),
diff --git a/gnucash/gtkbuilder/dialog-customer.glade b/gnucash/gtkbuilder/dialog-customer.glade
index 76833508c..7f0bf4054 100644
--- a/gnucash/gtkbuilder/dialog-customer.glade
+++ b/gnucash/gtkbuilder/dialog-customer.glade
@@ -130,7 +130,7 @@
                             <property name="visible">True</property>
                             <property name="can-focus">False</property>
                             <property name="halign">end</property>
-                            <property name="label" translatable="yes">Coowner Number</property>
+                            <property name="label" translatable="yes">Customer Number</property>
                             <property name="justify">right</property>
                           </object>
                           <packing>
@@ -478,7 +478,7 @@
               <object class="GtkLabel" id="label9">
                 <property name="visible">True</property>
                 <property name="can-focus">False</property>
-                <property name="label" translatable="yes">Coowner</property>
+                <property name="label" translatable="yes">Customer</property>
                 <property name="justify">center</property>
               </object>
               <packing>
@@ -877,7 +877,7 @@
                             <property name="hexpand">True</property>
                             <property name="activates-default">True</property>
                             <signal name="insert-text" handler="gnc_coowner_shipaddr4_insert_cb" swapped="no"/>
-                            <signal name="key-press-event" handler="gnc_coowner_shipaddr4_key_press_cb" swapped="no"/>
+                            <signal name="key-press-event" handler="gnc_customer_shipaddr4_key_press_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="left-attach">1</property>
@@ -891,7 +891,7 @@
                             <property name="hexpand">True</property>
                             <property name="activates-default">True</property>
                             <signal name="insert-text" handler="gnc_coowner_shipaddr3_insert_cb" swapped="no"/>
-                            <signal name="key-press-event" handler="gnc_coowner_shipaddr3_key_press_cb" swapped="no"/>
+                            <signal name="key-press-event" handler="gnc_customer_shipaddr3_key_press_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="left-attach">1</property>
@@ -905,7 +905,7 @@
                             <property name="hexpand">True</property>
                             <property name="activates-default">True</property>
                             <signal name="insert-text" handler="gnc_coowner_shipaddr2_insert_cb" swapped="no"/>
-                            <signal name="key-press-event" handler="gnc_coowner_shipaddr2_key_press_cb" swapped="no"/>
+                            <signal name="key-press-event" handler="gnc_customer_shipaddr2_key_press_cb" swapped="no"/>
                           </object>
                           <packing>
                             <property name="left-attach">1</property>
diff --git a/libgnucash/engine/cashobjects.c b/libgnucash/engine/cashobjects.c
index f971648af..39ba3bc9f 100644
--- a/libgnucash/engine/cashobjects.c
+++ b/libgnucash/engine/cashobjects.c
@@ -54,14 +54,14 @@ static void
 business_core_init(void)
 {
     /* initialize known types */
-    gncAddressRegister ();
+    gncInvoiceRegister ();
+    gncJobRegister ();
     gncBillTermRegister ();
     gncCoOwnerRegister ();
     gncCustomerRegister ();
+    gncAddressRegister ();
     gncEmployeeRegister ();
     gncEntryRegister ();
-    gncInvoiceRegister ();
-    gncJobRegister ();
     gncOrderRegister ();
     gncOwnerRegister ();
     gncTaxTableRegister ();
diff --git a/libgnucash/engine/gncAddress.c b/libgnucash/engine/gncAddress.c
index dbe034b91..468370714 100644
--- a/libgnucash/engine/gncAddress.c
+++ b/libgnucash/engine/gncAddress.c
@@ -696,7 +696,7 @@ gboolean gncAddressRegister (void)
     };
 
     qof_class_register (GNC_ID_ADDRESS, (QofSortFunc)gncAddressCompare, params);
-    if (!qof_choice_add_class(GNC_ID_COOWNER, GNC_ID_ADDRESS, ADDRESS_OWNER))
+    if (!qof_choice_add_class (GNC_ID_COOWNER, GNC_ID_ADDRESS, ADDRESS_OWNER))
     {
         return FALSE;
     }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.