mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Use GtkApplicationWindow as basis for GncMainWindow
Geert's changes... As a GtkApplicationWindow also implements the GActionMap interface it can be used directly instead of the GSimpleActionGroup that was set up to maintain our actions. As a GtkApplicationWindow is not a GSimpleActionGroup (the other object to implement GActionMap) this also needed a minor change in the function signature of gnc_plugin_set_actions_enabled.
This commit is contained in:
parent
d0d76c279a
commit
0aaf11ac25
@ -244,11 +244,6 @@ typedef struct GncMainWindowPrivate
|
|||||||
* window that is contained in the status bar. This pointer
|
* window that is contained in the status bar. This pointer
|
||||||
* provides easy access for updating the progressbar. */
|
* provides easy access for updating the progressbar. */
|
||||||
GtkWidget *progressbar;
|
GtkWidget *progressbar;
|
||||||
|
|
||||||
/** 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
|
|
||||||
/** 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;
|
||||||
/** A list of pages in order of use (most recent -> least recent) */
|
/** A list of pages in order of use (most recent -> least recent) */
|
||||||
@ -273,7 +268,7 @@ typedef struct GncMainWindowPrivate
|
|||||||
|
|
||||||
} GncMainWindowPrivate;
|
} GncMainWindowPrivate;
|
||||||
|
|
||||||
GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_WINDOW,
|
GNC_DEFINE_TYPE_WITH_CODE(GncMainWindow, gnc_main_window, GTK_TYPE_APPLICATION_WINDOW,
|
||||||
G_ADD_PRIVATE (GncMainWindow)
|
G_ADD_PRIVATE (GncMainWindow)
|
||||||
G_IMPLEMENT_INTERFACE (GNC_TYPE_WINDOW,
|
G_IMPLEMENT_INTERFACE (GNC_TYPE_WINDOW,
|
||||||
gnc_window_main_window_init))
|
gnc_window_main_window_init))
|
||||||
@ -1559,7 +1554,7 @@ gnc_main_window_generate_title (GncMainWindow *window)
|
|||||||
/* Update the menus based upon whether this is an "immutable" page. */
|
/* Update the menus based upon whether this is an "immutable" page. */
|
||||||
immutable = page &&
|
immutable = page &&
|
||||||
g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE);
|
g_object_get_data (G_OBJECT (page), PLUGIN_PAGE_IMMUTABLE);
|
||||||
gnc_plugin_set_actions_enabled (priv->simple_action_group,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(window),
|
||||||
immutable_page_actions,
|
immutable_page_actions,
|
||||||
!immutable);
|
!immutable);
|
||||||
/* Trigger sensitivity updtates of other actions such as Save/Revert */
|
/* Trigger sensitivity updtates of other actions such as Save/Revert */
|
||||||
@ -1862,7 +1857,7 @@ gnc_main_window_update_radio_button (GncMainWindow *window)
|
|||||||
|
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
|
|
||||||
action = g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group),
|
action = g_action_map_lookup_action (G_ACTION_MAP(window),
|
||||||
"WindowAction");
|
"WindowAction");
|
||||||
|
|
||||||
/* Block the signal so as not to affect window ordering (top to
|
/* Block the signal so as not to affect window ordering (top to
|
||||||
@ -3531,7 +3526,7 @@ gnc_main_window_find_action (GncMainWindow *window, const gchar *name)
|
|||||||
|
|
||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
|
|
||||||
action = g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group),
|
action = g_action_map_lookup_action (G_ACTION_MAP(window),
|
||||||
name);
|
name);
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
@ -3550,7 +3545,7 @@ gnc_main_window_find_action_in_group (GncMainWindow *window,
|
|||||||
|
|
||||||
auto action_group = gtk_widget_get_action_group (GTK_WIDGET(window), group_name);
|
auto action_group = gtk_widget_get_action_group (GTK_WIDGET(window), group_name);
|
||||||
if (action_group)
|
if (action_group)
|
||||||
action = g_action_map_lookup_action (G_ACTION_MAP(action_group), name);
|
action = g_action_map_lookup_action (G_ACTION_MAP(window), name);
|
||||||
|
|
||||||
return action;
|
return action;
|
||||||
}
|
}
|
||||||
@ -3837,7 +3832,7 @@ gnc_main_window_update_tab_position (gpointer prefs, gchar *pref, gpointer user_
|
|||||||
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
|
||||||
gtk_notebook_set_tab_pos (GTK_NOTEBOOK(priv->notebook), position);
|
gtk_notebook_set_tab_pos (GTK_NOTEBOOK(priv->notebook), position);
|
||||||
|
|
||||||
action = g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group),
|
action = g_action_map_lookup_action (G_ACTION_MAP(window),
|
||||||
"ViewTabPositionAction");
|
"ViewTabPositionAction");
|
||||||
|
|
||||||
g_signal_handlers_block_by_func (G_OBJECT(action),
|
g_signal_handlers_block_by_func (G_OBJECT(action),
|
||||||
@ -4091,6 +4086,11 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
return; //FIXMEb this may need changing
|
return; //FIXMEb this may need changing
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_action_map_add_action_entries (G_ACTION_MAP(window),
|
||||||
|
gnc_menu_actions,
|
||||||
|
gnc_menu_n_actions,
|
||||||
|
window);
|
||||||
|
|
||||||
priv->menubar_model = (GMenuModel *)gtk_builder_get_object (builder, "mainwin-menu");
|
priv->menubar_model = (GMenuModel *)gtk_builder_get_object (builder, "mainwin-menu");
|
||||||
priv->menubar = gtk_menu_bar_new_from_model (priv->menubar_model);
|
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); //FIXMEb this may need changing
|
||||||
@ -4101,17 +4101,10 @@ 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));
|
||||||
|
|
||||||
priv->simple_action_group = g_simple_action_group_new ();
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(window),
|
||||||
|
|
||||||
g_action_map_add_action_entries (G_ACTION_MAP(priv->simple_action_group),
|
|
||||||
gnc_menu_actions,
|
|
||||||
gnc_menu_n_actions,
|
|
||||||
window);
|
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (priv->simple_action_group,
|
|
||||||
initially_insensitive_actions,
|
initially_insensitive_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
gnc_plugin_set_actions_enabled (priv->simple_action_group,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(window),
|
||||||
always_insensitive_actions,
|
always_insensitive_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
@ -4119,7 +4112,7 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
always_hidden_actions, false);
|
always_hidden_actions, false);
|
||||||
|
|
||||||
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(window));
|
||||||
|
|
||||||
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
gnc_prefs_register_cb (GNC_PREFS_GROUP_GENERAL,
|
||||||
GNC_PREF_TAB_POSITION_TOP,
|
GNC_PREF_TAB_POSITION_TOP,
|
||||||
@ -4143,17 +4136,15 @@ gnc_main_window_setup_window (GncMainWindow *window)
|
|||||||
|
|
||||||
/* Disable the Transaction menu */
|
/* Disable the Transaction menu */
|
||||||
action = gnc_main_window_find_action (window, "TransactionAction");
|
action = gnc_main_window_find_action (window, "TransactionAction");
|
||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), false);
|
||||||
/* Disable the Schedule menu */
|
/* Disable the Schedule menu */
|
||||||
action = gnc_main_window_find_action (window, "ScheduledAction");
|
action = gnc_main_window_find_action (window, "ScheduledAction");
|
||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), FALSE);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), false);
|
||||||
|
|
||||||
/* Now update the "eXtensions" menu */
|
/* Now update the "eXtensions" menu */
|
||||||
if (!gnc_prefs_is_extra_enabled())
|
if (!gnc_prefs_is_extra_enabled())
|
||||||
{
|
{
|
||||||
GAction* action = g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group),
|
action = gnc_main_window_find_action (window, "ExtensionsAction");
|
||||||
"ExtensionsAction");
|
|
||||||
|
|
||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), false);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4275,7 +4266,7 @@ gnc_main_window_show_summarybar (GncMainWindow *window, GAction *action)
|
|||||||
gboolean visible;
|
gboolean visible;
|
||||||
|
|
||||||
if (action == nullptr)
|
if (action == nullptr)
|
||||||
action = g_action_map_lookup_action (G_ACTION_MAP(priv->simple_action_group),
|
action = g_action_map_lookup_action (G_ACTION_MAP(window),
|
||||||
"ViewSummaryAction");
|
"ViewSummaryAction");
|
||||||
if (action == nullptr)
|
if (action == nullptr)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -4348,7 +4339,7 @@ gnc_main_window_switch_page (GtkNotebook *notebook,
|
|||||||
priv->usage_order = g_list_prepend (priv->usage_order, page);
|
priv->usage_order = g_list_prepend (priv->usage_order, page);
|
||||||
}
|
}
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (priv->simple_action_group,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(window),
|
||||||
multiple_page_actions,
|
multiple_page_actions,
|
||||||
g_list_length (priv->installed_pages) > 1);
|
g_list_length (priv->installed_pages) > 1);
|
||||||
|
|
||||||
|
@ -64,15 +64,15 @@ typedef struct
|
|||||||
/** The instance data structure for a main window object. */
|
/** The instance data structure for a main window object. */
|
||||||
typedef struct GncMainWindow
|
typedef struct GncMainWindow
|
||||||
{
|
{
|
||||||
GtkWindow gtk_window; /**< The parent object for a main window. */
|
GtkApplicationWindow gtk_application_window; /**< The parent object for a main 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;
|
||||||
|
|
||||||
/** 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 main window. */
|
GtkApplicationWindowClass gtk_application_window; /**< The parent class for a main window. */
|
||||||
|
|
||||||
/* callbacks */
|
/* callbacks */
|
||||||
void (*page_added) (GncMainWindow *window,
|
void (*page_added) (GncMainWindow *window,
|
||||||
|
@ -244,20 +244,20 @@ gnc_plugin_init_short_names (GtkWidget *toolbar,
|
|||||||
|
|
||||||
/* Update the sensitivity of an action */
|
/* Update the sensitivity of an action */
|
||||||
void
|
void
|
||||||
gnc_plugin_set_actions_enabled (GSimpleActionGroup *simple_action_group,
|
gnc_plugin_set_actions_enabled (GActionMap *action_map,
|
||||||
const gchar **action_names, gboolean enable)
|
const gchar **action_names, gboolean enable)
|
||||||
{
|
{
|
||||||
g_return_if_fail (simple_action_group != NULL);
|
g_return_if_fail (action_map != NULL);
|
||||||
|
|
||||||
for (gint i = 0; action_names[i]; i++)
|
for (gint i = 0; action_names[i]; i++)
|
||||||
{
|
{
|
||||||
GAction *action = g_action_map_lookup_action (G_ACTION_MAP(simple_action_group),
|
GAction *action = g_action_map_lookup_action (G_ACTION_MAP(action_map),
|
||||||
action_names[i]);
|
action_names[i]);
|
||||||
if (action)
|
if (action)
|
||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), enable);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), enable);
|
||||||
else
|
else
|
||||||
PERR("No such action with name '%s' in action group %p)",
|
PERR("No such action with name '%s' in action group %p)",
|
||||||
action_names[i], simple_action_group);
|
action_names[i], action_map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -250,8 +250,7 @@ void gnc_plugin_init_short_names (GtkWidget *toolbar,
|
|||||||
/** This function sets the sensitivity of a GAction in a specific
|
/** This function sets the sensitivity of a GAction in a specific
|
||||||
* group.
|
* group.
|
||||||
*
|
*
|
||||||
* @param simple_action_group The group of all actions associated with a
|
* @param action_map The action map associated with the window.
|
||||||
* plugin or plugin page.
|
|
||||||
*
|
*
|
||||||
* @param action_names A NULL terminated list of actions names that
|
* @param action_names A NULL terminated list of actions names that
|
||||||
* should be modified.
|
* should be modified.
|
||||||
@ -259,7 +258,7 @@ void gnc_plugin_init_short_names (GtkWidget *toolbar,
|
|||||||
* @param enable A boolean specifying the new state for the specified
|
* @param enable A boolean specifying the new state for the specified
|
||||||
* property.
|
* property.
|
||||||
*/
|
*/
|
||||||
void gnc_plugin_set_actions_enabled (GSimpleActionGroup *simple_action_group,
|
void gnc_plugin_set_actions_enabled (GActionMap *action_map,
|
||||||
const gchar **action_names,
|
const gchar **action_names,
|
||||||
gboolean enable); //FIXMEb added
|
gboolean enable); //FIXMEb added
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ gnc_plugin_basic_commands_add_to_window (GncPlugin *plugin,
|
|||||||
GSimpleActionGroup *simple_action_group =
|
GSimpleActionGroup *simple_action_group =
|
||||||
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group),
|
||||||
gnc_plugin_initially_insensitive_actions,
|
gnc_plugin_initially_insensitive_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
@ -255,9 +255,9 @@ static void update_inactive_actions (GncPluginPage *plugin_page)
|
|||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||||
|
|
||||||
/* Set the action's sensitivity */
|
/* Set the action's sensitivity */
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, readwrite_only_active_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readwrite_only_active_actions,
|
||||||
is_readwrite);
|
is_readwrite);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, dirty_only_active_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), dirty_only_active_actions,
|
||||||
is_dirty);
|
is_dirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ page_changed (GncMainWindow *window, GncPluginPage *page, gpointer user_data)
|
|||||||
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
gnc_main_window_get_action_group (window, PLUGIN_ACTIONS_NAME);
|
||||||
|
|
||||||
if (qof_book_is_readonly (gnc_get_current_book()))
|
if (qof_book_is_readonly (gnc_get_current_book()))
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, plugin_writeable_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), plugin_writeable_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -819,10 +819,10 @@ gnc_plugin_business_update_menus (GncPluginPage *plugin_page)
|
|||||||
is_bus_doc = (xaccTransGetTxnType (trans) == TXN_TYPE_INVOICE);
|
is_bus_doc = (xaccTransGetTxnType (trans) == TXN_TYPE_INVOICE);
|
||||||
}
|
}
|
||||||
// Change visibility and also sensitivity according to whether we are in a txn register
|
// Change visibility and also sensitivity according to whether we are in a txn register
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, register_txn_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), register_txn_actions,
|
||||||
is_txn_register && !is_bus_txn && !is_bus_doc);
|
is_txn_register && !is_bus_txn && !is_bus_doc);
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, register_bus_txn_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), register_bus_txn_actions,
|
||||||
is_txn_register && is_bus_txn && !is_bus_doc);
|
is_txn_register && is_bus_txn && !is_bus_doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -972,7 +972,7 @@ update_inactive_actions (GncPluginPage *plugin_page)
|
|||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||||
|
|
||||||
/* Set the action's sensitivity */
|
/* Set the action's sensitivity */
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, readonly_inactive_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
|
||||||
is_readwrite);
|
is_readwrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -803,15 +803,15 @@ update_inactive_actions (GncPluginPage *plugin_page)
|
|||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP (simple_action_group));
|
||||||
|
|
||||||
/* Set the action's sensitivity */
|
/* Set the action's sensitivity */
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, readonly_inactive_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
|
||||||
allow_write);
|
allow_write);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_account_rw,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account_rw,
|
||||||
allow_write && has_account);
|
allow_write && has_account);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_account_always,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account_always,
|
||||||
has_account);
|
has_account);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_subaccounts_rw,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_subaccounts_rw,
|
||||||
allow_write && subaccounts);
|
allow_write && subaccounts);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_priced_account,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_priced_account,
|
||||||
account && xaccAccountIsPriced (account));
|
account && xaccAccountIsPriced (account));
|
||||||
|
|
||||||
g_signal_emit (plugin_page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
|
g_signal_emit (plugin_page, plugin_page_signals[ACCOUNT_SELECTED], 0, account);
|
||||||
|
@ -323,7 +323,7 @@ gnc_plugin_page_budget_init (GncPluginPageBudget *plugin_page)
|
|||||||
plugin_page);
|
plugin_page);
|
||||||
|
|
||||||
if (qof_book_is_readonly (gnc_get_current_book()))
|
if (qof_book_is_readonly (gnc_get_current_book()))
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, writeable_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), writeable_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
|
|
||||||
/* Visible types */
|
/* Visible types */
|
||||||
@ -702,7 +702,7 @@ gppb_selection_changed_cb (GtkTreeSelection *selection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_account,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account,
|
||||||
sensitive);
|
sensitive);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -659,13 +659,13 @@ gnc_plugin_page_invoice_update_menus (GncPluginPage *page, gboolean is_posted, g
|
|||||||
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
|
g_simple_action_set_enabled (G_SIMPLE_ACTION(action), TRUE);
|
||||||
|
|
||||||
simple_action_group = gnc_plugin_page_get_action_group (page);
|
simple_action_group = gnc_plugin_page_get_action_group (page);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, posted_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), posted_actions,
|
||||||
is_posted);
|
is_posted);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, unposted_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), unposted_actions,
|
||||||
!is_posted);
|
!is_posted);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, can_unpost_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), can_unpost_actions,
|
||||||
can_unpost);
|
can_unpost);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, invoice_book_readwrite_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), invoice_book_readwrite_actions,
|
||||||
!is_readonly);
|
!is_readonly);
|
||||||
|
|
||||||
/* update the action labels and tooltips */
|
/* update the action labels and tooltips */
|
||||||
|
@ -438,7 +438,7 @@ update_inactive_actions(GncPluginPage *plugin_page)
|
|||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||||
|
|
||||||
/* Set the action's sensitivity */
|
/* Set the action's sensitivity */
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, readonly_inactive_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
|
||||||
is_sensitive);
|
is_sensitive);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -850,9 +850,9 @@ gnc_plugin_page_owner_tree_selection_changed_cb (GtkTreeSelection *selection,
|
|||||||
}
|
}
|
||||||
|
|
||||||
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_owner_always,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_owner_always,
|
||||||
sensitive);
|
sensitive);
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_owner_rw,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_owner_rw,
|
||||||
sensitive && is_readwrite);
|
sensitive && is_readwrite);
|
||||||
g_signal_emit (page, plugin_page_signals[OWNER_SELECTED], 0, owner);
|
g_signal_emit (page, plugin_page_signals[OWNER_SELECTED], 0, owner);
|
||||||
}
|
}
|
||||||
|
@ -922,11 +922,11 @@ gnc_plugin_page_register_ui_update (gpointer various,
|
|||||||
gnc_split_reg_get_read_only (priv->gsr))
|
gnc_split_reg_get_read_only (priv->gsr))
|
||||||
read_only_reg = TRUE;
|
read_only_reg = TRUE;
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page)),
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page))),
|
||||||
actions_requiring_account,
|
actions_requiring_account,
|
||||||
!read_only_reg && account != NULL);
|
!read_only_reg && account != NULL);
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page)),
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page))),
|
||||||
actions_requiring_priced_account,
|
actions_requiring_priced_account,
|
||||||
account && xaccAccountIsPriced (account));
|
account && xaccAccountIsPriced (account));
|
||||||
|
|
||||||
@ -1117,7 +1117,7 @@ gnc_plugin_page_register_ui_initial_state (GncPluginPageRegister* page)
|
|||||||
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
simple_action_group = gnc_plugin_page_get_action_group (GNC_PLUGIN_PAGE(page));
|
||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, actions_requiring_account,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), actions_requiring_account,
|
||||||
is_readwrite && account != NULL);
|
is_readwrite && account != NULL);
|
||||||
|
|
||||||
/* Set "style" radio button */
|
/* Set "style" radio button */
|
||||||
|
@ -1326,7 +1326,7 @@ gnc_plugin_page_report_constr_init (GncPluginPageReport *plugin_page, gint repor
|
|||||||
num_report_actions,
|
num_report_actions,
|
||||||
plugin_page);
|
plugin_page);
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, initially_insensitive_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), initially_insensitive_actions,
|
||||||
FALSE);
|
FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -280,7 +280,7 @@ static void update_inactive_actions(GncPluginPage *plugin_page)
|
|||||||
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
g_return_if_fail (G_IS_SIMPLE_ACTION_GROUP(simple_action_group));
|
||||||
|
|
||||||
/* Set the action's sensitivity */
|
/* Set the action's sensitivity */
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, readonly_inactive_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), readonly_inactive_actions,
|
||||||
is_readwrite);
|
is_readwrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -330,19 +330,19 @@ gnc_plugin_ab_account_selected (GncPluginPage *plugin_page, Account *account,
|
|||||||
bankcode = gnc_ab_get_account_bankcode(account);
|
bankcode = gnc_ab_get_account_bankcode(account);
|
||||||
accountid = gnc_ab_get_account_accountid(account);
|
accountid = gnc_ab_get_account_accountid(account);
|
||||||
|
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, need_account_actions,
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), need_account_actions,
|
||||||
(account && bankcode && *bankcode
|
(account && bankcode && *bankcode
|
||||||
&& accountid && *accountid));
|
&& accountid && *accountid));
|
||||||
gnc_main_window_menu_item_vis_by_action (window, need_account_actions, TRUE);
|
gnc_main_window_menu_item_vis_by_action (window, need_account_actions, TRUE);
|
||||||
|
|
||||||
#if (AQBANKING_VERSION_INT < 60400)
|
#if (AQBANKING_VERSION_INT < 60400)
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, inactive_account_actions, FALSE);
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), inactive_account_actions, FALSE);
|
||||||
gnc_main_window_menu_item_vis_by_action (window, inactive_account_actions, FALSE);
|
gnc_main_window_menu_item_vis_by_action (window, inactive_account_actions, FALSE);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
gnc_plugin_set_actions_enabled (simple_action_group, need_account_actions, FALSE);
|
gnc_plugin_set_actions_enabled (G_ACTION_MAP(simple_action_group), need_account_actions, FALSE);
|
||||||
gnc_main_window_menu_item_vis_by_action (window, need_account_actions, FALSE);
|
gnc_main_window_menu_item_vis_by_action (window, need_account_actions, FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user