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

Change: Transactions View

parent ecadfc95
......@@ -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_TRANSACTION_VIEW_CONTROLLER,
// "pane", self->left_panel,
// "view", self->transaction_view,
// NULL);
self->controller_transactions = g_object_new (FINANCE_TYPE_TRANSACTION_VIEW_CONTROLLER,
"pane", self->left_panel,
"view", self->transaction_view,
NULL);
//finance_transaction_view_controller_startup (self->controller_transactions);
finance_transaction_view_controller_startup (self->controller_transactions);
}
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/views/children">
<file compressed="true">finance-summary-child.ui</file>
</gresource>
</gresources>
/* finance-summary-child.h
*
* Copyright 2021 galetedanilo <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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef __FINANCE_SUMMARY_CHILD_H__
#define __FINANCE_SUMMARY_CHILD_H__
#include <gtk/gtk.h>
#include "finance-utils.h"
G_BEGIN_DECLS
#define FINANCE_TYPE_SUMMARY_CHILD (finance_summary_child_get_type ())
G_DECLARE_FINAL_TYPE (FinanceSummaryChild, finance_summary_child, FINANCE, SUMMARY_CHILD, GtkGrid)
GtkWidget * finance_summary_child_new (void);
const gchar * finance_summary_child_get_amount (FinanceSummaryChild *self);
void finance_summary_child_set_amount (FinanceSummaryChild *self,
const gchar *amount);
const gchar * finance_summary_child_get_category (FinanceSummaryChild *self);
void finance_summary_child_set_category (FinanceSummaryChild *self,
const gchar *category);
const gchar * finance_summary_child_get_date (FinanceSummaryChild *self);
void finance_summary_child_set_date (FinanceSummaryChild *self,
const gchar *date);
const gchar * finance_summary_child_get_icon_name (FinanceSummaryChild *self);
void finance_summary_child_set_icon_name (FinanceSummaryChild *self,
const gchar *icon_name);
const gchar * finance_summary_child_get_name (FinanceSummaryChild *self);
void finance_summary_child_set_name (FinanceSummaryChild *self,
const gchar *name);
const gchar * finance_summary_child_get_payee_name (FinanceSummaryChild *self);
void finance_summary_child_set_payee_name (FinanceSummaryChild *self,
const gchar *payee_name);
const gchar * finance_summary_child_get_payment (FinanceSummaryChild *self);
void finance_summary_child_set_payment (FinanceSummaryChild *self,
const gchar *payment);
const gchar * finance_summary_child_get_repeat (FinanceSummaryChild *self);
void finance_summary_child_set_repeat (FinanceSummaryChild *self,
const gchar *repeat);
gboolean finance_summary_child_get_selected (FinanceSummaryChild *self);
void finance_summary_child_set_selected (FinanceSummaryChild *self,
gboolean selected);
gint finance_summary_child_get_transaction (FinanceSummaryChild *self);
void finance_summary_child_set_transaction (FinanceSummaryChild *self,
gint transaction);
G_END_DECLS
#endif /* __FINANCE_SUMMARY_CHILD_H__ */
built_sources += gnome.compile_resources(
'children-resources',
'children.gresource.xml',
c_name: 'children',
)
sources += files(
'finance-summary-child.c',
)
finance_incs += include_directories('children')
built_sources += gnome.compile_resources(
'views-resources',
'views.gresource.xml',
c_name: 'views',
)
finance_incs += include_directories('transactions')
sources += files(
'finance-view.c',
'finance-transaction-view.c',
)
subdir('children')
subdir('transactions')
/* finance-transactions-summary.h
*
* Copyright 2021 galetedanilo <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
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef __FINANCE_TRANSACTIONS_SUMMARY_H__
#define __FINANCE_TRANSACTIONS_SUMMARY_H__
#include <gtk/gtk.h>
#include "finance-utils.h"
G_BEGIN_DECLS
#define FINANCE_TYPE_TRANSACTIONS_SUMMARY (finance_transactions_summary_get_type ())
G_DECLARE_FINAL_TYPE (FinanceTransactionsSummary, finance_transactions_summary, FINANCE, TRANSACTIONS_SUMMARY, GtkGrid)
GtkWidget * finance_transactions_summary_new (void);
const gchar * finance_transactions_summary_get_amount (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_amount (FinanceTransactionsSummary *self,
const gchar *amount);
const gchar * finance_transactions_summary_get_category (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_category (FinanceTransactionsSummary *self,
const gchar *category);
const gchar * finance_transactions_summary_get_date (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_date (FinanceTransactionsSummary *self,
const gchar *date);
const gchar * finance_transactions_summary_get_icon_name (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_icon_name (FinanceTransactionsSummary *self,
const gchar *icon_name);
const gchar * finance_transactions_summary_get_payee_name (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_payee_name (FinanceTransactionsSummary *self,
const gchar *payee_name);
const gchar * finance_transactions_summary_get_payment (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_payment (FinanceTransactionsSummary *self,
const gchar *payment);
const gchar * finance_transactions_summary_get_repeat (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_repeat (FinanceTransactionsSummary *self,
const gchar *repeat);
gboolean finance_transactions_summary_get_selected (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_selected (FinanceTransactionsSummary *self,
gboolean selected);
const gchar * finance_transactions_summary_get_title (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_title (FinanceTransactionsSummary *self,
const gchar *title);
gint finance_transactions_summary_get_transaction (FinanceTransactionsSummary *self);
void finance_transactions_summary_set_transaction (FinanceTransactionsSummary *self,
gint transaction);
G_END_DECLS
#endif /* __FINANCE_TRANSACTIONS_SUMMARY_H__ */
......@@ -3,7 +3,7 @@
<interface>
<requires lib="gtk+" version="3.24"/>
<!-- n-columns=2 n-rows=2 -->
<template class="FinanceSummaryChild" parent="GtkGrid">
<template class="FinanceTransactionsSummary" parent="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">True</property>
<child>
......
/* finance-transaction-view.c
/* finance-transactions-view.c
*
* Copyright 2021 Danilo Fernandes Galete <galetedanilo@gmail.com>
*
......@@ -19,9 +19,9 @@
*/
#include "finance-view.h"
#include "finance-transaction-view.h"
#include "finance-transactions-view.h"
struct _FinanceTransactionView
struct _FinanceTransactionsView
{
GtkBox parent_instance;
......@@ -31,44 +31,44 @@ struct _FinanceTransactionView
static void finance_view_interface_init (FinanceViewInterface *iface);
G_DEFINE_TYPE_WITH_CODE (FinanceTransactionView, finance_transaction_view, GTK_TYPE_BOX,
G_DEFINE_TYPE_WITH_CODE (FinanceTransactionsView, finance_transactions_view, GTK_TYPE_BOX,
G_IMPLEMENT_INTERFACE (FINANCE_TYPE_VIEW, finance_view_interface_init))
/* FinanceView implementation */
static void
finance_transaction_view_add_child (FinanceView *view,
GtkWidget *child)
finance_transactions_view_add_child (FinanceView *view,
GtkWidget *child)
{
FinanceTransactionView *self = FINANCE_TRANSACTION_VIEW (view);
FinanceTransactionsView *self = FINANCE_TRANSACTIONS_VIEW (view);
gtk_flow_box_insert (GTK_FLOW_BOX (self->flow_box), child, -1);
}
GtkWidget *
finance_transaction_view_new (void)
finance_transactions_view_new (void)
{
return g_object_new (FINANCE_TYPE_TRANSACTION_VIEW, NULL);
return g_object_new (FINANCE_TYPE_TRANSACTIONS_VIEW, NULL);
}
static void
finance_view_interface_init (FinanceViewInterface *iface)
{
iface->add_child = finance_transaction_view_add_child;
iface->add_child = finance_transactions_view_add_child;
}
static void
finance_transaction_view_class_init (FinanceTransactionViewClass *klass)
finance_transactions_view_class_init (FinanceTransactionsViewClass *klass)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/views/finance-transaction-view.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/views/transactions/finance-transactions-view.ui");
/* The Widgets */
gtk_widget_class_bind_template_child (widget_class, FinanceTransactionView, flow_box);
gtk_widget_class_bind_template_child (widget_class, FinanceTransactionsView, flow_box);
}
static void
finance_transaction_view_init (FinanceTransactionView *self)
finance_transactions_view_init (FinanceTransactionsView *self)
{
gtk_widget_init_template (GTK_WIDGET (self));
}
/* finance-transaction-view.h
/* finance-transactions-view.h
*
* Copyright 2021 galetedanilo <galetedanilo@gmail.com>
*
......@@ -18,19 +18,19 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef __FINANCE_TRANSACTION_VIEW_H__
#define __FINANCE_TRANSACTION_VIEW_H__
#ifndef __FINANCE_TRANSACTIONS_VIEW_H__
#define __FINANCE_TRANSACTIONS_VIEW_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define FINANCE_TYPE_TRANSACTION_VIEW (finance_transaction_view_get_type())
#define FINANCE_TYPE_TRANSACTIONS_VIEW (finance_transactions_view_get_type())
G_DECLARE_FINAL_TYPE (FinanceTransactionView, finance_transaction_view, FINANCE, TRANSACTION_VIEW, GtkBox)
G_DECLARE_FINAL_TYPE (FinanceTransactionsView, finance_transactions_view, FINANCE, TRANSACTIONS_VIEW, GtkBox)
GtkWidget * finance_transaction_view_new (void);
GtkWidget * finance_transactions_view_new (void);
G_END_DECLS
#endif /* __FINANCE_TRANSACTION_VIEW_H__ */
#endif /* __FINANCE_TRANSACTIONS_VIEW_H__ */
......@@ -2,7 +2,7 @@
<!-- Generated with glade 3.38.2 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<template class="FinanceTransactionView" parent="GtkBox">
<template class="FinanceTransactionsView" parent="GtkBox">
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<child>
......
built_sources += gnome.compile_resources(
'transactions-resources',
'transactions.gresource.xml',
c_name: 'transactions',
)
sources += files(
'finance-transactions-summary.c',
'finance-transactions-view.c'
)
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/views/transactions">
<file compressed="true">finance-transactions-summary.ui</file>
<file compressed="true">finance-transactions-view.ui</file>
</gresource>
</gresources>
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/views">
<file compressed="true">finance-transaction-view.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