Commit 77cbf5fa authored by Danilo Galete's avatar Danilo Galete 💬
Browse files

Change project

parent 3fa5f868
......@@ -20,37 +20,37 @@
#include "finance-enum-types.h"
// /**
// * FinanceTransaction:
// * @FINANCE_CREDIT:
// * @FINANCE_DEBIT:
// *
// * Enum with available transactions type
// */
// typedef enum
// {
// FINANCE_CREDIT,
// FINANCE_DEBIT,
// } FinanceTransaction;
/**
* FinanceTransaction:
* @FINANCE_CREDIT:
* @FINANCE_DEBIT:
*
* Enum with available transactions type
*/
typedef enum
{
FINANCE_CREDIT,
FINANCE_DEBIT,
} FinanceTransaction;
/**
* FinanceRepeat:
* @FINANCE_NO_REPEAT:
* @FINANCE_DAILY:
* @FINANCE_MONDAY_FRIDAY:
* @FINANCE_WEEKLY:
* @FINANCE_MONTHLY:
* @FINANCE_NO_REPEAT:
* @FINANCE_WEEKLY:
* @FINANCE_YEARLY:
*
* Enum with available repetitions
*/
typedef enum
{
FINANCE_NO_REPEAT,
FINANCE_DAILY,
FINANCE_MONDAY_FRIDAY,
FINANCE_WEEKLY,
FINANCE_MONTHLY,
FINANCE_NO_REPEAT,
FINANCE_WEEKLY,
FINANCE_YEARLY,
} FinanceRepeat;
......@@ -72,39 +72,39 @@ typedef enum
/**
* FinancePayment:
* @FINANCE_CASH:
* @FINANCE_DIRECT_DEBIT:
* @FINANCE_TRANSFER:
* @FINANCE_DEBIT_CARD:
* @FINANCE_CHECK:
* @FINANCE_CREDIT_CARD:
* @FINANCE_ELECTRONIC_PAYMENT:
* @FINANCE_DEBIT_CARD:
* @FINANCE_DEPOSIT:
* @FINANCE_CHECK:
* @FINANCE_DIRECT_DEBIT:
* @FINANCE_ELECTRONIC_PAYMENT:
* @FINANCE_TRANSFER:
*
* Enum with available payments
*/
typedef enum
{
FINANCE_CASH,
FINANCE_DIRECT_DEBIT,
FINANCE_TRANSFER,
FINANCE_DEBIT_CARD,
FINANCE_CHECK,
FINANCE_CREDIT_CARD,
FINANCE_ELECTRONIC_PAYMENT,
FINANCE_DEBIT_CARD,
FINANCE_DEPOSIT,
FINANCE_CHECK,
FINANCE_DIRECT_DEBIT,
FINANCE_ELECTRONIC_PAYMENT,
FINANCE_TRANSFER,
} FinancePayment;
/**
* FinanceSymbol:
* @FINANCE_LOCAL_SYMBOL:
* @FINANCE_INTERNATIONAL_SYMBOL:
* @FINANCE_LOCAL_SYMBOL:
*
* Enum with available symbols
*/
typedef enum
{
FINANCE_LOCAL,
FINANCE_INTERNATIONAL,
FINANCE_LOCAL,
} FinanceSymbol;
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/finance/transaction">
<file compressed="true">finance-transaction.ui</file>
<gresource prefix="/org/gnome/finance/editor">
<file compressed="true">finance-transaction-editor.ui</file>
</gresource>
</gresources>
/* finance-transaction-editor.h
*
* Copyright 2020 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_TRANSACTION_EDITOR_H__
#define __FINANCE_TRANSACTION_EDITOR_H__
#include <gtk/gtk.h>
#include "finance-entry-date.h"
#include "finance-entry-monetary.h"
#include "finance-utils.h"
G_BEGIN_DECLS
#define FINANCE_TYPE_TRANSACTION_EDITOR (finance_transaction_editor_get_type())
G_DECLARE_FINAL_TYPE (FinanceTransactionEditor, finance_transaction_editor, FINANCE, TRANSACTION_EDITOR, GtkGrid)
GtkWidget * finance_transaction_editor_new (void);
gdouble finance_transaction_editor_get_amount (FinanceTransactionEditor *self);
void finance_transaction_editor_set_amount (FinanceTransactionEditor *self,
gdouble amount);
gint finance_transaction_editor_get_category (FinanceTransactionEditor *self);
void finance_transaction_editor_set_category (FinanceTransactionEditor *self,
gint id_category);
GdkRGBA * finance_transaction_editor_get_color (FinanceTransactionEditor *self);
void finance_transaction_editor_set_color (FinanceTransactionEditor *self,
const GdkRGBA *color);
const gchar * finance_transaction_editor_get_date (FinanceTransactionEditor *self);
void finance_transaction_editor_set_date (FinanceTransactionEditor *self,
const gchar *date);
gint finance_transaction_editor_get_frequency (FinanceTransactionEditor *self);
void finance_transaction_editor_set_frequency (FinanceTransactionEditor *self,
gint frequency);
const gchar * finance_transaction_editor_get_frequency_date (FinanceTransactionEditor *self);
void finance_transaction_editor_set_frequency_date (FinanceTransactionEditor *self,
const gchar *date);
gint finance_transaction_editor_get_frequency_number (FinanceTransactionEditor *self);
void finance_transaction_editor_set_frequency_number (FinanceTransactionEditor *self,
gint frequency_number);
const gchar * finance_transaction_editor_get_icon (FinanceTransactionEditor *self);
void finance_transaction_editor_set_icon (FinanceTransactionEditor *self,
const gchar *icon);
gboolean finance_transaction_editor_get_mobile (FinanceTransactionEditor *self);
void finance_transaction_editor_set_mobile (FinanceTransactionEditor *self,
gboolean mobile);
const gchar * finance_transaction_editor_get_name (FinanceTransactionEditor *self);
void finance_transaction_editor_set_name (FinanceTransactionEditor *self,
const gchar *name);
const gchar * finance_transaction_editor_get_notes (FinanceTransactionEditor *self);
void finance_transaction_editor_set_notes (FinanceTransactionEditor *self,
const gchar *notes);
const gchar * finance_transaction_editor_get_payee_name (FinanceTransactionEditor *self);
void finance_transaction_editor_set_payee_name (FinanceTransactionEditor *self,
const gchar *payee_name);
gint finance_transaction_editor_get_payment (FinanceTransactionEditor *self);
void finance_transaction_editor_set_payment (FinanceTransactionEditor *self,
gint payment);
const gchar * finance_transaction_editor_get_payment_information (FinanceTransactionEditor *self);
void finance_transaction_editor_set_payment_information (FinanceTransactionEditor *self,
const gchar *information);
gint finance_transaction_editor_get_repeat (FinanceTransactionEditor *self);
void finance_transaction_editor_set_repeat (FinanceTransactionEditor *self,
gint repeat);
void finance_transaction_editor_clear (FinanceTransactionEditor *self);
G_END_DECLS
#endif /* __FINANCE_TRANSACTION_EDITOR_H__ */
......@@ -10,7 +10,7 @@
</object>
<object class="GtkTextBuffer" id="buffer_notes"/>
<!-- n-columns=3 n-rows=10 -->
<template class="FinanceTransaction" parent="GtkGrid">
<template class="FinanceTransactionEditor" parent="GtkGrid">
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="halign">center</property>
......@@ -233,7 +233,7 @@
<item id="4" translatable="yes">Monthly</item>
<item id="5" translatable="yes">Yearly</item>
</items>
<signal name="changed" handler="on_combo_repeat_changed" swapped="no"/>
<signal name="changed" handler="on_combo_box_repeat_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">1</property>
......@@ -271,7 +271,7 @@
<item id="1" translatable="yes">N°. of Occurrences</item>
<item id="2" translatable="yes">Until Date</item>
</items>
<signal name="changed" handler="on_combo_frequency_changed" swapped="no"/>
<signal name="changed" handler="on_combo_box_frequency_changed" swapped="no"/>
</object>
<packing>
<property name="left-attach">2</property>
......
finance_incs += include_directories('entries')
built_sources += gnome.compile_resources(
'transaction-resouces',
'transaction.gresource.xml',
c_name: 'transaction',
'editor-resouces',
'editor.gresource.xml',
c_name: 'editor',
)
sources += files(
'finance-transaction.c',
'finance-transaction-editor.c',
)
subdir('entries')
......@@ -34,10 +34,10 @@ struct _FinanceWindow
GtkWidget *label_title;
GtkWidget *leaflet;
GtkWidget *left_panel;
GtkWidget *scrolled_window_transaction;
GtkWidget *scrolled_window_transaction_editor;
GtkWidget *stack;
GtkWidget *stack_switcher_top;
GtkWidget *transaction;
GtkWidget *transaction_editor;
GtkWidget *transaction_view;
GtkWidget *view_switcher_bottom;
......@@ -82,7 +82,7 @@ on_cancel_button_clicked (GtkButton *button,
hdy_squeezer_set_child_enabled (HDY_SQUEEZER (self->header_bar_squeezer),
self->stack_switcher_top, TRUE);
gtk_widget_set_sensitive (self->transaction, FALSE);
gtk_widget_set_sensitive (self->transaction_editor, FALSE);
gtk_label_set_text (GTK_LABEL (self->label_title), _("Finance"));
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "home");
}
......@@ -129,13 +129,12 @@ finance_window_prepare_new_transaction (FinanceWindow *self)
hdy_squeezer_set_child_enabled (HDY_SQUEEZER (self->header_bar_squeezer),
self->stack_switcher_top, FALSE);
finance_transaction_create_new (FINANCE_TRANSACTION (self->transaction));
finance_transaction_editor_clear (FINANCE_TRANSACTION_EDITOR (self->transaction_editor));
gtk_widget_set_sensitive (self->transaction, TRUE);
gtk_widget_set_sensitive (self->transaction_editor, TRUE);
gtk_label_set_text (GTK_LABEL (self->label_title), _("New"));
hdy_leaflet_set_visible_child (HDY_LEAFLET (self->leaflet), self->box_content);
gtk_stack_set_visible_child_name (GTK_STACK (self->stack), "transactions");
gtk_stack_set_visible_child (GTK_STACK (self->stack), self->scrolled_window_transaction);
gtk_stack_set_visible_child (GTK_STACK (self->stack), self->scrolled_window_transaction_editor);
}
static void
......@@ -155,7 +154,7 @@ finance_window_class_init (FinanceWindowClass *klass)
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_ensure (FINANCE_TYPE_LEFT_PANEL);
g_type_ensure (FINANCE_TYPE_TRANSACTION);
g_type_ensure (FINANCE_TYPE_TRANSACTION_EDITOR);
g_type_ensure (FINANCE_TYPE_TRANSACTION_VIEW);
G_OBJECT_CLASS (klass)->dispose = finance_window_dispose;
......@@ -170,10 +169,10 @@ finance_window_class_init (FinanceWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, label_title);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, leaflet);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, left_panel);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, scrolled_window_transaction);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, scrolled_window_transaction_editor);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, stack);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, stack_switcher_top);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, transaction);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, transaction_editor);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, transaction_view);
gtk_widget_class_bind_template_child (widget_class, FinanceWindow, view_switcher_bottom);
......
......@@ -24,7 +24,7 @@
#include "finance-controller-transactions.h"
#include "finance-left-panel.h"
#include "finance-transaction.h"
#include "finance-transaction-editor.h"
#include "finance-transaction-view.h"
G_BEGIN_DECLS
......
......@@ -136,7 +136,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="orientation">vertical</property>
<property name="sensitive" bind-source="transaction" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<property name="sensitive" bind-source="transaction_editor" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<child>
<object class="HdyHeaderBar" id="header_bar_left">
<property name="visible">True</property>
......@@ -304,7 +304,7 @@
<property name="visible">True</property>
<property name="can-focus">False</property>
<property name="centering-policy">strict</property>
<property name="show-close-button" bind-source="transaction" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<property name="show-close-button" bind-source="transaction_editor" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<child type="title">
<object class="HdySqueezer" id="header_bar_squeezer">
<property name="visible">True</property>
......@@ -339,7 +339,7 @@
<property name="receives-default">True</property>
<property name="tooltip-text" translatable="yes">Go back</property>
<property name="visible" bind-source="leaflet" bind-property="folded" bind-flags="sync-create">False</property>
<property name="sensitive" bind-source="transaction" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<property name="sensitive" bind-source="transaction_editor" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<signal name="clicked" handler="on_swipe_back_clicked" object="FinanceWindow" swapped="no"/>
<child>
<object class="GtkImage">
......@@ -365,7 +365,7 @@
<property name="tooltip-text" translatable="yes">Cancel</property>
<property name="valign">center</property>
<property name="use-underline">True</property>
<property name="visible" bind-source="transaction" bind-property="sensitive" bind-flags="sync-create">False</property>
<property name="visible" bind-source="transaction_editor" bind-property="sensitive" bind-flags="sync-create">False</property>
<signal name="clicked" handler="on_cancel_button_clicked" object="FinanceWindow" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="button_cancel-atkobject">
......@@ -389,7 +389,7 @@
<property name="tooltip-text" translatable="yes">Done</property>
<property name="valign">center</property>
<property name="use-underline">True</property>
<property name="visible" bind-source="transaction" bind-property="sensitive" bind-flags="sync-create">False</property>
<property name="visible" bind-source="transaction_editor" bind-property="sensitive" bind-flags="sync-create">False</property>
<signal name="clicked" handler="on_done_button_clicked" object="FinanceWindow" swapped="no"/>
<child internal-child="accessible">
<object class="AtkObject" id="button_done-atkobject">
......@@ -453,12 +453,12 @@
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="scrolled_window_transaction">
<object class="GtkScrolledWindow" id="scrolled_window_transaction_editor">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="hscrollbar-policy">never</property>
<child>
<object class="FinanceTransaction" id="transaction">
<object class="FinanceTransactionEditor" id="transaction_editor">
<property name="visible">True</property>
<property name="sensitive">False</property>
<property name="can-focus">True</property>
......@@ -478,7 +478,7 @@
<object class="HdyViewSwitcherBar" id="view_switcher_bottom">
<property name="can-focus">False</property>
<property name="stack">stack</property>
<property name="visible" bind-source="transaction" bind-property="sensitive" bind-flags="invert-boolean">True</property>
<property name="visible" bind-source="transaction_editor" bind-property="sensitive" bind-flags="invert-boolean">True</property>
</object>
<packing>
<property name="expand">False</property>
......
finance_incs += include_directories('transaction')
finance_incs += include_directories('editor')
finance_incs += include_directories('panel')
finance_incs += include_directories('views')
......@@ -15,6 +15,6 @@ sources += files(
'finance-window.c',
)
subdir('editor')
subdir('panel')
subdir('transaction')
subdir('views')
......@@ -42,7 +42,7 @@
<property name="ellipsize">end</property>
<property name="xalign">0</property>
<style>
<class name="pane-title"/>
<class name="panel-title"/>
</style>
</object>
<packing>
......@@ -119,7 +119,7 @@
<property name="selection-mode">none</property>
<signal name="row-activated" handler="on_list_box_row_activated" swapped="no"/>
<style>
<class name="pane"/>
<class name="panel"/>
</style>
</object>
</child>
......
/* finance-transaction.h
*
* Copyright 2020 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_TRANSACTION_H__
#define __FINANCE_TRANSACTION_H__
#include <gtk/gtk.h>
#include "finance-entry-date.h"
#include "finance-entry-monetary.h"
#include "finance-utils.h"
G_BEGIN_DECLS
#define FINANCE_TYPE_TRANSACTION (finance_transaction_get_type())
G_DECLARE_FINAL_TYPE (FinanceTransaction, finance_transaction, FINANCE, TRANSACTION, GtkGrid)
GtkWidget * finance_transaction_new (void);
const gchar * finance_transaction_get_icon (FinanceTransaction *self);
void finance_transaction_set_icon (FinanceTransaction *self,
const gchar *icon);
GdkRGBA * finance_transaction_get_color (FinanceTransaction *self);
void finance_transaction_set_color (FinanceTransaction *self,
const GdkRGBA *color);
const gchar * finance_transaction_get_name (FinanceTransaction *self);
void finance_transaction_set_name (FinanceTransaction *self,
const gchar *name);
gdouble finance_transaction_get_amount (FinanceTransaction *self);
void finance_transaction_set_amount (FinanceTransaction *self,
gdouble amount);
GDateTime * finance_transaction_get_date (FinanceTransaction *self);
void finance_transaction_set_date (FinanceTransaction *self,
GDateTime *date);
const gchar * finance_transaction_get_payee_name (FinanceTransaction *self);
void finance_transaction_set_payee_name (FinanceTransaction *self,
const gchar *payee_name);
gint finance_transaction_get_payment (FinanceTransaction *self);
void finance_transaction_set_payment (FinanceTransaction *self,
gint payment);
const gchar * finance_transaction_get_payment_info (FinanceTransaction *self);
void finance_transaction_set_payment_info (FinanceTransaction *self,
const gchar *payment_info);
gint finance_transaction_get_repeat (FinanceTransaction *self);
void finance_transaction_set_repeat (FinanceTransaction *self,
gint repeat);
gint finance_transaction_get_frequency (FinanceTransaction *self);
void finance_transaction_set_frequency (FinanceTransaction *self,
gint frequency);
gint finance_transaction_get_frequency_number(FinanceTransaction *self);
void finance_transaction_set_frequency_number(FinanceTransaction *self,
gint frequency_number);
GDateTime * finance_transaction_get_frequency_date (FinanceTransaction *self);
void finance_transaction_set_frequency_date (FinanceTransaction *self,
GDateTime *date);
const gchar * finance_transaction_get_notes (FinanceTransaction *self);
void finance_transaction_set_notes (FinanceTransaction *self,
const gchar *notes);
gboolean finance_transaction_get_mobile (FinanceTransaction *self);
void finance_transaction_set_mobile (FinanceTransaction *self,
gboolean mobile);
void finance_transaction_create_new (FinanceTransaction *self);
G_END_DECLS
#endif /* __FINANCE_TRANSACTION_H__ */
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