gnucash master: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Thu Jan 12 09:30:41 EST 2023


Updated	 via  https://github.com/Gnucash/gnucash/commit/e9b1f466 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/8f957781 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/cf499f5b (commit)
	 via  https://github.com/Gnucash/gnucash/commit/99690da5 (commit)
	from  https://github.com/Gnucash/gnucash/commit/8063f3c9 (commit)



commit e9b1f46691b5c3b8c91550cc7f4e1bd362e169f9
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jan 12 14:20:55 2023 +0000

    Error in trace file when file history list is empty
    
    The following error is seen in the trace file,
    
    ERROR <gnc.engine> gnc_uri_get_components: assertion 'uri != NULL &&
     strlen (uri) > 0' failed
    
    if the file open menu option is used after opening GnuCash with an
    empty file history list. The function gnc_history_get_last returns an
    empty string so test for this before calling gnc_uri_targets_local_fs.

diff --git a/gnucash/gnome-utils/dialog-file-access.c b/gnucash/gnome-utils/dialog-file-access.c
index 8fa8a9707..fe35e7586 100644
--- a/gnucash/gnome-utils/dialog-file-access.c
+++ b/gnucash/gnome-utils/dialog-file-access.c
@@ -338,7 +338,7 @@ gnc_ui_file_access (GtkWindow *parent, int type)
     if (type == FILE_ACCESS_OPEN || type == FILE_ACCESS_SAVE_AS)
     {
         last = gnc_history_get_last();
-        if ( last && gnc_uri_targets_local_fs (last))
+        if ( last && *last && gnc_uri_targets_local_fs (last))
         {
             gchar *filepath = gnc_uri_get_path ( last );
             faw->starting_dir = g_path_get_dirname( filepath );

commit 8f957781579662a735a3b6f59cc5d50c4cb62753
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jan 12 14:12:58 2023 +0000

    Recent file list menu entry displays RecentFile0Action
    
    If the recent file list is empty or can not be found the menu action
    RecentFile0Action was displayed on menu. Changed so it does not add the
    default first recent menu action.

diff --git a/gnucash/gnome-utils/gnc-plugin-file-history.c b/gnucash/gnome-utils/gnc-plugin-file-history.c
index 39d74631a..b54394ce2 100644
--- a/gnucash/gnome-utils/gnc-plugin-file-history.c
+++ b/gnucash/gnome-utils/gnc-plugin-file-history.c
@@ -100,7 +100,6 @@ static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
 /** The default menu items that need to be add to the menu */
 static const gchar *gnc_plugin_load_ui_items [] =
 {
-    "FilePlaceholder6",
     NULL,
 };
 

commit cf499f5b93c053d9035d266b54903cbb5e991cc2
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jan 12 14:05:53 2023 +0000

    Remove some comments added when menus were changed

diff --git a/gnucash/gnome-utils/gnc-embedded-window.c b/gnucash/gnome-utils/gnc-embedded-window.c
index 631a52691..644f07f1d 100644
--- a/gnucash/gnome-utils/gnc-embedded-window.c
+++ b/gnucash/gnome-utils/gnc-embedded-window.c
@@ -74,9 +74,9 @@ typedef struct GncEmbeddedWindowPrivate
      *  window. */
     GtkWidget *menu_dock;
     /** The menubar */
-    GtkWidget *menubar; //FIXMEb added
+    GtkWidget *menubar;
     /** The menubar_model */
-    GMenuModel *menubar_model; //FIXMEb added
+    GMenuModel *menubar_model;
     /** The toolbar. This pointer provides easy access for
      * showing/hiding the toolbar. */
     GtkWidget *toolbar;
@@ -88,7 +88,7 @@ typedef struct GncEmbeddedWindowPrivate
     /** The group of all actions provided by the main window itself.
      *  This does not include any action provided by menu or content
      *  plugins. */
-    GSimpleActionGroup *simple_action_group; //FIXMEb added
+    GSimpleActionGroup *simple_action_group;
 
     /** The currently selected page. */
     GncPluginPage *page;
@@ -351,18 +351,18 @@ gnc_embedded_window_new (const gchar *action_group_name,
     {
         g_critical ("Failed to load, Error %s", error->message);
         g_error_free (error);
-        return NULL; //FIXMEb this may need changing
+        return NULL;
     }
 
     priv->menubar_model = (GMenuModel *)gtk_builder_get_object (builder, "embeddedwin-menu");
 
     priv->menubar = gtk_menu_bar_new_from_model (priv->menubar_model);
-    gtk_container_add (GTK_CONTAINER(priv->menu_dock), priv->menubar); //FIXMEb this may need changing
+    gtk_container_add (GTK_CONTAINER(priv->menu_dock), priv->menubar);
     gtk_widget_show (GTK_WIDGET(priv->menubar));
 
     priv->toolbar = (GtkWidget *)gtk_builder_get_object (builder, "embeddedwin-toolbar");
     g_object_set (priv->toolbar, "toolbar-style", GTK_TOOLBAR_BOTH, NULL);
-    gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar)); //FIXMEb this may need changing
+    gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar));
     gtk_widget_show (GTK_WIDGET(priv->toolbar));
 
     g_object_unref (builder);
diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index 78aecf52d..ecc182d26 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -95,7 +95,7 @@ enum
 {
     PAGE_ADDED,
     PAGE_CHANGED,
-    MENU_CHANGED, //FIXMEb added
+    MENU_CHANGED,
     LAST_SIGNAL
 };
 
@@ -226,9 +226,9 @@ typedef struct GncMainWindowPrivate
      *  to the main window. */
     GtkWidget *menu_dock;
     /** The menubar */
-    GtkWidget *menubar; //FIXMEb added
+    GtkWidget *menubar;
     /** The menubar_model */
-    GMenuModel *menubar_model; //FIXMEb added
+    GMenuModel *menubar_model;
     /** The toolbar. This pointer provides easy access for
      * showing/hiding the toolbar. */
     GtkWidget *toolbar;
@@ -257,13 +257,13 @@ typedef struct GncMainWindowPrivate
     /** Set when restoring plugin pages */
     gboolean restoring_pages;
 
-    const gchar   *previous_plugin_page_name; //FIXMEb added
-    const gchar   *previous_menu_qualifier; //FIXMEb added
+    const gchar   *previous_plugin_page_name;
+    const gchar   *previous_menu_qualifier;
 
     /** The accelerator group for the window */
-    GtkAccelGroup *accel_group; //FIXMEb added
+    GtkAccelGroup *accel_group;
 
-    GHashTable    *display_item_hash; //FIXMEb added
+    GHashTable    *display_item_hash;
 
 } GncMainWindowPrivate;
 
@@ -3434,7 +3434,7 @@ update_menu_model (GncMainWindow *window, const gchar *ui_filename,
     {
         g_critical ("Failed to load, Error %s", error->message);
         g_error_free (error);
-        return; //FIXMEb this may need changing
+        return;
     }
 
     for (gint i = 0; ui_updates[i]; i++)
@@ -3565,9 +3565,6 @@ gnc_main_window_get_action_group (GncMainWindow *window,
     return (GSimpleActionGroup*)action_group;
 }
 
-//FIXMEb##
-
-
 GtkWidget *
 gnc_main_window_toolbar_find_tool_item (GncMainWindow *window, const gchar *action_name)
 {
@@ -4125,7 +4122,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
     {
         g_critical ("Failed to load, Error %s", error->message);
         g_error_free (error);
-        return; //FIXMEb this may need changing
+        return;
     }
 
     g_action_map_add_action_entries (G_ACTION_MAP(window),
@@ -4135,12 +4132,12 @@ gnc_main_window_setup_window (GncMainWindow *window)
 
     priv->menubar_model = (GMenuModel *)gtk_builder_get_object (builder, "mainwin-menu");
     priv->menubar = gtk_menu_bar_new_from_model (priv->menubar_model);
-    gtk_container_add (GTK_CONTAINER(priv->menu_dock), priv->menubar); //FIXMEb this may need changing
+    gtk_container_add (GTK_CONTAINER(priv->menu_dock), priv->menubar);
     gtk_widget_show (GTK_WIDGET(priv->menubar));
 
     priv->toolbar = (GtkWidget *)gtk_builder_get_object (builder, "mainwin-toolbar");
     g_object_set (priv->toolbar, "toolbar-style", GTK_TOOLBAR_BOTH, NULL);
-    gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar)); //FIXMEb this may need changing
+    gtk_container_add (GTK_CONTAINER(priv->menu_dock), GTK_WIDGET(priv->toolbar));
     gtk_widget_show (GTK_WIDGET(priv->toolbar));
 
     g_object_unref (builder);
diff --git a/gnucash/gnome-utils/gnc-main-window.h b/gnucash/gnome-utils/gnc-main-window.h
index 34331440f..ba5284e40 100644
--- a/gnucash/gnome-utils/gnc-main-window.h
+++ b/gnucash/gnome-utils/gnc-main-window.h
@@ -80,7 +80,7 @@ typedef struct
     void (*page_changed) (GncMainWindow *window,
                           GncPluginPage *page);
     void (*menu_changed) (GncMainWindow *window,
-                          GncPluginPage *page); //FIXMEb added
+                          GncPluginPage *page);
 } GncMainWindowClass;
 
 typedef struct
@@ -276,7 +276,7 @@ void gnc_main_window_unmerge_actions (GncMainWindow *window,
  */
 void gnc_main_window_set_vis_of_items_by_action (GncMainWindow *window,
                                                  const gchar **action_names,
-                                                 gboolean vis); //FIXMEb added
+                                                 gboolean vis);
 
 /** Find the menu item with the given action name for the window
  *  specified.
@@ -289,7 +289,7 @@ void gnc_main_window_set_vis_of_items_by_action (GncMainWindow *window,
  *  @return The found menu item widget or NULL.
  */
 GtkWidget *gnc_main_window_menu_find_menu_item (GncMainWindow *window,
-                                                const gchar *action_name); //FIXMEb added
+                                                const gchar *action_name);
 
 /** Find the toolbar item with the given action name for the window
  *  specified.
@@ -302,7 +302,7 @@ GtkWidget *gnc_main_window_menu_find_menu_item (GncMainWindow *window,
  *  @return The found tool item widget or NULL.
  */
 GtkWidget * gnc_main_window_toolbar_find_tool_item (GncMainWindow *window,
-                                                    const gchar *action_name); //FIXMEb added
+                                                    const gchar *action_name);
 
 /** Find the GMenuModel item given the action name for the window
  *  specified.
@@ -321,7 +321,7 @@ GtkWidget * gnc_main_window_toolbar_find_tool_item (GncMainWindow *window,
 gboolean gnc_main_window_update_menu_for_action (GncMainWindow *window,
                                                  const gchar *action_name,
                                                  const gchar *label,
-                                                 const gchar *tooltip); //FIXMEb added
+                                                 const gchar *tooltip);
 
 /** Scan the main window menu and add accelerator keys to main window
  *  accelerator group.
@@ -330,7 +330,7 @@ gboolean gnc_main_window_update_menu_for_action (GncMainWindow *window,
  *  be updated.
  *
  */
-void gnc_main_window_menu_add_accelerator_keys (GncMainWindow *window); //FIXMEb added
+void gnc_main_window_menu_add_accelerator_keys (GncMainWindow *window);
 
 /** A structure for defining alternate action names for use in the
  *  toolbar.  All toolbar buttons are homogeneous in size and are sized
@@ -344,7 +344,7 @@ typedef struct
     const char *action_name;
     /** The alternate toolbar label to use */
     const char *short_label;
-} GncToolBarShortNames; //FIXMEb added
+} GncToolBarShortNames;
 
 
 /** Update the labels of the toolbar items with short names.
@@ -355,7 +355,7 @@ typedef struct
  *  GncToolBarShortNames items.
  */
 void gnc_main_window_init_short_names (GncMainWindow *window,
-                                       GncToolBarShortNames *toolbar_labels); //FIXMEb added
+                                       GncToolBarShortNames *toolbar_labels);
 
 
 /** Retrieve a specific set of user interface actions from a window.
@@ -507,7 +507,7 @@ GAction *gnc_main_window_find_action (GncMainWindow *window,
  */
 GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
                                                const gchar *group_name,
-                                               const gchar *action_name); //FIXMEb added
+                                               const gchar *action_name);
 
 /** Return the GMenuModel for the main window menu bar.
  *
@@ -515,7 +515,7 @@ GAction *gnc_main_window_find_action_in_group (GncMainWindow *window,
  *
  *  @return The GMenuModel or NULL.
  */
-GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window); //FIXMEb added
+GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window);
 
 /** Update the main window menu with the placeholders listed in
  *  ui_updates and load the page specific toolbar.
@@ -528,7 +528,7 @@ GMenuModel *gnc_main_window_get_menu_model (GncMainWindow *window); //FIXMEb add
  */
 void gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
                                               GncPluginPage *page,
-                                              const gchar **ui_updates); //FIXMEb added
+                                              const gchar **ui_updates);
 
 /**
  * Shows all main windows.
diff --git a/gnucash/gnome-utils/gnc-plugin-page.c b/gnucash/gnome-utils/gnc-plugin-page.c
index 291324c17..43e8ab1d4 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.c
+++ b/gnucash/gnome-utils/gnc-plugin-page.c
@@ -90,10 +90,10 @@ typedef struct _GncPluginPagePrivate
     /** The group of all actions provided by this plugin. */
     char *ui_description;
 
-    GtkBuilder *builder; //FIXMEb added
-    GSimpleActionGroup *simple_action_group; //FIXMEb added
-    const gchar *simple_action_group_name; //FIXMEb added
-    const gchar *menu_qualifier; //FIXMEb added
+    GtkBuilder *builder;
+    GSimpleActionGroup *simple_action_group;
+    const gchar *simple_action_group_name;
+    const gchar *menu_qualifier;
 
     GList *books;
 
diff --git a/gnucash/gnome-utils/gnc-plugin-page.h b/gnucash/gnome-utils/gnc-plugin-page.h
index 757d2b23e..5ccec3b08 100644
--- a/gnucash/gnome-utils/gnc-plugin-page.h
+++ b/gnucash/gnome-utils/gnc-plugin-page.h
@@ -285,7 +285,7 @@ GncPluginPage *gnc_plugin_page_recreate_page (GtkWidget *window,
  *  @param plugin_page A pointer to the page whose actions should be
  *  added to the user interface.
  */
-void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page); //FIXMEb added
+void gnc_plugin_page_merge_actions (GncPluginPage *plugin_page);
 
 
 /** Retrieve the textual name of a plugin.
@@ -495,7 +495,7 @@ void gnc_plugin_page_set_ui_description (GncPluginPage *page,
  *  @param page The page whose UI information should be retrieved.
  *
  *  @return A pointer to the GtkBuilder object for this page. */
-GtkBuilder *gnc_plugin_page_get_builder (GncPluginPage *page); //FIXMEb added
+GtkBuilder *gnc_plugin_page_get_builder (GncPluginPage *page);
 
 
 /** Retrieve the menu qualifier for this page.
@@ -504,7 +504,7 @@ GtkBuilder *gnc_plugin_page_get_builder (GncPluginPage *page); //FIXMEb added
  *
  *  @return A qualifier string for this page.
  */
-const gchar * gnc_plugin_page_get_menu_qualifier (GncPluginPage *page); //FIXMEb added
+const gchar * gnc_plugin_page_get_menu_qualifier (GncPluginPage *page);
 
 /** Set a qualifier string for this page. This string is used when there
  *  is more than one menu associated with the page.
@@ -514,7 +514,7 @@ const gchar * gnc_plugin_page_get_menu_qualifier (GncPluginPage *page); //FIXMEb
  *  @param menu_qualifier A string to be used as for the qualifier.
  */
 void gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
-                                         const char *menu_qualifier); //FIXMEb added
+                                         const char *menu_qualifier);
 
 /** Retrieve the GSimpleActionGroup object associated with this page.
  *
@@ -523,7 +523,7 @@ void gnc_plugin_page_set_menu_qualifier (GncPluginPage *page,
  *
  *  @return A pointer to the GSimpleActionGroup object for this page.
  */
-GSimpleActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page); //FIXMEb added
+GSimpleActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page);
 
 /** Create the GSimpleActionGroup object associated with this page.
  *
@@ -538,7 +538,7 @@ GSimpleActionGroup *gnc_plugin_page_get_action_group (GncPluginPage *page); //FI
  *  this page.
  */
 GSimpleActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page,
-                                                          const gchar *group_name); //FIXMEb added
+                                                          const gchar *group_name);
 
 /** Retrieve the simple action group name associated with this plugin
  *  page.
@@ -547,7 +547,7 @@ GSimpleActionGroup * gnc_plugin_page_create_action_group (GncPluginPage *page,
  *
  *  @return The simple action group name associated with this plugin.
  */
-const gchar *gnc_plugin_page_get_simple_action_group_name (GncPluginPage *page); //FIXMEb added
+const gchar *gnc_plugin_page_get_simple_action_group_name (GncPluginPage *page);
 
 
 /** Retrieve a GAction object associated with this page.
diff --git a/gnucash/gnome-utils/gnc-plugin.h b/gnucash/gnome-utils/gnc-plugin.h
index faa7585d0..ab4619b86 100644
--- a/gnucash/gnome-utils/gnc-plugin.h
+++ b/gnucash/gnome-utils/gnc-plugin.h
@@ -119,12 +119,12 @@ typedef struct
     const gchar *actions_name;
     /** An array of actions that should automatically be added to
      *  any GnuCash "main" content window that is opened. */
-    GActionEntry   *actions; //FIXMEb added
+    GActionEntry   *actions;
     /** The number of actions in the actions array. */
-    guint           n_actions; //FIXMEb added
+    guint           n_actions;
 
     /** An array of ui updates for the menu model */
-    const gchar **ui_updates; //FIXMEb added
+    const gchar **ui_updates;
 
     /** The relative name of the XML file describing the
      *  menu/toolbar action items. */
@@ -262,7 +262,7 @@ void gnc_plugin_init_short_names (GtkWidget *toolbar,
  */
 void gnc_plugin_set_actions_enabled (GActionMap *action_map,
                                      const gchar **action_names,
-                                     gboolean enable); //FIXMEb added
+                                     gboolean enable);
 
 /** This function adds the tooltip callbacks to make the tooltips
  *  appear in the status bar.
@@ -275,7 +275,7 @@ void gnc_plugin_set_actions_enabled (GActionMap *action_map,
  */
 void gnc_plugin_add_menu_tooltip_callbacks (GtkWidget *menubar,
                                             GMenuModel *menubar_model,
-                                            GtkWidget *statusbar); //FIXMEb added
+                                            GtkWidget *statusbar);
 
 /** This function adds the tooltip callbacks to make the tooltips
  *  appear in the status bar.
@@ -285,7 +285,7 @@ void gnc_plugin_add_menu_tooltip_callbacks (GtkWidget *menubar,
  *  @param statusbar The status bar widget in the main window.
  */
 void gnc_plugin_add_toolbar_tooltip_callbacks (GtkWidget *toolbar,
-                                               GtkWidget *statusbar); //FIXMEb added
+                                               GtkWidget *statusbar);
 
 G_END_DECLS
 

commit 99690da524bd14484b7172c5d27dc63c88b55b19
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Thu Jan 12 13:51:26 2023 +0000

    Remove left over debug lines

diff --git a/gnucash/gnome-utils/gnc-main-window.cpp b/gnucash/gnome-utils/gnc-main-window.cpp
index a4246f35e..78aecf52d 100644
--- a/gnucash/gnome-utils/gnc-main-window.cpp
+++ b/gnucash/gnome-utils/gnc-main-window.cpp
@@ -264,7 +264,6 @@ typedef struct GncMainWindowPrivate
     GtkAccelGroup *accel_group; //FIXMEb added
 
     GHashTable    *display_item_hash; //FIXMEb added
-    gint           num_item_q; //FIXMEb temp added
 
 } GncMainWindowPrivate;
 
@@ -2737,7 +2736,6 @@ gnc_main_window_init (GncMainWindow *window, void *data)
     priv->restoring_pages = FALSE;
 
     priv->display_item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, nullptr);
-    priv->num_item_q = 0; //FIXMEb temp addded
 
     priv->previous_plugin_page_name = nullptr;
     priv->previous_menu_qualifier = nullptr;
@@ -3596,8 +3594,6 @@ gnc_main_window_menu_find_menu_item (GncMainWindow *window, const gchar *action_
 
     menu_item = GTK_WIDGET(g_hash_table_lookup (priv->display_item_hash, action_name));
 
-    priv->num_item_q++; //FIXMEb temp added
-
     if (!menu_item)
     {
         menu_item = gnc_menubar_model_find_menu_item (priv->menubar_model, priv->menubar, action_name);
@@ -3799,7 +3795,6 @@ gnc_main_window_update_menu_and_toolbar (GncMainWindow *window,
     g_hash_table_remove_all (priv->display_item_hash);
     gnc_menubar_model_remove_items_with_attrib (priv->menubar_model,
                                                 GNC_MENU_ATTRIBUTE_TEMPORARY);
-    priv->num_item_q = 0; //FIXMEb temp added
 
     for (gint i = 0; ui_updates[i]; i++)
     {



Summary of changes:
 gnucash/gnome-utils/dialog-file-access.c      |  2 +-
 gnucash/gnome-utils/gnc-embedded-window.c     | 12 +++++------
 gnucash/gnome-utils/gnc-main-window.cpp       | 30 ++++++++++-----------------
 gnucash/gnome-utils/gnc-main-window.h         | 22 ++++++++++----------
 gnucash/gnome-utils/gnc-plugin-file-history.c |  1 -
 gnucash/gnome-utils/gnc-plugin-page.c         |  8 +++----
 gnucash/gnome-utils/gnc-plugin-page.h         | 14 ++++++-------
 gnucash/gnome-utils/gnc-plugin.h              | 12 +++++------
 8 files changed, 46 insertions(+), 55 deletions(-)



More information about the gnucash-changes mailing list