Commit c841af98 authored by Danilo Galete's avatar Danilo Galete 💬
Browse files

Project change

parent 5c6364ea
......@@ -141,7 +141,7 @@ finance_transaction_view_controller_init (FinanceTransactionViewController *self
}
void
finance_controller_transactions_startup (FinanceControllerTransactions *self)
finance_transaction_view_controller_startup (FinanceTransactionViewController *self)
{
for(int x = 0; x < 50; x++)
{
......@@ -179,22 +179,17 @@ finance_controller_transactions_startup (FinanceControllerTransactions *self)
"selected",
G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
finance_summary_child_set_color (FINANCE_SUMMARY_CHILD (summary),
color);
finance_summary_child_set_icon (FINANCE_SUMMARY_CHILD (summary), "ID");
finance_summary_child_set_name (FINANCE_SUMMARY_CHILD (summary),
"Cadastro para Teste");
finance_summary_child_set_amount (FINANCE_SUMMARY_CHILD (summary),
"R$ 500,00");
finance_view_insert_child (FINANCE_VIEW (self->view_transactions), summary);
finance_view_add_child (FINANCE_VIEW (self->view), summary);
finance_left_panel_prepend_row (FINANCE_LEFT_PANEL (self->pane), row);
finance_left_panel_add_row (FINANCE_LEFT_PANEL (self->pane), row);
g_clear_pointer (&color, gdk_rgba_free);
}
......
......@@ -55,7 +55,7 @@ struct _FinanceTransactionEditor
GSettings *settings;
FinanceTransaction type;
FinanceTransaction transaction;
};
G_DEFINE_TYPE (FinanceTransactionEditor, finance_transaction_editor, GTK_TYPE_GRID)
......@@ -77,7 +77,7 @@ enum {
PROP_PAYMENT,
PROP_PAYMENT_INFORMATION,
PROP_REPEAT,
PROP_TYPE,
PROP_TRANSACTION,
N_PROPS
};
......@@ -280,8 +280,8 @@ finance_transaction_editor_get_property (GObject *object,
g_value_set_enum (value, finance_transaction_editor_get_repeat (self));
break;
case PROP_TYPE:
g_value_set_enum (value, finance_transaction_editor_get_type (self));
case PROP_TRANSACTION:
g_value_set_enum (value, finance_transaction_editor_get_transaction (self));
break;
default:
......@@ -360,8 +360,8 @@ finance_transaction_editor_set_property (GObject *object,
finance_transaction_editor_set_repeat (self, g_value_get_enum (value));
break;
case PROP_TYPE:
finance_transaction_editor_set_type (self, g_value_get_enum (self));
case PROP_TRANSACTION:
finance_transaction_editor_set_transaction (self, g_value_get_enum (self));
break;
default:
......@@ -545,16 +545,16 @@ finance_transaction_editor_class_init (FinanceTransactionEditorClass *klass)
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransactionEditor::type:
* FinanceTransactionEditor::transaction:
*
* The transaction type
*/
properties[PROP_TYPE] = g_param_spec_enum ("type",
"The type",
"The transaction type",
FINANCE_TYPE_TRANSACTION,
FINANCE_CREDIT,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_TRANSACTION] = g_param_spec_enum ("transaction",
"The transaction",
"The transaction type",
FINANCE_TYPE_TRANSACTION,
FINANCE_CREDIT,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, properties);
......@@ -662,6 +662,12 @@ finance_transaction_editor_set_amount (FinanceTransactionEditor *self,
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_AMOUNT]);
}
/**
* finance_transaction_editor_get_category:
* @self: #FinanceTransactionEditor
*
* Returns the category id
/**
* finance_transaction_editor_get_date:
* @self: a #FinanceTransactionEditor
......@@ -1187,7 +1193,7 @@ finance_transaction_editor_set_repeat (FinanceTransactionEditor *self,
}
/**
* finance_transaction_editor_get_type:
* finance_transaction_editor_get_transaction:
* @self: a #FinanceTransactionEditor
*
* Returns the transaction type
......@@ -1197,31 +1203,31 @@ finance_transaction_editor_set_repeat (FinanceTransactionEditor *self,
* Since: 1.0
*/
gint
finance_transaction_editor_get_type (FinanceTransactionEditor *self)
finance_transaction_editor_get_transaction (FinanceTransactionEditor *self)
{
g_return_val_if_fail (FINANCE_IS_TRANSACTION_EDITOR (self), -1);
return self->type;
return self->transaction;
}
/**
* finance_transaction_editor_set_type:
* finance_transaction_editor_set_transaction:
* @self: a #FinanceTransactionEditor
* @type: a #FinanceTransaction
* @transaction: a #FinanceTransaction
*
* Sets the transaction type
*
* Since: 1.0
*/
void
finance_transaction_editor_set_type (FinanceTransactionEditor *self,
gint type)
finance_transaction_editor_set_transaction (FinanceTransactionEditor *self,
gint transaction)
{
g_return_if_fail (FINANCE_IS_TRANSACTION_EDITOR (self));
self->type = type;
self->transaction = transaction;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TYPE]);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TRANSACTION]);
}
/**
......
......@@ -110,10 +110,10 @@ gint finance_transaction_editor_get_repeat (FinanceTr
void finance_transaction_editor_set_repeat (FinanceTransactionEditor *self,
gint repeat);
gint finance_transaction_editor_get_type (FinanceTransactionEditor *self);
gint finance_transaction_editor_get_transaction (FinanceTransactionEditor *self);
void finance_transaction_editor_set_type (FinanceTransactionEditor *self,
gint type);
void finance_transaction_editor_set_transaction (FinanceTransactionEditor *self,
gint transaction);
void finance_transaction_editor_clear (FinanceTransactionEditor *self);
......
......@@ -194,10 +194,10 @@ finance_window_init (FinanceWindow *self)
self->settings = g_settings_new ("org.gnome.finance");
self->controller_transactions = g_object_new (FINANCE_TYPE_CONTROLLER_TRANSACTIONS,
self->controller_transactions = g_object_new (FINANCE_TYPE_TRANSACTION_VIEW_CONTROLLER,
"pane", self->left_panel,
"view", self->transaction_view,
NULL);
finance_controller_transactions_startup (self->controller_transactions);
finance_transaction_view_controller_startup (self->controller_transactions);
}
/* finance-window.h
*
* Copyright 2020 galetedanilo
* Copyright 2020 - 2021 <galetedanilo@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......
......@@ -39,7 +39,7 @@ struct _FinanceTransactionRow
gchar *icon_text;
FinanceTransaction type;
FinanceTransaction transaction;
};
G_DEFINE_TYPE (FinanceTransactionRow, finance_transaction_row, GTK_TYPE_LIST_BOX_ROW)
......@@ -51,7 +51,7 @@ enum {
PROP_ICON_TEXT,
PROP_SELECTED,
PROP_TITLE,
PROP_TYPE,
PROP_TRANSACTION,
N_PROPS,
};
......@@ -154,8 +154,8 @@ finance_transaction_row_get_property (GObject *object,
g_value_set_string (value, finance_transaction_row_get_title (self));
break;
case PROP_TYPE:
g_value_set_enum (value, finance_transaction_row_get_type (self));
case PROP_TRANSACTION:
g_value_set_enum (value, finance_transaction_row_get_transaction (self));
break;
default:
......@@ -194,8 +194,8 @@ finance_transaction_row_set_property (GObject *object,
finance_transaction_row_set_title (self, g_value_get_string (value));
break;
case PROP_TYPE:
finance_transaction_row_set_type (self, g_value_get_enum(value));
case PROP_TRANSACTION:
finance_transaction_row_set_transaction (self, g_value_get_enum(value));
break;
default:
......@@ -271,16 +271,16 @@ finance_transaction_row_class_init (FinanceTransactionRowClass *klass)
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransactionRow::type:
* FinanceTransactionRow::transaction:
*
* The transaction type
*/
properties[PROP_TYPE] = g_param_spec_enum ("type",
"The type",
"The transaction type",
FINANCE_TYPE_TRANSACTION,
FINANCE_CREDIT,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_TRANSACTION] = g_param_spec_enum ("transaction",
"The transaction",
"The transaction type",
FINANCE_TYPE_TRANSACTION,
FINANCE_CREDIT,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (object_class, N_PROPS, properties);
......@@ -520,7 +520,7 @@ finance_transaction_row_set_title (FinanceTransactionRow *self,
}
/**
* finance_transaction_row_get_type:
* finance_transaction_row_get_transaction:
* @self: a #FinanceTransactionRow
*
* Returns the transaction type
......@@ -530,29 +530,29 @@ finance_transaction_row_set_title (FinanceTransactionRow *self,
* Since: 1.0
*/
gint
finance_transaction_row_get_type (FinanceTransactionRow *self)
finance_transaction_row_get_transaction (FinanceTransactionRow *self)
{
g_return_val_if_fail (FINANCE_IS_TRANSACTION_ROW (self), -1);
return self->type;
return self->transaction;
}
/**
* finance_transaction_row_set_type:
* finance_transaction_row_set_transaction:
* @self: a #FinanceTransactionRow
* @type: a #FinanceTransaction
* @transaction: a #FinanceTransaction
*
* Sets the transaction type
*
* Since: 1.0
*/
void
finance_transaction_row_set_type (FinanceTransactionRow *self,
gint type)
finance_transaction_row_set_transaction (FinanceTransactionRow *self,
gint transaction)
{
g_return_if_fail (FINANCE_IS_TRANSACTION_ROW (self));
self->type = type;
self->transaction = transaction;
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TYPE]);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TRANSACTION]);
}
......@@ -58,10 +58,10 @@ const gchar * finance_transaction_row_get_title (FinanceTransactionRow
void finance_transaction_row_set_title (FinanceTransactionRow *self,
const gchar *title);
gint finance_transaction_row_get_type (FinanceTransactionRow *self);
gint finance_transaction_row_get_transaction (FinanceTransactionRow *self);
void finance_transaction_row_set_type (FinanceTransactionRow *self,
gint type);
void finance_transaction_row_set_transaction (FinanceTransactionRow *self,
gint transaction);
G_END_DECLS
......
......@@ -315,7 +315,7 @@ finance_summary_child_class_init (FinanceSummaryChildClass *klass)
* The transaction transaction
*/
properties[PROP_TRANSACTION] = g_param_spec_enum ("transaction",
"The type",
"The transaction",
"The transaction type",
FINANCE_TYPE_TRANSACTION,
FINANCE_CREDIT,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment