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

Change Project

parent 2088d57d
......@@ -139,7 +139,7 @@ finance_controller_transactions_class_init (FinanceControllerTransactionsClass *
static void
finance_controller_transactions_init (FinanceControllerTransactions *self)
{
self->child = g_ptr_array_new
//self->child = g_ptr_array_new
}
void
......@@ -154,6 +154,6 @@ finance_controller_transactions_startup (FinanceControllerTransactions *self)
finance_pane_row_set_title (row, "Transaction Name Title");
finance_pane_row_set_amount (row, "R$2,540.45");
finance_pane_add_row (FINANCE_PANE (self->pane), row);
finance_pane_prepend_row (FINANCE_PANE (self->pane), row);
}
}
......@@ -162,11 +162,22 @@ finance_pane_init (FinancePane *self)
FALSE);
}
/**
* finance_pane_prepend_row:
* @self: a #FinancePane instance.
* @row: a #GtkWidget to add.
*
* Prepend a widget to the list. If a sort function is set,
* the widget will actually be inserted at the calculated position
* and this function has the same effect of gtk_container_add().
*
* Since: 1.0
*/
void
finance_pane_add_row (FinancePane *self,
GtkWidget *row)
finance_pane_prepend_row (FinancePane *self,
GtkWidget *row)
{
g_return_if_fail (FINANCE_IS_PANE (self));
gtk_list_box_insert (GTK_LIST_BOX (self->list), row, -1);
gtk_list_box_prepend (GTK_LIST_BOX (self->list), row);
}
......@@ -33,7 +33,7 @@ G_DECLARE_FINAL_TYPE (FinancePane, finance_pane, FINANCE, PANE, GtkBox)
GtkWidget * finance_pane_new (void);
void finance_pane_add_row (FinancePane *self,
void finance_pane_prepend_row (FinancePane *self,
GtkWidget *row);
G_END_DECLS
......
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/transaction/entries">
<file compressed="true">finance-entry-date.ui</file>
<file compressed="true">finance-entry-monetary.ui</file>
</gresource>
</gresources>
......@@ -282,7 +282,7 @@ finance_entry_date_class_init (FinanceEntryDateClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/transaction/finance-entry-date.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/transaction/entries/finance-entry-date.ui");
/* The Widgets */
gtk_widget_class_bind_template_child (widget_class, FinanceEntryDate, calendar);
......
......@@ -74,7 +74,7 @@ filter_string (FinanceEntryMonetary *self)
}
static void
on_automatic_monetary_formatting (GtkEditable *editable,
on_monetary_automatic_formatting (GtkEditable *editable,
const gchar *text,
gint length,
gint *position,
......@@ -87,7 +87,7 @@ on_automatic_monetary_formatting (GtkEditable *editable,
if (g_unichar_type (aux_num) == G_UNICODE_DECIMAL_NUMBER)
{
g_signal_handlers_block_by_func (editable,
(gpointer) on_automatic_monetary_formatting,
(gpointer) on_monetary_automatic_formatting,
user_data);
gtk_editable_insert_text (editable,
......@@ -114,7 +114,7 @@ on_automatic_monetary_formatting (GtkEditable *editable,
}
g_signal_handlers_unblock_by_func (editable,
(gpointer) on_automatic_monetary_formatting,
(gpointer) on_monetary_automatic_formatting,
user_data);
}
......@@ -151,13 +151,13 @@ on_monetary_formatting (FinanceEntryMonetary *self)
}
g_signal_handlers_block_by_func (self,
(gpointer) on_automatic_monetary_formatting,
(gpointer) on_monetary_automatic_formatting,
self);
gtk_entry_set_text (GTK_ENTRY (self), money);
g_signal_handlers_unblock_by_func (self,
(gpointer) on_automatic_monetary_formatting,
(gpointer) on_monetary_automatic_formatting,
self);
}
......@@ -391,10 +391,10 @@ finance_entry_monetary_class_init (FinanceEntryMonetaryClass *klass)
g_object_class_install_properties (object_class, N_PROPS, properties);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/transaction/finance-entry-monetary.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/transaction/entries/finance-entry-monetary.ui");
/* The CallBacks */
gtk_widget_class_bind_template_callback (widget_class, on_automatic_monetary_formatting);
gtk_widget_class_bind_template_callback (widget_class, on_monetary_automatic_formatting);
}
static void
......@@ -488,9 +488,9 @@ finance_entry_monetary_set_formatting (FinanceEntryMonetary *self,
self->is_formatting = is_formatting;
if (self->is_formatting)
g_signal_handlers_unblock_by_func (self, on_automatic_monetary_formatting, self);
g_signal_handlers_unblock_by_func (self, on_monetary_automatic_formatting, self);
else
g_signal_handlers_block_by_func (self, on_automatic_monetary_formatting, self);
g_signal_handlers_block_by_func (self, on_monetary_automatic_formatting, self);
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_FORMATTING]);
}
......@@ -579,6 +579,7 @@ finance_entry_monetary_set_currency_symbol (FinanceEntryMonetary *self,
* finance_entry_monetary_get_symbol:
* @self: a #FinanceEntryMonetary instance.
*
* Returns the type of currency symbol in use.
*
* Returns: a #FinanceSymbol.
*
......
......@@ -6,6 +6,6 @@
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="input-purpose">digits</property>
<signal name="insert-text" handler="on_automatic_monetary_formatting" swapped="no"/>
<signal name="insert-text" handler="on_monetary_automatic_formatting" swapped="no"/>
</template>
</interface>
built_sources += gnome.compile_resources(
'entries-resources',
'entries.gresource.xml',
c_name: 'entries',
)
sources += files(
'finance-entry-date.c',
'finance-entry-monetary.c',
)
......@@ -1178,6 +1178,9 @@ finance_transaction_create_new (FinanceTransaction *self)
create_icon (self);
//Do not forget
finance_entry_monetary_set_amount (FINANCE_ENTRY_MONETARY (self->entry_amount), 0.0);
gtk_text_buffer_set_text (GTK_TEXT_BUFFER (self->buffer_notes),
self->notes, -1);
......
finance_incs += include_directories('entries')
built_sources += gnome.compile_resources(
'transaction-resouces',
'transaction.gresource.xml',
......@@ -5,7 +7,7 @@ built_sources += gnome.compile_resources(
)
sources += files(
'finance-entry-monetary.c',
'finance-entry-date.c',
'finance-transaction.c',
)
subdir('entries')
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/transaction">
<file compressed="true">finance-entry-date.ui</file>
<file compressed="true">finance-entry-monetary.ui</file>
<file compressed="true">finance-transaction.ui</file>
</gresource>
</gresources>
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