mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Realign source files gnc-tree-view-sx-list.*
This commit is contained in:
parent
631ac2b371
commit
5df19f4985
@ -4,19 +4,20 @@
|
|||||||
**/
|
**/
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
* This program is free software; you can redistribute it and/or *
|
* This program is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of version 2 and/or version 3 of the GNU General Public *
|
* modify it under the terms of version 2 and/or version 3 of the *
|
||||||
|
* GNU General Public *
|
||||||
* License as published by the Free Software Foundation. *
|
* License as published by the Free Software Foundation. *
|
||||||
*
|
* *
|
||||||
* As a special exception, permission is granted to link the binary
|
* As a special exception, permission is granted to link the binary *
|
||||||
* module resultant from this code with the OpenSSL project's
|
* module resultant from this code with the OpenSSL project's *
|
||||||
* "OpenSSL" library (or modified versions of it that use the same
|
* "OpenSSL" library (or modified versions of it that use the same *
|
||||||
* license as the "OpenSSL" library), and distribute the linked
|
* license as the "OpenSSL" library), and distribute the linked *
|
||||||
* executable. You must obey the GNU General Public License in all
|
* executable. You must obey the GNU General Public License in all *
|
||||||
* respects for all of the code used other than "OpenSSL". If you
|
* respects for all of the code used other than "OpenSSL". If you *
|
||||||
* modify this file, you may extend this exception to your version
|
* modify this file, you may extend this exception to your version *
|
||||||
* of the file, but you are not obligated to do so. If you do not
|
* of the file, but you are not obligated to do so. If you do not *
|
||||||
* wish to do so, delete this exception statement from your version
|
* wish to do so, delete this exception statement from your version *
|
||||||
* of this file.
|
* of this file. *
|
||||||
* *
|
* *
|
||||||
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||||
@ -47,8 +48,8 @@ static QofLogModule log_module = LOG_MOD;
|
|||||||
#undef G_LOG_DOMAIN
|
#undef G_LOG_DOMAIN
|
||||||
#define G_LOG_DOMAIN LOG_MOD
|
#define G_LOG_DOMAIN LOG_MOD
|
||||||
|
|
||||||
static void gnc_tree_view_sx_list_dispose(GObject *object);
|
static void gnc_tree_view_sx_list_dispose (GObject *object);
|
||||||
static void gnc_tree_view_sx_list_finalize(GObject *object);
|
static void gnc_tree_view_sx_list_finalize (GObject *object);
|
||||||
|
|
||||||
struct _GncTreeViewSxList
|
struct _GncTreeViewSxList
|
||||||
{
|
{
|
||||||
@ -61,12 +62,9 @@ struct _GncTreeViewSxList
|
|||||||
G_DEFINE_TYPE(GncTreeViewSxList, gnc_tree_view_sx_list, GNC_TYPE_TREE_VIEW)
|
G_DEFINE_TYPE(GncTreeViewSxList, gnc_tree_view_sx_list, GNC_TYPE_TREE_VIEW)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_tree_view_sx_list_class_init(GncTreeViewSxListClass *klass)
|
gnc_tree_view_sx_list_class_init (GncTreeViewSxListClass *klass)
|
||||||
{
|
{
|
||||||
GObjectClass *o_class;
|
GObjectClass *o_class = G_OBJECT_CLASS(klass);
|
||||||
|
|
||||||
|
|
||||||
o_class = G_OBJECT_CLASS (klass);
|
|
||||||
|
|
||||||
o_class->dispose = gnc_tree_view_sx_list_dispose;
|
o_class->dispose = gnc_tree_view_sx_list_dispose;
|
||||||
o_class->finalize = gnc_tree_view_sx_list_finalize;
|
o_class->finalize = gnc_tree_view_sx_list_finalize;
|
||||||
@ -79,81 +77,81 @@ gnc_tree_view_sx_list_init (GncTreeViewSxList *view)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_tree_view_sx_list_dispose(GObject *object)
|
gnc_tree_view_sx_list_dispose (GObject *object)
|
||||||
{
|
{
|
||||||
GncTreeViewSxList *view;
|
GncTreeViewSxList *view;
|
||||||
|
|
||||||
gnc_leave_return_if_fail (object != NULL);
|
gnc_leave_return_if_fail (object != NULL);
|
||||||
gnc_leave_return_if_fail (GNC_IS_TREE_VIEW_SX_LIST (object));
|
gnc_leave_return_if_fail (GNC_IS_TREE_VIEW_SX_LIST(object));
|
||||||
|
|
||||||
view = GNC_TREE_VIEW_SX_LIST (object);
|
view = GNC_TREE_VIEW_SX_LIST(object);
|
||||||
|
|
||||||
if (view->disposed)
|
if (view->disposed)
|
||||||
return;
|
return;
|
||||||
view->disposed = TRUE;
|
view->disposed = TRUE;
|
||||||
|
|
||||||
g_object_unref(G_OBJECT(view->tree_model));
|
g_object_unref (G_OBJECT(view->tree_model));
|
||||||
view->tree_model = NULL;
|
view->tree_model = NULL;
|
||||||
|
|
||||||
G_OBJECT_CLASS (gnc_tree_view_sx_list_parent_class)->dispose (object);
|
G_OBJECT_CLASS(gnc_tree_view_sx_list_parent_class)->dispose (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gnc_tree_view_sx_list_finalize(GObject *object)
|
gnc_tree_view_sx_list_finalize(GObject *object)
|
||||||
{
|
{
|
||||||
gnc_leave_return_if_fail(object != NULL);
|
gnc_leave_return_if_fail (object != NULL);
|
||||||
gnc_leave_return_if_fail(GNC_IS_TREE_VIEW_SX_LIST (object));
|
gnc_leave_return_if_fail (GNC_IS_TREE_VIEW_SX_LIST(object));
|
||||||
|
|
||||||
G_OBJECT_CLASS(gnc_tree_view_sx_list_parent_class)->finalize (object);
|
G_OBJECT_CLASS(gnc_tree_view_sx_list_parent_class)->finalize (object);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkTreeView*
|
GtkTreeView*
|
||||||
gnc_tree_view_sx_list_new(GncSxInstanceModel *sx_instances)
|
gnc_tree_view_sx_list_new (GncSxInstanceModel *sx_instances)
|
||||||
{
|
{
|
||||||
GncTreeViewSxList *view = (GncTreeViewSxList*)g_object_new(GNC_TYPE_TREE_VIEW_SX_LIST, NULL);
|
GncTreeViewSxList *view = (GncTreeViewSxList*)g_object_new (GNC_TYPE_TREE_VIEW_SX_LIST, NULL);
|
||||||
g_object_set(view, "name", "gnc-id-sx-list-tree", NULL);
|
g_object_set (view, "name", "gnc-id-sx-list-tree", NULL);
|
||||||
|
|
||||||
view->tree_model = GTK_TREE_MODEL(gnc_sx_list_tree_model_adapter_new(sx_instances));
|
view->tree_model = GTK_TREE_MODEL(gnc_sx_list_tree_model_adapter_new (sx_instances));
|
||||||
gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL(view->tree_model));
|
gtk_tree_view_set_model (GTK_TREE_VIEW(view), GTK_TREE_MODEL(view->tree_model));
|
||||||
|
|
||||||
GtkTreeViewColumn *col = gnc_tree_view_add_text_column(GNC_TREE_VIEW(view), _("Name"), "name", NULL,
|
GtkTreeViewColumn *col = gnc_tree_view_add_text_column (GNC_TREE_VIEW(view), _("Name"), "name", NULL,
|
||||||
"Semi-Monthly Paycheck",
|
"Semi-Monthly Paycheck",
|
||||||
SXLTMA_COL_NAME, -1, NULL);
|
SXLTMA_COL_NAME, -1, NULL);
|
||||||
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
||||||
|
|
||||||
col = gnc_tree_view_add_toggle_column(GNC_TREE_VIEW(view), _("Enabled"),
|
col = gnc_tree_view_add_toggle_column (GNC_TREE_VIEW(view), _("Enabled"),
|
||||||
C_("Single-character short column-title form of 'Enabled'", "E"),
|
C_("Single-character short column-title form of 'Enabled'", "E"),
|
||||||
"enabled", SXLTMA_COL_ENABLED,
|
"enabled", SXLTMA_COL_ENABLED,
|
||||||
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
|
GNC_TREE_VIEW_COLUMN_VISIBLE_ALWAYS,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
||||||
|
|
||||||
col = gnc_tree_view_add_text_column(GNC_TREE_VIEW(view), _("Frequency"), "frequency", NULL,
|
col = gnc_tree_view_add_text_column (GNC_TREE_VIEW(view), _("Frequency"), "frequency", NULL,
|
||||||
"Weekly (x3): -------",
|
"Weekly (x3): -------",
|
||||||
SXLTMA_COL_FREQUENCY, -1, NULL);
|
SXLTMA_COL_FREQUENCY, -1, NULL);
|
||||||
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
||||||
|
|
||||||
col = gnc_tree_view_add_text_column(GNC_TREE_VIEW(view), _("Last Occur"), "last-occur", NULL,
|
col = gnc_tree_view_add_text_column (GNC_TREE_VIEW(view), _("Last Occur"), "last-occur", NULL,
|
||||||
"2007-01-02",
|
"2007-01-02",
|
||||||
SXLTMA_COL_LAST_OCCUR, -1, NULL);
|
SXLTMA_COL_LAST_OCCUR, -1, NULL);
|
||||||
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
||||||
|
|
||||||
col = gnc_tree_view_add_text_column(GNC_TREE_VIEW(view), _("Next Occur"), "next-occur", NULL,
|
col = gnc_tree_view_add_text_column (GNC_TREE_VIEW(view), _("Next Occur"), "next-occur", NULL,
|
||||||
"2007-01-02",
|
"2007-01-02",
|
||||||
SXLTMA_COL_NEXT_OCCUR, -1, NULL);
|
SXLTMA_COL_NEXT_OCCUR, -1, NULL);
|
||||||
g_object_set_data(G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
g_object_set_data (G_OBJECT(col), DEFAULT_VISIBLE, GINT_TO_POINTER(1));
|
||||||
|
|
||||||
gnc_tree_view_configure_columns(GNC_TREE_VIEW(view));
|
gnc_tree_view_configure_columns (GNC_TREE_VIEW(view));
|
||||||
|
|
||||||
gtk_widget_show(GTK_WIDGET(view));
|
gtk_widget_show (GTK_WIDGET(view));
|
||||||
return GTK_TREE_VIEW(view);
|
return GTK_TREE_VIEW(view);
|
||||||
}
|
}
|
||||||
|
|
||||||
SchedXaction*
|
SchedXaction*
|
||||||
gnc_tree_view_sx_list_get_sx_from_path(GncTreeViewSxList *view, GtkTreePath *path)
|
gnc_tree_view_sx_list_get_sx_from_path (GncTreeViewSxList *view, GtkTreePath *path)
|
||||||
{
|
{
|
||||||
GtkTreeIter iter;
|
GtkTreeIter iter;
|
||||||
gtk_tree_model_get_iter(GTK_TREE_MODEL(view->tree_model), &iter, path);
|
gtk_tree_model_get_iter (GTK_TREE_MODEL(view->tree_model), &iter, path);
|
||||||
return gnc_sx_list_tree_model_adapter_get_sx_instances(
|
return gnc_sx_list_tree_model_adapter_get_sx_instances(
|
||||||
GNC_SX_LIST_TREE_MODEL_ADAPTER(view->tree_model), &iter)->sx;
|
GNC_SX_LIST_TREE_MODEL_ADAPTER(view->tree_model), &iter)->sx;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,8 @@
|
|||||||
**/
|
**/
|
||||||
/********************************************************************
|
/********************************************************************
|
||||||
* This program is free software; you can redistribute it and/or *
|
* This program is free software; you can redistribute it and/or *
|
||||||
* modify it under the terms of version 2 and/or version 3 of the GNU General Public *
|
* modify it under the terms of version 2 and/or version 3 of the *
|
||||||
|
* GNU General Public *
|
||||||
* License as published by the Free Software Foundation. *
|
* License as published by the Free Software Foundation. *
|
||||||
* *
|
* *
|
||||||
* This program is distributed in the hope that it will be useful, *
|
* This program is distributed in the hope that it will be useful, *
|
||||||
@ -37,12 +38,14 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
#define GNC_TYPE_TREE_VIEW_SX_LIST (gnc_tree_view_sx_list_get_type ())
|
#define GNC_TYPE_TREE_VIEW_SX_LIST (gnc_tree_view_sx_list_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (GncTreeViewSxList, gnc_tree_view_sx_list, GNC, TREE_VIEW_SX_LIST, GncTreeView)
|
G_DECLARE_FINAL_TYPE (GncTreeViewSxList, gnc_tree_view_sx_list,
|
||||||
|
GNC, TREE_VIEW_SX_LIST, GncTreeView)
|
||||||
|
|
||||||
GtkTreeView* gnc_tree_view_sx_list_new(GncSxInstanceModel *sx_instances);
|
GtkTreeView* gnc_tree_view_sx_list_new (GncSxInstanceModel *sx_instances);
|
||||||
|
|
||||||
SchedXaction* gnc_tree_view_sx_list_get_sx_from_path(GncTreeViewSxList *view, GtkTreePath *path);
|
SchedXaction* gnc_tree_view_sx_list_get_sx_from_path (GncTreeViewSxList *view,
|
||||||
|
GtkTreePath *path);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user