mirror of
https://github.com/Gnucash/gnucash.git
synced 2024-11-26 19:00:18 -06:00
Refactor: remove unnecessary GncPlugin*Private
This commit is contained in:
parent
1255d61917
commit
e6a564de82
@ -105,17 +105,6 @@ struct _GncPluginFileHistory
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
/** The instance private data for a file history plugin. This data
|
||||
* structure is unused. */
|
||||
typedef struct GncPluginFileHistoryPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginFileHistoryPrivate;
|
||||
|
||||
|
||||
#define GNC_PLUGIN_FILE_HISTORY_GET_PRIVATE(o) \
|
||||
((GncPluginFileHistoryPrivate*)gnc_plugin_file_history_get_instance_private((GncPluginFileHistory*)o))
|
||||
|
||||
/************************************************************
|
||||
* Other Functions *
|
||||
************************************************************/
|
||||
@ -552,7 +541,7 @@ gnc_plugin_history_list_changed (gpointer prefs,
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE(GncPluginFileHistory, gnc_plugin_file_history, GNC_TYPE_PLUGIN)
|
||||
|
||||
/** Initialize the file history plugin class. */
|
||||
static void
|
||||
|
@ -63,17 +63,9 @@ static QofLogModule log_module = GNC_MOD_GUI;
|
||||
struct _GncPluginMenuAdditions
|
||||
{
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
/** Private data for this plugin. This data structure is unused. */
|
||||
typedef struct GncPluginMenuAdditionsPrivate
|
||||
{
|
||||
GHashTable *item_hash;
|
||||
} GncPluginMenuAdditionsPrivate;
|
||||
|
||||
#define GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(o) \
|
||||
((GncPluginMenuAdditionsPrivate*)gnc_plugin_menu_additions_get_instance_private((GncPluginMenuAdditions*)o))
|
||||
|
||||
};
|
||||
|
||||
/** Per-window private data for this plugin. This plugin is unique in
|
||||
* that it manages its own menu items. */
|
||||
@ -101,7 +93,7 @@ static guint gnc_plugin_n_actions = G_N_ELEMENTS(gnc_plugin_actions);
|
||||
* Object Implementation *
|
||||
************************************************************/
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE(GncPluginMenuAdditions, gnc_plugin_menu_additions, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_menu_additions_class_init (GncPluginMenuAdditionsClass *klass)
|
||||
@ -132,14 +124,11 @@ gnc_plugin_menu_additions_init (GncPluginMenuAdditions *plugin)
|
||||
static void
|
||||
gnc_plugin_menu_additions_finalize (GObject *object)
|
||||
{
|
||||
GncPluginMenuAdditionsPrivate *priv;
|
||||
g_return_if_fail (GNC_IS_PLUGIN_MENU_ADDITIONS(object));
|
||||
|
||||
ENTER("plugin %p", object);
|
||||
|
||||
priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(object);
|
||||
|
||||
g_hash_table_destroy (priv->item_hash);
|
||||
g_hash_table_destroy (GNC_PLUGIN_MENU_ADDITIONS(object)->item_hash);
|
||||
|
||||
G_OBJECT_CLASS (gnc_plugin_menu_additions_parent_class)->finalize (object);
|
||||
LEAVE("");
|
||||
@ -185,10 +174,6 @@ gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GncMainWindowActionData *cb_data = user_data;
|
||||
GncPlugin *plugin = cb_data->data;
|
||||
GncPluginMenuAdditionsPrivate *priv;
|
||||
|
||||
SCM extension;
|
||||
gsize length;
|
||||
const gchar *action_name;
|
||||
@ -197,13 +182,13 @@ gnc_plugin_menu_additions_action_new_cb (GSimpleAction *simple,
|
||||
|
||||
ENTER("");
|
||||
|
||||
priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(plugin);
|
||||
|
||||
action_name = g_variant_get_string (parameter, &length);
|
||||
|
||||
PINFO("action name is '%s'", action_name);
|
||||
|
||||
extension = g_hash_table_lookup (priv->item_hash, action_name);
|
||||
GncMainWindowActionData *cb_data = user_data;
|
||||
GncPluginMenuAdditions *plugin = GNC_PLUGIN_MENU_ADDITIONS(cb_data->data);
|
||||
extension = g_hash_table_lookup (plugin->item_hash, action_name);
|
||||
|
||||
if (extension)
|
||||
{
|
||||
@ -482,7 +467,6 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
GncMainWindow *window,
|
||||
GQuark type)
|
||||
{
|
||||
GncPluginMenuAdditionsPrivate *priv = GNC_PLUGIN_MENU_ADDITIONS_GET_PRIVATE(plugin);
|
||||
GncPluginMenuAdditionsPerWindow per_window;
|
||||
static GOnce accel_table_init = G_ONCE_INIT;
|
||||
static GHashTable *table;
|
||||
@ -492,10 +476,11 @@ gnc_plugin_menu_additions_add_to_window (GncPlugin *plugin,
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
if (!priv->item_hash)
|
||||
priv->item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
GncPluginMenuAdditions *menu_plugin = GNC_PLUGIN_MENU_ADDITIONS (plugin);
|
||||
if (!menu_plugin->item_hash)
|
||||
menu_plugin->item_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
|
||||
per_window.item_hash = priv->item_hash;
|
||||
per_window.item_hash = menu_plugin->item_hash;
|
||||
per_window.build_menu_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL);
|
||||
per_window.report_menu = g_menu_new ();
|
||||
|
||||
|
@ -72,16 +72,7 @@ struct _GncPluginAccountTree
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
/** The instance private data structure for an account tree plugin. */
|
||||
typedef struct GncPluginAccountTreePrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginAccountTreePrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_ACCOUNT_TREE_GET_PRIVATE(o) \
|
||||
((GncPluginAccountTreePrivate*)gnc_plugin_account_tree_get_instance_private((GncPluginAccountTree*)o))
|
||||
G_DEFINE_TYPE(GncPluginAccountTree, gnc_plugin_account_tree, GNC_TYPE_PLUGIN)
|
||||
|
||||
/* Create a new account tree menu plugin. */
|
||||
GncPlugin *
|
||||
|
@ -182,16 +182,6 @@ struct _GncPluginBasicCommands
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
/** The instance private data structure for an basic commands
|
||||
* plugin. */
|
||||
typedef struct GncPluginBasicCommandsPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginBasicCommandsPrivate;
|
||||
|
||||
#define GNC_PLUGIN_BASIC_COMMANDS_GET_PRIVATE(o) \
|
||||
((GncPluginBasicCommandsPrivate*)gnc_plugin_basic_commands_get_instance_private ((GncPluginBasicCommands*)o))
|
||||
|
||||
/** Create a new basic commands menu plugin. */
|
||||
GncPlugin *
|
||||
gnc_plugin_basic_commands_new (void)
|
||||
@ -278,7 +268,7 @@ gnc_plugin_basic_commands_main_window_page_changed (GncMainWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE(GncPluginBasicCommands, gnc_plugin_basic_commands, GNC_TYPE_PLUGIN)
|
||||
|
||||
/** Initialize the class for a new basic commands plugin. This will
|
||||
* set up any function pointers that override functions in the parent
|
||||
|
@ -83,14 +83,6 @@ struct _GncPluginBudget
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginBudgetPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginBudgetPrivate;
|
||||
|
||||
#define GNC_PLUGIN_BUDGET_GET_PRIVATE(o) \
|
||||
((GncPluginBudgetPrivate*)gnc_plugin_budget_get_instance_private((GncPluginBudget*)o))
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_budget_new (void)
|
||||
{
|
||||
@ -129,7 +121,7 @@ remove_from_window (GncPlugin *plugin, GncMainWindow *window, GQuark type)
|
||||
g_signal_handlers_disconnect_by_func (window, G_CALLBACK(page_changed), plugin);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE(GncPluginBudget, gnc_plugin_budget, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_budget_class_init (GncPluginBudgetClass *klass)
|
||||
|
@ -177,17 +177,11 @@ static const gchar *gnc_plugin_load_ui_items [] =
|
||||
struct _GncPluginBusiness
|
||||
{
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginBusinessPrivate
|
||||
{
|
||||
GncOwner *last_customer;
|
||||
GncOwner *last_vendor;
|
||||
GncOwner *last_employee;
|
||||
} GncPluginBusinessPrivate;
|
||||
|
||||
#define GNC_PLUGIN_BUSINESS_GET_PRIVATE(o) \
|
||||
((GncPluginBusinessPrivate*)gnc_plugin_business_get_instance_private((GncPluginBusiness*)o))
|
||||
};
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_business_new (void)
|
||||
@ -205,7 +199,7 @@ gnc_plugin_business_new (void)
|
||||
return GNC_PLUGIN (plugin);
|
||||
}
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginBusiness, gnc_plugin_business, GNC_TYPE_PLUGIN)
|
||||
G_DEFINE_TYPE(GncPluginBusiness, gnc_plugin_business, GNC_TYPE_PLUGIN)
|
||||
|
||||
static void
|
||||
gnc_plugin_business_class_init (GncPluginBusinessClass *klass)
|
||||
@ -232,17 +226,14 @@ gnc_plugin_business_class_init (GncPluginBusinessClass *klass)
|
||||
static void
|
||||
gnc_plugin_business_init (GncPluginBusiness *plugin)
|
||||
{
|
||||
GncPluginBusinessPrivate *priv;
|
||||
plugin->last_customer = gncOwnerNew ();
|
||||
gncOwnerInitCustomer (plugin->last_customer, NULL);
|
||||
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
priv->last_customer = gncOwnerNew ();
|
||||
gncOwnerInitCustomer (priv->last_customer, NULL);
|
||||
plugin->last_vendor = gncOwnerNew ();
|
||||
gncOwnerInitVendor (plugin->last_vendor, NULL);
|
||||
|
||||
priv->last_vendor = gncOwnerNew ();
|
||||
gncOwnerInitVendor (priv->last_vendor, NULL);
|
||||
|
||||
priv->last_employee = gncOwnerNew ();
|
||||
gncOwnerInitEmployee (priv->last_employee, NULL);
|
||||
plugin->last_employee = gncOwnerNew ();
|
||||
gncOwnerInitEmployee (plugin->last_employee, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -302,15 +293,13 @@ gnc_plugin_business_cmd_customer_find_customer (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
GncCustomer*customer;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
customer = gncOwnerGetCustomer (priv->last_customer);
|
||||
customer = gncOwnerGetCustomer (plugin->last_customer);
|
||||
gnc_customer_search (GTK_WINDOW (mw->window), customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
@ -321,15 +310,13 @@ gnc_plugin_business_cmd_customer_new_invoice (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ());
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -339,15 +326,13 @@ gnc_plugin_business_cmd_customer_find_invoice (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_customer, gnc_get_current_book ());
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -357,14 +342,12 @@ gnc_plugin_business_cmd_customer_new_job (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_ui_job_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ());
|
||||
gnc_ui_job_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -374,14 +357,12 @@ gnc_plugin_business_cmd_customer_find_job (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_job_search (GTK_WINDOW (mw->window), NULL, priv->last_customer, gnc_get_current_book ());
|
||||
gnc_job_search (GTK_WINDOW (mw->window), NULL, plugin->last_customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -391,14 +372,12 @@ gnc_plugin_business_cmd_customer_process_payment (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_customer, gnc_get_current_book ());
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_customer, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -435,15 +414,13 @@ gnc_plugin_business_cmd_vendor_find_vendor (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
GncVendor *vendor;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
vendor = gncOwnerGetVendor (priv->last_vendor);
|
||||
vendor = gncOwnerGetVendor (plugin->last_vendor);
|
||||
gnc_vendor_search (GTK_WINDOW (mw->window), vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
@ -454,15 +431,13 @@ gnc_plugin_business_cmd_vendor_new_bill (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ());
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -472,15 +447,13 @@ gnc_plugin_business_cmd_vendor_find_bill (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_vendor, gnc_get_current_book ());
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -490,14 +463,12 @@ gnc_plugin_business_cmd_vendor_new_job (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_ui_job_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ());
|
||||
gnc_ui_job_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -507,14 +478,12 @@ gnc_plugin_business_cmd_vendor_find_job (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_job_search (GTK_WINDOW (mw->window), NULL, priv->last_vendor, gnc_get_current_book ());
|
||||
gnc_job_search (GTK_WINDOW (mw->window), NULL, plugin->last_vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -524,14 +493,12 @@ gnc_plugin_business_cmd_vendor_process_payment (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_vendor, gnc_get_current_book ());
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_vendor, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -568,15 +535,13 @@ gnc_plugin_business_cmd_employee_find_employee (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
GncEmployee *employee;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
employee = gncOwnerGetEmployee (priv->last_employee);
|
||||
employee = gncOwnerGetEmployee (plugin->last_employee);
|
||||
gnc_employee_search (GTK_WINDOW (mw->window), employee, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
@ -587,15 +552,13 @@ gnc_plugin_business_cmd_employee_new_expense_voucher (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), priv->last_employee, gnc_get_current_book ());
|
||||
gnc_ui_invoice_new (GTK_WINDOW (mw->window), plugin->last_employee, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -605,15 +568,13 @@ gnc_plugin_business_cmd_employee_find_expense_voucher (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
last_window = mw->window;
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, priv->last_employee, gnc_get_current_book ());
|
||||
gnc_invoice_search (GTK_WINDOW (mw->window), NULL, plugin->last_employee, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -623,14 +584,12 @@ gnc_plugin_business_cmd_employee_process_payment (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin;
|
||||
GncPluginBusinessPrivate *priv;
|
||||
|
||||
g_return_if_fail (mw != NULL);
|
||||
g_return_if_fail (GNC_IS_PLUGIN_BUSINESS (mw->data));
|
||||
|
||||
plugin = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin);
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), priv->last_employee, gnc_get_current_book ());
|
||||
gnc_ui_payment_new (GTK_WINDOW (mw->window), plugin->last_employee, gnc_get_current_book ());
|
||||
}
|
||||
|
||||
static void
|
||||
@ -725,7 +684,6 @@ gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple,
|
||||
{
|
||||
GncMainWindowActionData *mw = user_data;
|
||||
GncPluginBusiness *plugin_business;
|
||||
GncPluginBusinessPrivate *plugin_business_priv;
|
||||
GncPluginPage *plugin_page;
|
||||
GNCSplitReg *gsr;
|
||||
SplitRegister *reg;
|
||||
@ -759,15 +717,14 @@ gnc_plugin_business_cmd_assign_payment (GSimpleAction *simple,
|
||||
g_return_if_fail(trans);
|
||||
|
||||
plugin_business = GNC_PLUGIN_BUSINESS (mw->data);
|
||||
plugin_business_priv = GNC_PLUGIN_BUSINESS_GET_PRIVATE (plugin_business);
|
||||
|
||||
have_owner = gncOwnerGetOwnerFromTxn (trans, &owner);
|
||||
if (have_owner)
|
||||
owner_p = &owner;
|
||||
else if (gnc_ui_payment_is_customer_payment(trans))
|
||||
owner_p = plugin_business_priv->last_customer;
|
||||
owner_p = plugin_business->last_customer;
|
||||
else
|
||||
owner_p = plugin_business_priv->last_vendor;
|
||||
owner_p = plugin_business->last_vendor;
|
||||
|
||||
gnc_business_assign_payment (GTK_WINDOW (mw->window),
|
||||
trans, owner_p);
|
||||
|
@ -64,15 +64,7 @@ struct _GncPluginRegister
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginRegisterPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginRegisterPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_REGISTER_GET_PRIVATE(o) \
|
||||
((GncPluginRegisterPrivate*)gnc_plugin_register_get_instance_private((GncPluginRegister*)o))
|
||||
G_DEFINE_TYPE(GncPluginRegister, gnc_plugin_register, GNC_TYPE_PLUGIN)
|
||||
|
||||
static QofLogModule log_module = GNC_MOD_GUI;
|
||||
|
||||
|
@ -66,15 +66,7 @@ struct _GncPluginReportSystem
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginReportSystemPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginReportSystemPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginReportSystem, gnc_plugin_report_system, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_REPORT_SYSTEM_GET_PRIVATE(o) \
|
||||
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_REPORT_SYSTEM, GncPluginReportSystemPrivate))
|
||||
G_DEFINE_TYPE(GncPluginReportSystem, gnc_plugin_report_system, GNC_TYPE_PLUGIN)
|
||||
|
||||
/************************************************************
|
||||
* Object Implementation *
|
||||
|
@ -64,15 +64,7 @@ struct _GncPluginCsvExport
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginCsvExportPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginCsvExportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_CSV_EXPORT_GET_PRIVATE(o) \
|
||||
((GncPluginCsvExportPrivate*)gnc_plugin_csv_export_get_instance_private((GncPluginCsvExport*)o))
|
||||
G_DEFINE_TYPE(GncPluginCsvExport, gnc_plugin_csv_export, GNC_TYPE_PLUGIN)
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_csv_export_new (void)
|
||||
|
@ -63,15 +63,7 @@ struct _GncPluginCsvImport
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginCsvImportPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginCsvImportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_CSV_IMPORT_GET_PRIVATE(o) \
|
||||
((GncPluginCsvImportPrivate*)gnc_plugin_csv_import_get_instance_private((GncPluginCsvImport*)o))
|
||||
G_DEFINE_TYPE(GncPluginCsvImport, gnc_plugin_csv_import, GNC_TYPE_PLUGIN)
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_csv_import_new (void)
|
||||
|
@ -59,15 +59,7 @@ struct _GncPluginLogReplay
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginLogReplayPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginLogReplayPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginLogReplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_LOG_REPLAY_GET_PRIVATE(o) \
|
||||
((GncPluginLogReplayPrivate*)gnc_plugin_log_replay_get_instance_private((GncPluginLogReplay*)o))
|
||||
G_DEFINE_TYPE(GncPluginLogReplay, gnc_plugin_log_replay, GNC_TYPE_PLUGIN)
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_log_replay_new (void)
|
||||
|
@ -57,15 +57,7 @@ struct _GncPluginOfx
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginOfxPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginOfxPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_OFX_GET_PRIVATE(o) \
|
||||
((GncPluginOfxPrivate*)gnc_plugin_ofx_get_instance_private((GncPluginOfx*)o))
|
||||
G_DEFINE_TYPE(GncPluginOfx, gnc_plugin_ofx, GNC_TYPE_PLUGIN)
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_ofx_new (void)
|
||||
|
@ -59,15 +59,7 @@ struct _GncPluginQifImport
|
||||
GncPlugin gnc_plugin;
|
||||
};
|
||||
|
||||
typedef struct GncPluginQifImportPrivate
|
||||
{
|
||||
gpointer dummy;
|
||||
} GncPluginQifImportPrivate;
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN)
|
||||
|
||||
#define GNC_PLUGIN_QIF_IMPORT_GET_PRIVATE(o) \
|
||||
((GncPluginQifImportPrivate*)gnc_plugin_qif_import_get_instance_private((GncPluginQifImport*)o))
|
||||
G_DEFINE_TYPE(GncPluginQifImport, gnc_plugin_qif_import, GNC_TYPE_PLUGIN)
|
||||
|
||||
GncPlugin *
|
||||
gnc_plugin_qif_import_new (void)
|
||||
|
Loading…
Reference in New Issue
Block a user