Commit 0ea720bc authored by Danilo Galete's avatar Danilo Galete 💬
Browse files

Change Project

parent e7f8e2d5
......@@ -27,8 +27,6 @@ struct _FinanceControllerTransactions
/* The Objects */
GObject *pane;
GObject *view_transactions;
GPtrArray *childs;
GPtrArray *rows;
};
......@@ -145,15 +143,22 @@ finance_controller_transactions_init (FinanceControllerTransactions *self)
void
finance_controller_transactions_startup (FinanceControllerTransactions *self)
{
for(int x = 0; x < 2; x++)
for(int x = 0; x < 200; x++)
{
//this is a test
GtkWidget *summary = finance_child_summary_new ();
GtkWidget *row = finance_pane_row_new ();
finance_pane_row_set_icon (row, "TR");
finance_pane_row_set_title (row, "Transaction Name Title");
finance_pane_row_set_amount (row, "R$2,540.45");
finance_child_summary_set_name (summary, "Teste");
finance_view_insert_child (FINANCE_VIEW (self->view_transactions), summary);
finance_pane_prepend_row (FINANCE_PANE (self->pane), row);
}
}
......@@ -26,7 +26,7 @@
#include "finance-pane.h"
#include "finance-pane-row.h"
#include "finance-view.h"
#include "finance-view-child.h"
#include "finance-child-summary.h"
G_BEGIN_DECLS
......
......@@ -27,11 +27,11 @@ struct _FinancePaneRow
GtkListBoxRow parent_instance;
/* The Widgets */
GtkWidget *image;
GtkWidget *title;
GtkWidget *amount;
GtkWidget *revealer;
GtkWidget *check;
GtkWidget *image;
GtkWidget *revealer;
GtkWidget *title;
GdkRGBA *color;
gchar *icon;
......@@ -41,11 +41,11 @@ G_DEFINE_TYPE (FinancePaneRow, finance_pane_row, GTK_TYPE_LIST_BOX_ROW)
enum {
PROP_0,
PROP_ICON,
PROP_COLOR,
PROP_TITLE,
PROP_AMOUNT,
PROP_COLOR,
PROP_ICON,
PROP_SELECTED,
PROP_TITLE,
N_PROPS,
};
......@@ -124,26 +124,26 @@ finance_pane_row_get_property (GObject *object,
switch (prop_id)
{
case PROP_ICON:
g_value_set_string (value, finance_pane_row_get_icon (self));
case PROP_AMOUNT:
g_value_set_string (value, finance_pane_row_get_amount (self));
break;
case PROP_COLOR:
g_value_set_boxed (value, finance_pane_row_get_color (self));
break;
case PROP_TITLE:
g_value_set_string (value, finance_pane_row_get_title (self));
break;
case PROP_AMOUNT:
g_value_set_string (value, finance_pane_row_get_amount (self));
case PROP_ICON:
g_value_set_string (value, finance_pane_row_get_icon (self));
break;
case PROP_SELECTED:
g_value_set_boolean (value, finance_pane_row_is_selected (self));
break;
case PROP_TITLE:
g_value_set_string (value, finance_pane_row_get_title (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -160,20 +160,20 @@ finance_pane_row_set_property (GObject *object,
switch (prop_id)
{
case PROP_ICON:
finance_pane_row_set_icon (self, g_value_get_string (value));
case PROP_AMOUNT:
finance_pane_row_set_amount (self, g_value_get_string (value));
break;
case PROP_COLOR:
finance_pane_row_set_color (self, g_value_get_boxed (value));
break;
case PROP_TITLE:
finance_pane_row_set_title (self, g_value_get_string (value));
case PROP_ICON:
finance_pane_row_set_icon (self, g_value_get_string (value));
break;
case PROP_AMOUNT:
finance_pane_row_set_amount (self, g_value_get_string (value));
case PROP_TITLE:
finance_pane_row_set_title (self, g_value_get_string (value));
break;
case PROP_SELECTED:
......@@ -211,15 +211,15 @@ finance_pane_row_class_init (FinancePaneRowClass *klass)
0);
/**
* FinancePaneRow::icon:
* FinancePaneRow::amount:
*
* The two letters that are part of the icon image
* The pane row amount
*/
properties[PROP_ICON] = g_param_spec_string ("icon",
"Icon",
"The two letters that are part of the icon image",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_AMOUNT] = g_param_spec_string ("amount",
"Amount",
"The pane row amount",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinancePaneRow::color:
......@@ -232,6 +232,17 @@ finance_pane_row_class_init (FinancePaneRowClass *klass)
GDK_TYPE_RGBA,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinancePaneRow::icon:
*
* The two letters that are part of the icon image
*/
properties[PROP_ICON] = g_param_spec_string ("icon",
"Icon",
"The two letters that are part of the icon image",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinancePaneRow::title:
*
......@@ -243,17 +254,6 @@ finance_pane_row_class_init (FinancePaneRowClass *klass)
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinancePaneRow::amount:
*
* The pane row amount
*/
properties[PROP_AMOUNT] = g_param_spec_string ("amount",
"Amount",
"The pane row amount",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinancePaneRow::selected
*
......
......@@ -41,9 +41,9 @@ G_DEFINE_TYPE (FinanceEntryMonetary, finance_entry_monetary, GTK_TYPE_ENTRY)
enum {
PROP_0,
PROP_AMOUNT,
PROP_FORMATTING,
PROP_DECIMAL_PLACES,
PROP_CURRENCY_SYMBOL,
PROP_DECIMAL_PLACES,
PROP_FORMATTING,
PROP_SYMBOL,
N_PROPS,
};
......@@ -260,16 +260,16 @@ finance_entry_monetary_get_property (GObject *object,
g_value_set_double (value, finance_entry_monetary_get_amount (self));
break;
case PROP_FORMATTING:
g_value_set_boolean (value, finance_entry_monetary_get_formatting (self));
case PROP_CURRENCY_SYMBOL:
g_value_set_boolean (value, finance_entry_monetary_get_currency_symbol (self));
break;
case PROP_DECIMAL_PLACES:
g_value_set_int (value, finance_entry_monetary_get_decimal_places (self));
break;
case PROP_CURRENCY_SYMBOL:
g_value_set_boolean (value, finance_entry_monetary_get_currency_symbol (self));
case PROP_FORMATTING:
g_value_set_boolean (value, finance_entry_monetary_get_formatting (self));
break;
case PROP_SYMBOL:
......@@ -296,16 +296,16 @@ finance_entry_monetary_set_property (GObject *object,
finance_entry_monetary_set_amount (self, g_value_get_double (value));
break;
case PROP_FORMATTING:
finance_entry_monetary_set_formatting (self, g_value_get_boolean (value));
case PROP_CURRENCY_SYMBOL:
finance_entry_monetary_set_currency_symbol (self, g_value_get_boolean (value));
break;
case PROP_DECIMAL_PLACES:
finance_entry_monetary_set_decimal_places (self, g_value_get_int (value));
break;
case PROP_CURRENCY_SYMBOL:
finance_entry_monetary_set_currency_symbol (self, g_value_get_boolean (value));
case PROP_FORMATTING:
finance_entry_monetary_set_formatting (self, g_value_get_boolean (value));
break;
case PROP_SYMBOL:
......@@ -342,16 +342,17 @@ finance_entry_monetary_class_init (FinanceEntryMonetaryClass *klass)
G_MAXDOUBLE,
0.0,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceEntryMonetary::formatting:
* FinanceEntryMonetary::currency-symbol:
*
* Enable automatic monetary formatting
* Enable automatic currency symbol
*/
properties[PROP_FORMATTING] = g_param_spec_boolean ("formatting",
"Enable automatic monetary formatting",
"Enable automatic monetary formatting",
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_CURRENCY_SYMBOL] = g_param_spec_boolean ("currency-symbol",
"Enable automatic currency symbol",
"Enable automatic currency symbol",
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceEntryMonetary::decimal-places:
......@@ -367,17 +368,18 @@ finance_entry_monetary_class_init (FinanceEntryMonetaryClass *klass)
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceEntryMonetary::currency-symbol:
* FinanceEntryMonetary::formatting:
*
* Enable automatic currency symbol
* Enable automatic monetary formatting
*/
properties[PROP_CURRENCY_SYMBOL] = g_param_spec_boolean ("currency-symbol",
"Enable automatic currency symbol",
"Enable automatic currency symbol",
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_FORMATTING] = g_param_spec_boolean ("formatting",
"Enable automatic monetary formatting",
"Enable automatic monetary formatting",
TRUE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
/**
* FinanceEntryMonetary::symbol-type:
*
* Sets currency symbol is local or international
......
......@@ -58,21 +58,21 @@ G_DEFINE_TYPE (FinanceTransaction, finance_transaction, GTK_TYPE_GRID)
enum {
PROP_0,
PROP_ICON,
PROP_COLOR,
PROP_NAME,
PROP_AMOUNT,
//PROP_CATEGORY,
PROP_COLOR,
PROP_DATE,
PROP_FREQUENCY,
PROP_FREQUENCY_DATE,
PROP_FREQUENCY_NUMBER,
PROP_ICON,
PROP_MOBILE,
PROP_NAME,
PROP_NOTES,
PROP_PAYEE_NAME,
PROP_PAYMENT,
PROP_PAYMENT_INFO,
//PROP_CATEGORY,
PROP_REPEAT,
PROP_FREQUENCY,
PROP_FREQUENCY_NUMBER,
PROP_FREQUENCY_DATE,
PROP_NOTES,
PROP_MOBILE,
N_PROPS
};
......@@ -214,24 +214,44 @@ finance_transaction_get_property (GObject *object,
switch (prop_id)
{
case PROP_ICON:
g_value_set_string (value, finance_transaction_get_icon (self));
case PROP_AMOUNT:
g_value_set_double (value, finance_transaction_get_amount (self));
break;
case PROP_COLOR:
g_value_set_boxed (value, finance_transaction_get_color (self));
break;
case PROP_NAME:
g_value_set_string (value, finance_transaction_get_name (self));
case PROP_DATE:
g_value_set_boxed (value, finance_transaction_get_date (self));
break;
case PROP_AMOUNT:
g_value_set_double (value, finance_transaction_get_amount (self));
case PROP_FREQUENCY:
g_value_set_enum (value, finance_transaction_get_frequency (self));
break;
case PROP_DATE:
g_value_set_boxed (value, finance_transaction_get_date (self));
case PROP_FREQUENCY_DATE:
g_value_set_boxed (value,finance_transaction_get_frequency_date (self));
break;
case PROP_FREQUENCY_NUMBER:
g_value_set_int (value, finance_transaction_get_frequency_number (self));
break;
case PROP_ICON:
g_value_set_string (value, finance_transaction_get_icon (self));
break;
case PROP_MOBILE:
g_value_set_boolean (value, finance_transaction_get_mobile (self));
break;
case PROP_NAME:
g_value_set_string (value, finance_transaction_get_name (self));
break;
case PROP_NOTES:
g_value_set_string (value, finance_transaction_get_notes (self));
break;
case PROP_PAYEE_NAME:
......@@ -250,26 +270,6 @@ finance_transaction_get_property (GObject *object,
g_value_set_enum (value, finance_transaction_get_repeat (self));
break;
case PROP_FREQUENCY:
g_value_set_enum (value, finance_transaction_get_frequency (self));
break;
case PROP_FREQUENCY_NUMBER:
g_value_set_int (value, finance_transaction_get_frequency_number (self));
break;
case PROP_FREQUENCY_DATE:
g_value_set_boxed (value,finance_transaction_get_frequency_date (self));
break;
case PROP_NOTES:
g_value_set_string (value, finance_transaction_get_notes (self));
break;
case PROP_MOBILE:
g_value_set_boolean (value, finance_transaction_get_mobile (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -286,24 +286,44 @@ finance_transaction_set_property (GObject *object,
switch (prop_id)
{
case PROP_ICON:
finance_transaction_set_icon (self, g_value_get_string (value));
case PROP_AMOUNT:
finance_transaction_set_amount (self, g_value_get_double (value));
break;
case PROP_COLOR:
finance_transaction_set_color (self, g_value_get_boxed (value));
break;
case PROP_NAME:
finance_transaction_set_name (self, g_value_get_string (value));
case PROP_DATE:
finance_transaction_set_date (self, g_value_get_boxed (value));
break;
case PROP_AMOUNT:
finance_transaction_set_amount (self, g_value_get_double (value));
case PROP_FREQUENCY:
finance_transaction_set_frequency (self, g_value_get_enum (value));
break;
case PROP_DATE:
finance_transaction_set_date (self, g_value_get_boxed (value));
case PROP_FREQUENCY_DATE:
finance_transaction_set_frequency_date (self, g_value_get_boxed (value));
break;
case PROP_FREQUENCY_NUMBER:
finance_transaction_set_frequency_number (self, g_value_get_int (value));
break;
case PROP_ICON:
finance_transaction_set_icon (self, g_value_get_string (value));
break;
case PROP_MOBILE:
finance_transaction_set_mobile (self, g_value_get_boolean (value));
break;
case PROP_NAME:
finance_transaction_set_name (self, g_value_get_string (value));
break;
case PROP_NOTES:
finance_transaction_set_notes (self, g_value_get_string (value));
break;
case PROP_PAYEE_NAME:
......@@ -322,26 +342,6 @@ finance_transaction_set_property (GObject *object,
finance_transaction_set_repeat (self, g_value_get_enum (value));
break;
case PROP_FREQUENCY:
finance_transaction_set_frequency (self, g_value_get_enum (value));
break;
case PROP_FREQUENCY_NUMBER:
finance_transaction_set_frequency_number (self, g_value_get_int (value));
break;
case PROP_FREQUENCY_DATE:
finance_transaction_set_frequency_date (self, g_value_get_boxed (value));
break;
case PROP_NOTES:
finance_transaction_set_notes (self, g_value_get_string (value));
break;
case PROP_MOBILE:
finance_transaction_set_mobile (self, g_value_get_boolean (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
......@@ -363,15 +363,17 @@ finance_transaction_class_init (FinanceTransactionClass *klass)
object_class->set_property = finance_transaction_set_property;
/**
* FinanceTransaction::icon:
* FinanceTransaction::amount:
*
* The two letters that are part of the icon image
* The transaction amount
*/
properties[PROP_ICON] = g_param_spec_string ("icon",
"Icon",
"The two letters that are part of the icon image",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_AMOUNT] = g_param_spec_double ("amount",
"Amount",
"The transaction amount",
-G_MINDOUBLE,
G_MAXDOUBLE,
0.0,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::color:
......@@ -384,6 +386,74 @@ finance_transaction_class_init (FinanceTransactionClass *klass)
GDK_TYPE_RGBA,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::date:
*
* The transaction date
*/
properties[PROP_DATE] = g_param_spec_boxed ("date",
"Date",
"The transaction date",
G_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::frequency:
*
* The transaction frequency
*/
properties[PROP_FREQUENCY] = g_param_spec_enum ("frequency",
"Frequency",
"The transaction frequency",
FINANCE_TYPE_FREQUENCY,
FINANCE_FOREVER,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::frequency_date:
*
* The date of the financial transaction frequency
*/
properties[PROP_FREQUENCY_DATE] = g_param_spec_boxed ("frequency-date",
"Fequency date",
"The date of the financial transaction frequency",
G_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::frequency_number:
*
* The number of frequency of transactions
*/
properties[PROP_FREQUENCY_NUMBER] = g_param_spec_int ("frequency-number",
"Frequency Number",
"The number of frequency of transactions",
2, 365, 2,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::icon:
*
* The two letters that are part of the icon image
*/
properties[PROP_ICON] = g_param_spec_string ("icon",
"Icon",
"The two letters that are part of the icon image",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::mobile:
*
* The transaction mobile
*/
properties[PROP_MOBILE] = g_param_spec_boolean ("mobile",
"Mobile",
"The transaction mobile",
FALSE,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::name:
*
......@@ -396,28 +466,16 @@ finance_transaction_class_init (FinanceTransactionClass *klass)
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::amount:
* FinanceTransaction::notes:
*
* The transaction amount
* The transaction notes information
*/
properties[PROP_AMOUNT] = g_param_spec_double ("amount",
"Amount",
"The transaction amount",
-G_MINDOUBLE,
G_MAXDOUBLE,
0.0,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
properties[PROP_NOTES] = g_param_spec_string ("notes",
"Notes",
"The transaction notes information",
NULL,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceTransaction::date:
*
* The transaction date
*/
properties[PROP_DATE] = g_param_spec_boxed ("date",
"Date",
"The transaction date",
G_TYPE_DATE_TIME,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);