gnucash stable: Multiple changes pushed
Robert Fewell
bobit at code.gnucash.org
Fri Jan 24 09:49:47 EST 2025
Updated via https://github.com/Gnucash/gnucash/commit/55465e88 (commit)
via https://github.com/Gnucash/gnucash/commit/8795233a (commit)
via https://github.com/Gnucash/gnucash/commit/4fc3a0cb (commit)
via https://github.com/Gnucash/gnucash/commit/71583f60 (commit)
via https://github.com/Gnucash/gnucash/commit/99f067ff (commit)
from https://github.com/Gnucash/gnucash/commit/f6c73b15 (commit)
commit 55465e88ed33ba3ecb9a08cc4c6decb52182372e
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Jan 24 12:27:44 2025 +0000
Add function to GncQueryView to expand column
Add function gnc_query_set_expand_column to GncQueryView so that the
expand column can be specified that takes up any available free space.
Use this function in the Due Bills/Invoice Reminder to to set the
expanding column to the company name.
diff --git a/gnucash/gnome-utils/dialog-query-view.c b/gnucash/gnome-utils/dialog-query-view.c
index 56f01eaf14..c22a2bc15d 100644
--- a/gnucash/gnome-utils/dialog-query-view.c
+++ b/gnucash/gnome-utils/dialog-query-view.c
@@ -352,6 +352,7 @@ gnc_dialog_query_view_create (GtkWindow *parent, GList *param_list, Query *q,
const char *title, const char *label,
gboolean abs, gboolean inv_sort,
gint sort_column, GtkSortType order,
+ gint expand_column,
GNCDisplayViewButton *buttons,
const gchar *pref_group, gpointer user_data)
{
@@ -380,6 +381,9 @@ gnc_dialog_query_view_create (GtkWindow *parent, GList *param_list, Query *q,
/* Set the sort order */
gnc_query_sort_order (GNC_QUERY_VIEW (dqv->qview), sort_column, order);
+ /* Set the column that expands, columns start from 0 */
+ gnc_query_set_expand_column (GNC_QUERY_VIEW (dqv->qview), expand_column);
+
/* Unselect all rows */
gnc_query_view_unselect_all (GNC_QUERY_VIEW (dqv->qview));
diff --git a/gnucash/gnome-utils/dialog-query-view.h b/gnucash/gnome-utils/dialog-query-view.h
index 237955715a..df8ea04c2c 100644
--- a/gnucash/gnome-utils/dialog-query-view.h
+++ b/gnucash/gnome-utils/dialog-query-view.h
@@ -57,6 +57,7 @@ gnc_dialog_query_view_create (GtkWindow *parent, GList *param_list, Query *q,
const char *title, const char *label,
gboolean abs, gboolean inv_sort,
gint sort_column, GtkSortType order,
+ gint expand_column,
GNCDisplayViewButton *buttons,
const gchar *pref_group, gpointer user_data);
diff --git a/gnucash/gnome-utils/gnc-query-view.c b/gnucash/gnome-utils/gnc-query-view.c
index 31600932b5..4eaf1520eb 100644
--- a/gnucash/gnome-utils/gnc-query-view.c
+++ b/gnucash/gnome-utils/gnc-query-view.c
@@ -775,6 +775,32 @@ gnc_query_view_set_query_sort (GNCQueryView *qview, gboolean new_column)
gnc_query_view_refresh (qview);
}
+/********************************************************************\
+ * gnc_query_set_expand_column *
+ * sets the column that expands to take up free space starting *
+ * from 0 *
+ * *
+ * Args: qview - view to change the sort order for *
+ * column - the tree view column to set to expand *
+ * Returns: nothing *
+\********************************************************************/
+void
+gnc_query_set_expand_column (GNCQueryView *qview, gint column)
+{
+ g_return_if_fail (qview != NULL);
+ g_return_if_fail (GNC_IS_QUERY_VIEW(qview));
+
+ GtkTreeView *view = GTK_TREE_VIEW(qview);
+
+ gint num_columns = gtk_tree_view_get_n_columns (view);
+
+ if (column >= 0 && column < num_columns)
+ {
+ GtkTreeViewColumn *tree_column = gtk_tree_view_get_column (view, column);
+ gtk_tree_view_column_set_expand (tree_column, TRUE);
+ }
+}
+
/********************************************************************\
* gnc_query_view_fill *
* Add all items to the list store *
diff --git a/gnucash/gnome-utils/gnc-query-view.h b/gnucash/gnome-utils/gnc-query-view.h
index 420ac455b3..bd50d536c6 100644
--- a/gnucash/gnome-utils/gnc-query-view.h
+++ b/gnucash/gnome-utils/gnc-query-view.h
@@ -119,6 +119,8 @@ gboolean gnc_query_view_item_in_view (GNCQueryView *qview, gpointer item);
void gnc_query_sort_order (GNCQueryView *qview, gint column, GtkSortType order);
+void gnc_query_set_expand_column (GNCQueryView *qview, gint column);
+
void gnc_query_scroll_to_selection (GNCQueryView *qview);
void gnc_query_force_scroll_to_selection (GNCQueryView *qview);
diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index e615f8f0e3..7189cea869 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -3923,6 +3923,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
message,
TRUE, FALSE,
1, GTK_SORT_ASCENDING,
+ 1, // columns start from 0
duetype == DUE_FOR_VENDOR ?
vendorbuttons :
customerbuttons,
commit 8795233afbbb507443409258280a9f4375ce57da
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Jan 24 12:15:40 2025 +0000
Bug 799343 - Dialog boxes won't remain sized and positioned - part2
Allow the Due Bills/Invoice Reminder dialogs to save and restore the
size and position.
diff --git a/gnucash/gnome-utils/dialog-query-view.c b/gnucash/gnome-utils/dialog-query-view.c
index 7fe6d39773..56f01eaf14 100644
--- a/gnucash/gnome-utils/dialog-query-view.c
+++ b/gnucash/gnome-utils/dialog-query-view.c
@@ -43,6 +43,7 @@ struct _DialogQueryView
GtkWidget * qview;
GtkWidget * button_box;
GNCDisplayViewButton * buttons;
+ const gchar * pref_group;
gpointer user_data;
GList * books;
gint component_id;
@@ -120,11 +121,22 @@ gnc_dialog_query_view_double_click_entry (GNCQueryView *qview, gpointer item,
gnc_dialog_query_run_callback (dqv->buttons, item, dqv);
}
+static void
+dqv_save_window_size (DialogQueryView *dqv)
+{
+ g_return_if_fail (dqv);
+
+ if (dqv->pref_group)
+ gnc_save_window_size (dqv->pref_group, GTK_WINDOW(dqv->dialog));
+}
+
static int
gnc_dialog_query_view_delete_cb (GtkDialog *dialog, GdkEvent *event, DialogQueryView *dqv)
{
g_return_val_if_fail (dqv, TRUE);
+ dqv_save_window_size (dqv);
+
gnc_unregister_gui_component (dqv->component_id);
/* destroy the book list */
@@ -169,15 +181,29 @@ gnc_dialog_query_view_refresh_handler (GHashTable *changes, gpointer user_data)
static void
gnc_dialog_query_view_close (GtkButton *button, DialogQueryView *dqv)
{
+ dqv_save_window_size (dqv);
+
/* Don't select anything */
gnc_dialog_query_view_destroy (dqv);
}
+static gboolean
+dqv_window_key_press_cb (GtkWidget *widget, GdkEventKey *event,
+ gpointer user_data)
+{
+ DialogQueryView *dqv = user_data;
+
+ if (event->keyval == GDK_KEY_Escape)
+ dqv_save_window_size (dqv);
+
+ return FALSE;
+}
+
/*****************************************************************/
/* PUBLIC INTERFACES */
DialogQueryView *
-gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q)
+gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q, const gchar *pref_group)
{
GtkBuilder *builder;
DialogQueryView *dqv;
@@ -187,6 +213,7 @@ gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q)
dqv = g_new0 (DialogQueryView, 1);
builder = gtk_builder_new();
gnc_builder_add_from_file (builder, "dialog-query-view.glade", "query_view_dialog");
+ dqv->pref_group = pref_group;
/* Grab the dialog, save the dialog info */
dqv->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "query_view_dialog"));
@@ -248,6 +275,13 @@ gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q)
gnc_gui_component_watch_entity (dqv->component_id, (GncGUID*)node->data,
QOF_EVENT_DESTROY);
+ g_signal_connect (G_OBJECT (dqv->dialog), "key_press_event",
+ G_CALLBACK (dqv_window_key_press_cb), dqv);
+
+ if (pref_group)
+ gnc_restore_window_size (pref_group, GTK_WINDOW(dqv->dialog), GTK_WINDOW(parent));
+
+
g_object_unref(G_OBJECT(builder));
return dqv;
@@ -318,14 +352,15 @@ gnc_dialog_query_view_create (GtkWindow *parent, GList *param_list, Query *q,
const char *title, const char *label,
gboolean abs, gboolean inv_sort,
gint sort_column, GtkSortType order,
- GNCDisplayViewButton *buttons, gpointer user_data)
+ GNCDisplayViewButton *buttons,
+ const gchar *pref_group, gpointer user_data)
{
DialogQueryView *dqv;
if (!param_list || !q)
return NULL;
- dqv = gnc_dialog_query_view_new (parent, param_list, q);
+ dqv = gnc_dialog_query_view_new (parent, param_list, q, pref_group);
if (!dqv)
return NULL;
diff --git a/gnucash/gnome-utils/dialog-query-view.h b/gnucash/gnome-utils/dialog-query-view.h
index 88c83756ac..237955715a 100644
--- a/gnucash/gnome-utils/dialog-query-view.h
+++ b/gnucash/gnome-utils/dialog-query-view.h
@@ -39,7 +39,7 @@ typedef struct
} GNCDisplayViewButton;
DialogQueryView *
-gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q);
+gnc_dialog_query_view_new (GtkWindow *parent, GList *param_list, Query *q, const gchar *pref_group);
void gnc_dialog_query_view_set_title (DialogQueryView *dqv, const char *title);
void gnc_dialog_query_view_set_label (DialogQueryView *dqv, const char *label);
@@ -57,7 +57,8 @@ gnc_dialog_query_view_create (GtkWindow *parent, GList *param_list, Query *q,
const char *title, const char *label,
gboolean abs, gboolean inv_sort,
gint sort_column, GtkSortType order,
- GNCDisplayViewButton *buttons, gpointer user_data);
+ GNCDisplayViewButton *buttons,
+ const gchar *pref_group, gpointer user_data);
#endif /* GNC_DIALOG_QUERY_VIEW_H */
diff --git a/gnucash/gnome/dialog-invoice.c b/gnucash/gnome/dialog-invoice.c
index ac6ac27bcf..e615f8f0e3 100644
--- a/gnucash/gnome/dialog-invoice.c
+++ b/gnucash/gnome/dialog-invoice.c
@@ -84,6 +84,9 @@
#define DIALOG_NEW_INVOICE_CM_CLASS "dialog-new-invoice"
#define DIALOG_VIEW_INVOICE_CM_CLASS "dialog-view-invoice"
+#define GNC_PREFS_GROUP_CUSTOMER "dialogs.customer-due"
+#define GNC_PREFS_GROUP_VENDOR "dialogs.vendor-due"
+
#define GNC_PREFS_GROUP_SEARCH "dialogs.business.invoice-search"
#define GNC_PREF_NOTIFY_WHEN_DUE "notify-when-due"
#define GNC_PREF_ACCUM_SPLITS "accumulate-splits"
@@ -3782,6 +3785,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
time64 end_date;
GList *res;
gchar *message, *title;
+ gchar *prefs_group;
DialogQueryView *dialog;
gint len;
static GList *param_list = NULL;
@@ -3891,6 +3895,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
if (duetype == DUE_FOR_VENDOR)
{
+ prefs_group = GNC_PREFS_GROUP_VENDOR;
message = g_strdup_printf
(/* Translators: %d is the number of bills/credit notes due. This is a
ngettext(3) message. */
@@ -3902,6 +3907,7 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
}
else
{
+ prefs_group = GNC_PREFS_GROUP_CUSTOMER;
message = g_strdup_printf
(/* Translators: %d is the number of invoices/credit notes due. This is a
ngettext(3) message. */
@@ -3919,7 +3925,8 @@ gnc_invoice_show_docs_due (GtkWindow *parent, QofBook *book, double days_in_adva
1, GTK_SORT_ASCENDING,
duetype == DUE_FOR_VENDOR ?
vendorbuttons :
- customerbuttons, NULL);
+ customerbuttons,
+ prefs_group, NULL);
g_free(message);
qof_query_destroy(q);
diff --git a/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in b/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
index 9f587595cc..4cfe99b6ae 100644
--- a/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
@@ -7,6 +7,7 @@
<child name="price-editor" schema="org.gnucash.GnuCash.dialogs.price-editor"/>
<child name="pricedb-editor" schema="org.gnucash.GnuCash.dialogs.pricedb-editor"/>
<child name="process-payment" schema="org.gnucash.GnuCash.dialogs.process-payment"/>
+ <child name="customer-due" schema="org.gnucash.GnuCash.dialogs.customer-due"/>
<child name="reset-warnings" schema="org.gnucash.GnuCash.dialogs.reset-warnings"/>
<child name="tax-info" schema="org.gnucash.GnuCash.dialogs.tax-info"/>
<child name="fincalc" schema="org.gnucash.GnuCash.dialogs.fincalc"/>
@@ -27,6 +28,7 @@
<child name="trans-doclink" schema="org.gnucash.GnuCash.dialogs.trans-doclink"/>
<child name="style-sheet" schema="org.gnucash.GnuCash.dialogs.style-sheet"/>
<child name="options" schema="org.gnucash.GnuCash.dialogs.options"/>
+ <child name="vendor-due" schema="org.gnucash.GnuCash.dialogs.vendor-due"/>
</schema>
<schema id="org.gnucash.GnuCash.dialogs.account" path="/org/gnucash/GnuCash/dialogs/account/">
@@ -49,6 +51,16 @@
</key>
</schema>
+ <schema id="org.gnucash.GnuCash.dialogs.customer-due" path="/org/gnucash/GnuCash/dialogs/customer-due/">
+ <key type="(iiii)" name="last-geometry">
+ <default>(-1,-1,-1,-1)</default>
+ <summary>Last window position and size</summary>
+ <description>This setting describes the size and position of the window when it was last closed.
+ The numbers are the X and Y coordinates of the top left corner of the window
+ followed by the width and height of the window.</description>
+ </key>
+ </schema>
+
<schema id="org.gnucash.GnuCash.dialogs.imap-editor" path="/org/gnucash/GnuCash/dialogs/imap-editor/">
<key type="(iiii)" name="last-geometry">
<default>(-1,-1,-1,-1)</default>
@@ -311,4 +323,14 @@
followed by the width and height of the window.</description>
</key>
</schema>
+
+ <schema id="org.gnucash.GnuCash.dialogs.vendor-due" path="/org/gnucash/GnuCash/dialogs/vendor-due/">
+ <key type="(iiii)" name="last-geometry">
+ <default>(-1,-1,-1,-1)</default>
+ <summary>Last window position and size</summary>
+ <description>This setting describes the size and position of the window when it was last closed.
+ The numbers are the X and Y coordinates of the top left corner of the window
+ followed by the width and height of the window.</description>
+ </key>
+ </schema>
</schemalist>
commit 4fc3a0cb83434a50fbc06795121fc3d7578dccd8
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Jan 24 12:02:34 2025 +0000
Bug 799343 - Dialog boxes won't remain sized and positioned - part1
This commit allows saving the position and size of the Billing Term
Editor and the Process Payment dialogs.
diff --git a/gnucash/gnome/dialog-billterms.c b/gnucash/gnome/dialog-billterms.c
index fbe6d5184b..c1ca3fd954 100644
--- a/gnucash/gnome/dialog-billterms.c
+++ b/gnucash/gnome/dialog-billterms.c
@@ -39,6 +39,7 @@
#include "dialog-billterms.h"
#define DIALOG_BILLTERMS_CM_CLASS "billterms-dialog"
+#define GNC_PREFS_GROUP "dialogs.bill-terms"
enum term_cols
{
@@ -709,8 +710,10 @@ static void
billterms_window_close_handler (gpointer data)
{
BillTermsWindow *btw = data;
+
g_return_if_fail (btw);
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(btw->window));
gtk_widget_destroy (btw->window);
}
@@ -718,9 +721,24 @@ void
billterms_window_close (GtkWidget *widget, gpointer data)
{
BillTermsWindow *btw = data;
+
gnc_close_gui_component (btw->component_id);
}
+static gboolean
+billterms_window_delete_event_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer data)
+{
+ BillTermsWindow *btw = data;
+
+ if (!btw) return FALSE;
+
+ // this cb allows the window size to be saved on closing with the X
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(btw->window));
+ return FALSE;
+}
+
void
billterms_window_destroy_cb (GtkWidget *widget, gpointer data)
{
@@ -809,7 +827,7 @@ gnc_ui_billterms_window_new (GtkWindow *parent, QofBook *book)
gnc_widget_style_context_add_class (GTK_WIDGET(btw->window), "gnc-class-bill-terms");
g_signal_connect (btw->window, "key_press_event",
- G_CALLBACK (billterms_window_key_press_cb), btw);
+ G_CALLBACK(billterms_window_key_press_cb), btw);
/* Initialize the view */
view = GTK_TREE_VIEW(btw->terms_view);
@@ -850,6 +868,11 @@ gnc_ui_billterms_window_new (GtkWindow *parent, QofBook *book)
gnc_gui_component_set_session (btw->component_id, btw->session);
+ g_signal_connect (G_OBJECT(btw->window), "delete-event",
+ G_CALLBACK(billterms_window_delete_event_cb), btw);
+
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(btw->window), GTK_WINDOW(parent));
+
gtk_widget_show_all (btw->window);
billterms_window_refresh (btw);
diff --git a/gnucash/gnome/dialog-payment.c b/gnucash/gnome/dialog-payment.c
index 10c4aa0bb1..761588684b 100644
--- a/gnucash/gnome/dialog-payment.c
+++ b/gnucash/gnome/dialog-payment.c
@@ -59,6 +59,7 @@
static const QofLogModule log_module = G_LOG_DOMAIN;
#define DIALOG_PAYMENT_CM_CLASS "payment-dialog"
+#define GNC_PREFS_GROUP "dialogs.process-payment"
typedef enum
{
@@ -327,8 +328,9 @@ gnc_payment_window_close_handler (gpointer data)
{
PaymentWindow *pw = data;
- if (pw)
- gtk_widget_destroy (pw->dialog);
+ if (!pw) return;
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(pw->dialog));
+ gtk_widget_destroy (pw->dialog);
}
static void
@@ -1203,6 +1205,19 @@ doc_sort_func (GtkTreeModel *model,
return ret;
}
+static gboolean
+payment_dialog_delete_event_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ PaymentWindow *pw = user_data;
+
+ // this cb allows the window size to be saved on closing with the X
+ gnc_save_window_size (GNC_PREFS_GROUP, GTK_WINDOW(pw->dialog));
+
+ return FALSE;
+}
+
static PaymentWindow *
new_payment_window (GtkWindow *parent, QofBook *book, InitialPaymentInfo *tx_info)
{
@@ -1404,6 +1419,8 @@ new_payment_window (GtkWindow *parent, QofBook *book, InitialPaymentInfo *tx_inf
g_signal_connect (G_OBJECT (selection), "changed",
G_CALLBACK (gnc_payment_dialog_xfer_acct_changed_cb), pw);
+ g_signal_connect (G_OBJECT(pw->dialog), "delete-event",
+ G_CALLBACK(payment_dialog_delete_event_cb), pw);
/* Register with the component manager */
pw->component_id =
@@ -1418,6 +1435,8 @@ new_payment_window (GtkWindow *parent, QofBook *book, InitialPaymentInfo *tx_inf
QOF_EVENT_CREATE | QOF_EVENT_MODIFY |
QOF_EVENT_DESTROY);
+ gnc_restore_window_size (GNC_PREFS_GROUP, GTK_WINDOW(pw->dialog), GTK_WINDOW(parent));
+
/* Show it all */
gtk_widget_show_all (pw->dialog);
g_object_unref(G_OBJECT(builder));
diff --git a/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in b/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
index 8554d2d3a2..9f587595cc 100644
--- a/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.GnuCash.dialogs.gschema.xml.in
@@ -1,10 +1,12 @@
<schemalist gettext-domain="@PROJECT_NAME@">
<schema id="org.gnucash.GnuCash.dialogs" path="/org/gnucash/GnuCash/dialogs/">
<child name="account" schema="org.gnucash.GnuCash.dialogs.account"/>
+ <child name="bill-terms" schema="org.gnucash.GnuCash.dialogs.bill-terms"/>
<child name="imap-editor" schema="org.gnucash.GnuCash.dialogs.imap-editor"/>
<child name="preferences" schema="org.gnucash.GnuCash.dialogs.preferences"/>
<child name="price-editor" schema="org.gnucash.GnuCash.dialogs.price-editor"/>
<child name="pricedb-editor" schema="org.gnucash.GnuCash.dialogs.pricedb-editor"/>
+ <child name="process-payment" schema="org.gnucash.GnuCash.dialogs.process-payment"/>
<child name="reset-warnings" schema="org.gnucash.GnuCash.dialogs.reset-warnings"/>
<child name="tax-info" schema="org.gnucash.GnuCash.dialogs.tax-info"/>
<child name="fincalc" schema="org.gnucash.GnuCash.dialogs.fincalc"/>
@@ -37,6 +39,16 @@
</key>
</schema>
+ <schema id="org.gnucash.GnuCash.dialogs.bill-terms" path="/org/gnucash/GnuCash/dialogs/bill-terms/">
+ <key type="(iiii)" name="last-geometry">
+ <default>(-1,-1,-1,-1)</default>
+ <summary>Last window position and size</summary>
+ <description>This setting describes the size and position of the window when it was last closed.
+ The numbers are the X and Y coordinates of the top left corner of the window
+ followed by the width and height of the window.</description>
+ </key>
+ </schema>
+
<schema id="org.gnucash.GnuCash.dialogs.imap-editor" path="/org/gnucash/GnuCash/dialogs/imap-editor/">
<key type="(iiii)" name="last-geometry">
<default>(-1,-1,-1,-1)</default>
@@ -87,6 +99,16 @@
</key>
</schema>
+ <schema id="org.gnucash.GnuCash.dialogs.process-payment" path="/org/gnucash/GnuCash/dialogs/process-payment/">
+ <key type="(iiii)" name="last-geometry">
+ <default>(-1,-1,-1,-1)</default>
+ <summary>Last window position and size</summary>
+ <description>This setting describes the size and position of the window when it was last closed.
+ The numbers are the X and Y coordinates of the top left corner of the window
+ followed by the width and height of the window.</description>
+ </key>
+ </schema>
+
<schema id="org.gnucash.GnuCash.dialogs.reset-warnings" path="/org/gnucash/GnuCash/dialogs/reset-warnings/">
<key name="last-geometry" type="(iiii)">
<default>(-1,-1,-1,-1)</default>
commit 71583f60b211198157734902dfb87a42d09215df
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Jan 24 11:46:33 2025 +0000
Bug 799334 - GnuCash re-opens to incorrect page
This commit fixes an error that was missed when restoring the order
which failed to account for the pages that were not restored.
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 3aac442500..e4ce5510ae 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -792,10 +792,15 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
data->page_num = i;
gboolean page_added = gnc_main_window_restore_page (window, data);
- added_page_offsets = g_slist_append (added_page_offsets, GINT_TO_POINTER(offset));
-
if (!page_added) // if page not added, increase offset to compensate
+ {
offset ++;
+ added_page_offsets = g_slist_append (added_page_offsets,
+ GINT_TO_POINTER(-1));
+ }
+ else
+ added_page_offsets = g_slist_append (added_page_offsets,
+ GINT_TO_POINTER(offset));
/* give the page a chance to display */
while (gtk_events_pending ())
@@ -824,18 +829,31 @@ gnc_main_window_restore_window (GncMainWindow *window, GncMainWindowSaveData *da
/* Dump any list that might exist */
g_list_free(priv->usage_order);
priv->usage_order = nullptr;
- /* Now rebuild the list from the key file. */
+
+ gint default_page_position = -1;
+
+ /* Now rebuild the list from the key file, skipping pages not added */
for (i = 0; i < length; i++)
{
- gint offset = GPOINTER_TO_INT(g_slist_nth_data (added_page_offsets, order[i] - 1));
- gpointer page = g_list_nth_data (priv->installed_pages, order[i] - 1 - offset);
+ gint zero_based_page_number = order[i] - 1;
+
+ gint offset = GPOINTER_TO_INT(g_slist_nth_data (added_page_offsets,
+ zero_based_page_number));
+
+ if (offset == -1)
+ continue;
+
+ gpointer page = g_list_nth_data (priv->installed_pages,
+ zero_based_page_number - offset);
+
+ if (default_page_position == -1)
+ default_page_position = zero_based_page_number - offset;
+
if (page)
- {
- priv->usage_order = g_list_append(priv->usage_order, page);
- }
+ priv->usage_order = g_list_append (priv->usage_order, page);
}
gtk_notebook_set_current_page (GTK_NOTEBOOK(priv->notebook),
- order[0] - 1 - offset);
+ default_page_position);
g_signal_emit_by_name (window, "page_changed",
g_list_nth_data (priv->usage_order, 0));
commit 99f067ffe3c203fbd9a734aa4b1a1cd96e5fd670
Author: Robert Fewell <14uBobIT at gmail.com>
Date: Fri Jan 24 11:07:23 2025 +0000
Fix g_object warning for creating schedule from trans
When you try and schedule an open transaction like the blank
transaction a dialog warns you and prevents doing so. As a result a
couple of objects were being unrefed which had not be created so add a
test for the objects before being unrefed.
diff --git a/gnucash/gnome/dialog-sx-from-trans.cpp b/gnucash/gnome/dialog-sx-from-trans.cpp
index 0136fa27d7..1dd766021a 100644
--- a/gnucash/gnome/dialog-sx-from-trans.cpp
+++ b/gnucash/gnome/dialog-sx-from-trans.cpp
@@ -623,9 +623,10 @@ sxftd_destroy( GtkWidget *w, gpointer user_data )
xaccSchedXactionDestroy(sxfti->sx);
sxfti->sx = NULL;
}
-
- g_object_unref(G_OBJECT(sxfti->dense_cal_model));
- g_object_unref(G_OBJECT(sxfti->example_cal));
+ if (sxfti->dense_cal_model)
+ g_object_unref(G_OBJECT(sxfti->dense_cal_model));
+ if (sxfti->example_cal)
+ g_object_unref(G_OBJECT(sxfti->example_cal));
g_free(sxfti);
}
Summary of changes:
gnucash/gnome-utils/dialog-query-view.c | 45 ++++++++++++++++++++--
gnucash/gnome-utils/dialog-query-view.h | 6 ++-
gnucash/gnome-utils/gnc-main-window.cpp | 36 ++++++++++++-----
gnucash/gnome-utils/gnc-query-view.c | 26 +++++++++++++
gnucash/gnome-utils/gnc-query-view.h | 2 +
gnucash/gnome/dialog-billterms.c | 25 +++++++++++-
gnucash/gnome/dialog-invoice.c | 10 ++++-
gnucash/gnome/dialog-payment.c | 23 ++++++++++-
gnucash/gnome/dialog-sx-from-trans.cpp | 7 ++--
.../org.gnucash.GnuCash.dialogs.gschema.xml.in | 44 +++++++++++++++++++++
10 files changed, 203 insertions(+), 21 deletions(-)
More information about the gnucash-changes
mailing list