mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove some more GtkUIManager functions from gnc-main-window
This commit is contained in:
parent
c9abdb1373
commit
42d13eb6f4
@ -247,7 +247,6 @@ typedef struct GncMainWindowPrivate
|
|||||||
/** The group of all actions provided by the main window
|
/** The group of all actions provided by the main window
|
||||||
* itself. This does not include any action provided by menu
|
* itself. This does not include any action provided by menu
|
||||||
* or content plugins. */
|
* or content plugins. */
|
||||||
GtkActionGroup *action_group;
|
|
||||||
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
||||||
/** A list of all pages that are installed in this window. */
|
/** A list of all pages that are installed in this window. */
|
||||||
GList *installed_pages;
|
GList *installed_pages;
|
||||||
@ -288,12 +287,8 @@ GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW,
|
|||||||
* that has been installed in this window. */
|
* that has been installed in this window. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
/** The merge identifier for this action group. This number
|
|
||||||
* is provided by the UI manager. */
|
|
||||||
guint merge_id;
|
|
||||||
/** The action group itself. This contains all actions added
|
/** The action group itself. This contains all actions added
|
||||||
* by a single menu or content plugin. */
|
* by a single menu or content plugin. */
|
||||||
GtkActionGroup *action_group;
|
|
||||||
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
GSimpleActionGroup *simple_action_group; //FIXMEb added
|
||||||
} MergedActionEntry;
|
} MergedActionEntry;
|
||||||
|
|
||||||
@ -3551,22 +3546,19 @@ gnc_main_window_get_current_page (GncMainWindow *window)
|
|||||||
void
|
void
|
||||||
gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
||||||
const gchar *group_name,
|
const gchar *group_name,
|
||||||
GtkActionGroup *group,
|
GSimpleActionGroup *group)
|
||||||
guint merge_id)
|
|
||||||
{
|
{
|
||||||
GncMainWindowPrivate *priv;
|
GncMainWindowPrivate *priv;
|
||||||
MergedActionEntry *entry;
|
MergedActionEntry *entry;
|
||||||
|
|
||||||
g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
|
g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
|
||||||
g_return_if_fail (group_name != nullptr);
|
g_return_if_fail (group_name != nullptr);
|
||||||
g_return_if_fail (GTK_IS_ACTION_GROUP(group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(group));
|
||||||
g_return_if_fail (merge_id > 0);
|
|
||||||
|
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
entry = g_new0 (MergedActionEntry, 1);
|
entry = g_new0 (MergedActionEntry, 1);
|
||||||
entry->action_group = group;
|
entry->simple_action_group = group;
|
||||||
entry->merge_id = merge_id;
|
|
||||||
gtk_ui_manager_ensure_update (window->ui_merge);
|
|
||||||
g_hash_table_insert (priv->merged_actions_table, g_strdup (group_name), entry);
|
g_hash_table_insert (priv->merged_actions_table, g_strdup (group_name), entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4228,19 +4220,19 @@ gnc_main_window_init_menu_updaters (GncMainWindow *window)
|
|||||||
static void
|
static void
|
||||||
gnc_main_window_window_menu (GncMainWindow *window)
|
gnc_main_window_window_menu (GncMainWindow *window)
|
||||||
{
|
{
|
||||||
guint merge_id;
|
// guint merge_id;
|
||||||
#ifdef MAC_INTEGRATION
|
#ifdef MAC_INTEGRATION
|
||||||
gchar *filename = gnc_filepath_locate_ui_file("gnc-windows-menu-ui-quartz.xml");
|
gchar *filename = gnc_filepath_locate_ui_file ("gnc-windows-menu-ui-quartz.xml");
|
||||||
#else
|
#else
|
||||||
gchar *filename = gnc_filepath_locate_ui_file("gnc-windows-menu-ui.xml");
|
gchar *filename = gnc_filepath_locate_ui_file ("gnc-windows-menu-ui.xml");
|
||||||
GncMainWindowPrivate *priv;
|
GncMainWindowPrivate *priv;
|
||||||
#endif
|
#endif
|
||||||
GError *error = nullptr;
|
GError *error = nullptr;
|
||||||
g_assert(filename);
|
g_assert(filename);
|
||||||
merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, filename,
|
//FIXMEb merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge, filename,
|
||||||
&error);
|
// &error);
|
||||||
g_free(filename);
|
g_free (filename);
|
||||||
g_assert(merge_id);
|
// g_assert(merge_id);
|
||||||
#ifndef MAC_INTEGRATION
|
#ifndef MAC_INTEGRATION
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
|
|
||||||
@ -4301,7 +4293,6 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
{
|
{
|
||||||
GncMainWindowPrivate *priv;
|
GncMainWindowPrivate *priv;
|
||||||
GtkWidget *main_vbox;
|
GtkWidget *main_vbox;
|
||||||
// guint merge_id;
|
|
||||||
GtkBuilder *builder;
|
GtkBuilder *builder;
|
||||||
GncPluginManager *manager;
|
GncPluginManager *manager;
|
||||||
GtkAccelGroup *accel_group = gtk_accel_group_new ();
|
GtkAccelGroup *accel_group = gtk_accel_group_new ();
|
||||||
@ -4383,15 +4374,8 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
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)); //FIXMEb this may need changing
|
||||||
gtk_widget_show (GTK_WIDGET(priv->toolbar));
|
gtk_widget_show (GTK_WIDGET(priv->toolbar));
|
||||||
|
|
||||||
//FIXMEb window->ui_merge = gtk_ui_manager_new ();
|
|
||||||
|
|
||||||
/* Create menu and toolbar information */
|
|
||||||
// priv->action_group = gtk_action_group_new ("MainWindowActions");
|
|
||||||
|
|
||||||
priv->simple_action_group = g_simple_action_group_new ();
|
priv->simple_action_group = g_simple_action_group_new ();
|
||||||
|
|
||||||
//FIXMEb gtk_action_group_set_translation_domain (priv->action_group, PROJECT_NAME);
|
|
||||||
|
|
||||||
g_action_map_add_action_entries (G_ACTION_MAP(priv->simple_action_group),
|
g_action_map_add_action_entries (G_ACTION_MAP(priv->simple_action_group),
|
||||||
gnc_menu_actions,
|
gnc_menu_actions,
|
||||||
gnc_menu_n_actions,
|
gnc_menu_n_actions,
|
||||||
@ -4407,42 +4391,9 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
gnc_main_window_menu_item_vis_by_action (window,
|
gnc_main_window_menu_item_vis_by_action (window,
|
||||||
always_hidden_actions, false);
|
always_hidden_actions, false);
|
||||||
|
|
||||||
|
|
||||||
// gtk_ui_manager_insert_action_group (window->ui_merge, priv->action_group, 0);
|
|
||||||
|
|
||||||
gtk_widget_insert_action_group (GTK_WIDGET(window), "mainwin",
|
gtk_widget_insert_action_group (GTK_WIDGET(window), "mainwin",
|
||||||
G_ACTION_GROUP(priv->simple_action_group));
|
G_ACTION_GROUP(priv->simple_action_group));
|
||||||
|
|
||||||
//FIXMEb g_signal_connect (G_OBJECT (window->ui_merge), "add_widget",
|
|
||||||
// G_CALLBACK (gnc_main_window_add_widget), window);
|
|
||||||
|
|
||||||
/* Use the "connect-proxy" signal for tooltip display in the status bar */
|
|
||||||
//FIXMEb g_signal_connect (G_OBJECT (window->ui_merge), "connect-proxy",
|
|
||||||
// G_CALLBACK (gnc_window_connect_proxy), priv->statusbar);
|
|
||||||
|
|
||||||
// filename = gnc_filepath_locate_ui_file("gnc-main-window.ui");
|
|
||||||
|
|
||||||
// merge_id = gtk_ui_manager_add_ui_from_file (window->ui_merge,
|
|
||||||
// filename, &error);
|
|
||||||
// g_assert(merge_id || error);
|
|
||||||
// if (merge_id)
|
|
||||||
// {
|
|
||||||
|
|
||||||
//FIXMEb gtk_window_add_accel_group (GTK_WINDOW (window),
|
|
||||||
// gtk_ui_manager_get_accel_group(window->ui_merge));
|
|
||||||
|
|
||||||
// gtk_ui_manager_ensure_update (window->ui_merge);
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// g_critical("Failed to load ui file.\n Filename %s\n Error %s",
|
|
||||||
// filename, error->message);
|
|
||||||
// g_error_free(error);
|
|
||||||
// g_assert(merge_id != 0);
|
|
||||||
// }
|
|
||||||
// g_free(filename);
|
|
||||||
|
|
||||||
|
|
||||||
//FIXMEb gnc_main_window_window_menu (window); may need to use some thing like this
|
//FIXMEb gnc_main_window_window_menu (window); may need to use some thing like this
|
||||||
|
|
||||||
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
||||||
|
@ -74,8 +74,6 @@ typedef struct
|
|||||||
typedef struct GncMainWindow
|
typedef struct GncMainWindow
|
||||||
{
|
{
|
||||||
GtkWindow gtk_window; /**< The parent object for a main window. */
|
GtkWindow gtk_window; /**< The parent object for a main window. */
|
||||||
GtkUIManager *ui_merge; /**< A pointer to the UI Manager data
|
|
||||||
structure for the whole window. */
|
|
||||||
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
|
gboolean window_quitting; /**< Set to TRUE when quitting from this window. */
|
||||||
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
|
gboolean just_plugin_prefs; /**< Just remove preferences only from plugins */
|
||||||
} GncMainWindow;
|
} GncMainWindow;
|
||||||
@ -83,8 +81,7 @@ typedef struct GncMainWindow
|
|||||||
/** The class data structure for a main window object. */
|
/** The class data structure for a main window object. */
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
GtkWindowClass gtk_window; /**< The parent class for a
|
GtkWindowClass gtk_window; /**< The parent class for a main window. */
|
||||||
main window. */
|
|
||||||
|
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
void (*page_added) (GncMainWindow *window,
|
void (*page_added) (GncMainWindow *window,
|
||||||
@ -154,7 +151,7 @@ void gnc_main_window_open_page (GncMainWindow *window,
|
|||||||
void gnc_main_window_close_page (GncPluginPage *page);
|
void gnc_main_window_close_page (GncPluginPage *page);
|
||||||
|
|
||||||
|
|
||||||
/* Iterator function to walk all pages in all windows, calling the
|
/** Iterator function to walk all pages in all windows, calling the
|
||||||
* specified function for each page.
|
* specified function for each page.
|
||||||
*
|
*
|
||||||
* @param entry A pointer to the function to be called.
|
* @param entry A pointer to the function to be called.
|
||||||
@ -221,16 +218,11 @@ main_window_update_page_set_read_only_icon (GncPluginPage *page,
|
|||||||
* should be unique among all groups added to the window, and will be
|
* should be unique among all groups added to the window, and will be
|
||||||
* needed to remove the actions from this window.
|
* needed to remove the actions from this window.
|
||||||
*
|
*
|
||||||
* @param group A pointer to an array of GtkActions. These are the
|
* @param group A pointer to the GSimpleActionGroup.
|
||||||
* actions that will be added to the user interface.
|
|
||||||
*
|
|
||||||
* @param merge_id A merge identifier retrieved from a call to
|
|
||||||
* gtk_ui_manager_new_merge_id().
|
|
||||||
*/
|
*/
|
||||||
void gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
void gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
||||||
const gchar *group_name,
|
const gchar *group_name,
|
||||||
GtkActionGroup *group,
|
GSimpleActionGroup *group);
|
||||||
guint merge_id);
|
|
||||||
|
|
||||||
|
|
||||||
/** Add a set of actions to the specified window. This function
|
/** Add a set of actions to the specified window. This function
|
||||||
@ -246,7 +238,7 @@ void gnc_main_window_manual_merge_actions (GncMainWindow *window,
|
|||||||
* should be unique among all groups added to the window, and will be
|
* should be unique among all groups added to the window, and will be
|
||||||
* needed to remove the actions from this window.
|
* needed to remove the actions from this window.
|
||||||
*
|
*
|
||||||
* @param entries A pointer to an array of GtkActionEntry. These
|
* @param entries A pointer to an array of GActionEntry. These
|
||||||
* are the actions that will be added to the user interface.
|
* are the actions that will be added to the user interface.
|
||||||
*
|
*
|
||||||
* @param n_entries The number of actions in the array.
|
* @param n_entries The number of actions in the array.
|
||||||
|
Loading…
Reference in New Issue
Block a user