Commit 587adc20 authored by Danilo Galete's avatar Danilo Galete 💬
Browse files

Change project

parent a6da8678
......@@ -37,15 +37,15 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="708"
inkscape:window-height="712"
id="namedview6"
showgrid="false"
showguides="false"
inkscape:zoom="29.437191"
inkscape:cx="8.8460945"
inkscape:cy="6.6652838"
inkscape:zoom="4.2173091"
inkscape:cx="16.353864"
inkscape:cy="6.7832602"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:document-rotation="0"
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="16"
height="16"
version="1.1"
id="svg4"
sodipodi:docname="finance-direct-debit-symbolic.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)">
<metadata
id="metadata10">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs8" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1366"
inkscape:window-height="712"
id="namedview6"
showgrid="false"
showguides="false"
inkscape:zoom="29.437191"
inkscape:cx="8.8460945"
inkscape:cy="8.0185515"
inkscape:window-x="0"
inkscape:window-y="28"
inkscape:window-maximized="1"
inkscape:current-layer="layer1"
inkscape:document-rotation="0" />
<g
inkscape:groupmode="layer"
id="layer1"
inkscape:label="layer"
style="display:inline">
<path
id="rect8"
style="fill:#000000"
d="M 14.5625,5.3339844 V 11.785156 H 2.9472656 v 0.511719 H 14.5625 15.097656 V 11.785156 5.3339844 Z"
inkscape:label="base_one" />
<path
id="rect8-3"
style="display:inline;fill:#000000"
d="m 13.627235,4.522 v 6.451172 H 2.012 v 0.511719 h 11.615235 0.535156 V 10.973172 4.522 Z"
inkscape:label="base_two" />
<path
id="rect33"
style="fill:#000000;stroke-width:1.01988"
inkscape:label="base"
d="M 1.2050781 3.6855469 C 1.0388781 3.6855469 0.90625 3.8201281 0.90625 3.9863281 L 0.90625 10.386719 C 0.90625 10.552919 1.0388781 10.685547 1.2050781 10.685547 L 12.904297 10.685547 C 13.070497 10.685547 13.205078 10.552919 13.205078 10.386719 L 13.205078 3.9863281 C 13.205078 3.8201281 13.070497 3.6855469 12.904297 3.6855469 L 1.2050781 3.6855469 z M 1.3515625 4.1347656 L 12.759766 4.1347656 L 12.759766 10.238281 L 1.3515625 10.238281 L 1.3515625 4.1347656 z " />
<rect
style="fill:#000000;stroke:#ff0000;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:3.8"
id="rect840"
width="11.954517"
height="0.42682976"
x="1.1057074"
y="9.1984758" />
<path
id="rect842"
style="fill:#000000;stroke:#ff0000;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:3.8"
d="M 2.1191406 4.6445312 C 1.9529406 4.6445312 1.8183594 4.7791125 1.8183594 4.9453125 L 1.8183594 6.7792969 C 1.8183594 6.9454969 1.9529406 7.0800781 2.1191406 7.0800781 L 4.8417969 7.0800781 C 5.0079969 7.0800781 5.1425781 6.9454969 5.1425781 6.7792969 L 5.1425781 4.9453125 C 5.1425781 4.7791125 5.0079969 4.6445312 4.8417969 4.6445312 L 2.1191406 4.6445312 z M 2.1953125 5.0898438 L 4.765625 5.0898438 L 4.765625 6.6347656 L 2.1953125 6.6347656 L 2.1953125 5.0898438 z " />
<rect
style="fill:#000000;stroke:#ff0000;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:3.8"
id="rect848"
width="2.5898595"
height="0.3938719"
x="2.204077"
y="8.4350691" />
<rect
style="fill:#000000;stroke:#ff0000;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:3.8"
id="rect850"
width="2.5898595"
height="0.3938719"
x="5.204"
y="8.4350004" />
<rect
style="fill:#000000;stroke:#ff0000;stroke-width:0;stroke-linejoin:round;stroke-miterlimit:3.8"
id="rect852"
width="2.5898595"
height="0.3938719"
x="8.2040005"
y="8.4350004" />
<text
xml:space="preserve"
style="font-size:1px;line-height:1.25;font-family:sans-serif;-inkscape-font-specification:sans-serif"
x="8.9763622"
y="5.2442713"
id="text856"><tspan
sodipodi:role="line"
id="tspan854"
x="8.9763622"
y="5.2442713">Direct</tspan><tspan
sodipodi:role="line"
x="8.9763622"
y="6.4942713"
id="tspan858">Debit</tspan></text>
</g>
</svg>
<?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-date-entry.ui</file>
<file compressed="true">finance-entry-monetary.ui</file>
</gresource>
</gresources>
/* finance-entry-date.c
/* finance-date-entry.c
*
* Copyright 2020 galetedanilo <galetedanilo@gmail.com>
* Copyright 2020 - 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
......@@ -20,9 +20,9 @@
#include "finance-config.h"
#include "finance-entry-date.h"
#include "finance-date-entry.h"
struct _FinanceEntryDate
struct _FinanceDateEntry
{
GtkEntry parent_instance;
......@@ -35,7 +35,7 @@ struct _FinanceEntryDate
gboolean formatting;
};
G_DEFINE_TYPE (FinanceEntryDate, finance_entry_date, GTK_TYPE_ENTRY)
G_DEFINE_TYPE (FinanceDateEntry, finance_date_entry, GTK_TYPE_ENTRY)
enum {
PROP_0,
......@@ -47,7 +47,7 @@ enum {
static GParamSpec *properties[N_PROPS] = { NULL, };
static void
date_update (FinanceEntryDate *self)
date_update (FinanceDateEntry *self)
{
GDateTime *date_time;
GDate date;
......@@ -60,7 +60,7 @@ date_update (FinanceEntryDate *self)
{
date_time = g_date_time_new_now_local ();
finance_entry_date_set_date (self, date_time);
finance_date_entry_set_date (self, date_time);
gtk_entry_set_text (GTK_ENTRY (self), "");
......@@ -74,7 +74,7 @@ date_update (FinanceEntryDate *self)
g_date_get_day (&date),
0, 0, 0);
finance_entry_date_set_date (self, date_time);
finance_date_entry_set_date (self, date_time);
g_clear_pointer (&date_time, g_date_time_unref);
}
......@@ -123,7 +123,7 @@ on_entry_date_icon_press (GtkEntry *entry,
GdkEvent *event,
gpointer user_data)
{
FinanceEntryDate *self = FINANCE_ENTRY_DATE (user_data);
FinanceDateEntry *self = FINANCE_DATE_ENTRY (user_data);
(void)event;
......@@ -144,7 +144,7 @@ static void
on_calendar_day_selected (GtkCalendar *calendar,
gpointer user_data)
{
FinanceEntryDate *self = FINANCE_ENTRY_DATE (user_data);
FinanceDateEntry *self = FINANCE_DATE_ENTRY (user_data);
guint year, month, day;
gchar *format_date;
......@@ -174,46 +174,46 @@ on_calendar_day_selected (GtkCalendar *calendar,
}
GtkWidget *
finance_entry_date_new (void)
finance_date_entry_new (void)
{
return g_object_new (FINANCE_TYPE_ENTRY_DATE, NULL);
return g_object_new (FINANCE_TYPE_DATE_ENTRY, NULL);
}
static void
finance_entry_date_finalize (GObject *object)
finance_date_entry_finalize (GObject *object)
{
FinanceEntryDate *self = FINANCE_ENTRY_DATE (object);
FinanceDateEntry *self = FINANCE_DATE_ENTRY (object);
g_clear_pointer (&self->date_time, g_date_time_unref);
G_OBJECT_CLASS (finance_entry_date_parent_class)->finalize (object);
G_OBJECT_CLASS (finance_date_entry_parent_class)->finalize (object);
}
static gboolean
finance_entry_date_focus_out_event (GtkWidget *widget,
finance_date_entry_focus_out_event (GtkWidget *widget,
GdkEventFocus *event)
{
date_update (FINANCE_ENTRY_DATE (widget));
date_update (FINANCE_DATE_ENTRY (widget));
return GTK_WIDGET_CLASS (finance_entry_date_parent_class)->focus_out_event (widget, event);
return GTK_WIDGET_CLASS (finance_date_entry_parent_class)->focus_out_event (widget, event);
}
static void
finance_entry_date_get_property (GObject *object,
guint prop_id,
finance_date_entry_get_property (GObject *object,
guint prop_id,
GValue *value,
GParamSpec *pspec)
{
FinanceEntryDate *self = FINANCE_ENTRY_DATE (object);
FinanceDateEntry *self = FINANCE_DATE_ENTRY (object);
switch (prop_id)
{
case PROP_DATE:
g_value_set_boxed (value, finance_entry_date_get_date (self));
g_value_set_boxed (value, finance_date_entry_get_date (self));
break;
case PROP_FORMATTING:
g_value_set_boolean (value, finance_entry_date_get_formatting (self));
g_value_set_boolean (value, finance_date_entry_get_formatting (self));
break;
default:
......@@ -223,21 +223,21 @@ finance_entry_date_get_property (GObject *object,
}
static void
finance_entry_date_set_property (GObject *object,
guint prop_id,
finance_date_entry_set_property (GObject *object,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
FinanceEntryDate *self = FINANCE_ENTRY_DATE (object);
FinanceDateEntry *self = FINANCE_DATE_ENTRY (object);
switch (prop_id)
{
case PROP_DATE:
finance_entry_date_set_date (self, g_value_get_boxed (value));
finance_date_entry_set_date (self, g_value_get_boxed (value));
break;
case PROP_FORMATTING:
finance_entry_date_set_formatting (self, g_value_get_boolean (value));
finance_date_entry_set_formatting (self, g_value_get_boolean (value));
break;
default:
......@@ -247,21 +247,21 @@ finance_entry_date_set_property (GObject *object,
}
static void
finance_entry_date_class_init (FinanceEntryDateClass *klass)
finance_date_entry_class_init (FinanceDateEntryClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
object_class->finalize = finance_entry_date_finalize;
object_class->get_property = finance_entry_date_get_property;
object_class->set_property = finance_entry_date_set_property;
object_class->finalize = finance_date_entry_finalize;
object_class->get_property = finance_date_entry_get_property;
object_class->set_property = finance_date_entry_set_property;
widget_class->focus_out_event = finance_entry_date_focus_out_event;
widget_class->focus_out_event = finance_date_entry_focus_out_event;
/**
* FinanceEntryDate::date:
* FinanceDateEntry::date:
*
* The current date set.
* Sets the date time
*/
properties[PROP_DATE] = g_param_spec_boxed ("date",
"The current date set",
......@@ -270,7 +270,7 @@ finance_entry_date_class_init (FinanceEntryDateClass *klass)
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
* FinanceEntryDate::formatting:
* FinanceDateEntry::formatting:
*
* Enable automatic date formatting
*/
......@@ -282,11 +282,11 @@ 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/entries/finance-entry-date.ui");
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/finance/transaction/entries/finance-date-entry.ui");
/* The Widgets */
gtk_widget_class_bind_template_child (widget_class, FinanceEntryDate, calendar);
gtk_widget_class_bind_template_child (widget_class, FinanceEntryDate, popover);
gtk_widget_class_bind_template_child (widget_class, FinanceDateEntry, calendar);
gtk_widget_class_bind_template_child (widget_class, FinanceDateEntry, popover);
/* The CallBacks */
gtk_widget_class_bind_template_callback (widget_class, on_calendar_day_selected);
......@@ -295,7 +295,7 @@ finance_entry_date_class_init (FinanceEntryDateClass *klass)
}
static void
finance_entry_date_init (FinanceEntryDate *self)
finance_date_entry_init (FinanceDateEntry *self)
{
self->date_time = g_date_time_new_now_local ();
self->formatting = TRUE;
......@@ -304,37 +304,37 @@ finance_entry_date_init (FinanceEntryDate *self)
}
/**
* finance_entry_date_get_date:
* @self: a #FinanceEntryDate
* finance_date_entry_get_date:
* @self: a #FinanceDateEntry
*
* Get the value of the date.
* Get the value of the date
*
* Returns: (transfer none): a #GDateTime with the date.
* Returns: (transfer none): a #GDateTime with the date
*
* Since: 1.0
*/
GDateTime *
finance_entry_date_get_date (FinanceEntryDate *self)
finance_date_entry_get_date (FinanceDateEntry *self)
{
g_return_val_if_fail (FINANCE_IS_ENTRY_DATE (self), NULL);
g_return_val_if_fail (FINANCE_IS_DATE_ENTRY (self), NULL);
return self->date_time;
}
/**
* finance_entry_date_set_date:
* @self: a #FinanceEntryDate
* @date: a valid #GDateTime.
* finance_date_entry_set_date:
* @self: a #FinanceDateEntry
* @date: a valid #GDateTime
*
* Set the value of the entry date.
* Set the value of the entry date
*
* Since: 1.0
*/
void
finance_entry_date_set_date (FinanceEntryDate *self,
finance_date_entry_set_date (FinanceDateEntry *self,
GDateTime *date)
{
g_return_if_fail (FINANCE_IS_ENTRY_DATE (self));
g_return_if_fail (FINANCE_IS_DATE_ENTRY (self));
gint year, month, day;
......@@ -347,37 +347,37 @@ finance_entry_date_set_date (FinanceEntryDate *self,
}
/**
* finance_entry_date_get_formatting:
* @self: a #FinanceEntryDate
* finance_date_entry_get_formatting:
* @self: a #FinanceDateEntry
*
* Gets whether the formatting is in its “on” or “off” state.
* Gets whether the formatting is in its “on” or “off” state
*
* Returns: %TRUE if the automatic date formatting is active, and %FALSE otherwise.
* Returns: %TRUE if the automatic date formatting is active, and %FALSE otherwise
*
* Since: 1.0
*/
gboolean
finance_entry_date_get_formatting (FinanceEntryDate *self)
finance_date_entry_get_formatting (FinanceDateEntry *self)
{
g_return_val_if_fail (FINANCE_IS_ENTRY_DATE (self), FALSE);
g_return_val_if_fail (FINANCE_IS_DATE_ENTRY (self), FALSE);
return self->formatting;
}
/**
* finance_entry_date_set_formatting:
* @self: a #FinanceEntryDate
* @formatting: %TRUE if formatting should be active, and %FALSE otherwise.
* finance_date_entry_set_formatting:
* @self: a #FinanceDateEntry
* @formatting: %TRUE if formatting should be active, and %FALSE otherwise
*
* Change automatic date formatting states. %TRUE if formatting should be active, and %FALSE otherwise.
*
* Since: 1.0
*/
void
finance_entry_date_set_formatting (FinanceEntryDate *self,
gboolean formatting)
finance_date_entry_set_formatting (FinanceDateEntry *self,
gboolean formatting)
{
g_return_if_fail (FINANCE_IS_ENTRY_DATE (self));
g_return_if_fail (FINANCE_IS_DATE_ENTRY (self));
if (self->formatting == formatting)
return;
......
/* finance-entry-date.h
/* finance-date-entry.h
*
* Copyright 2020 galetedanilo <galetedanilo@gmail.com>
* Copyright 2020 - 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
......@@ -18,29 +18,29 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef __FINANCE_ENTRY_DATE_H__
#define __FINANCE_ENTRY_DATE_H__
#ifndef __FINANCE_DATE_ENTRY_H__
#define __FINANCE_DATE_ENTRY_H__
#include <gtk/gtk.h>
G_BEGIN_DECLS
#define FINANCE_TYPE_ENTRY_DATE (finance_entry_date_get_type ())
#define FINANCE_TYPE_DATE_ENTRY (finance_date_entry_get_type ())
G_DECLARE_FINAL_TYPE (FinanceEntryDate, finance_entry_date, FINANCE, ENTRY_DATE, GtkEntry)
G_DECLARE_FINAL_TYPE (FinanceDateEntry, finance_date_entry, FINANCE, DATE_ENTRY, GtkEntry)
GtkWidget * finance_entry_date_new (void);
GtkWidget * finance_date_entry_new (void);
GDateTime * finance_entry_date_get_date (FinanceEntryDate *self);
GDateTime * finance_date_entry_get_date (FinanceDateEntry *self);
void finance_entry_date_set_date (FinanceEntryDate *self,
void finance_date_entry_set_date (FinanceDateEntry *self,
GDateTime *date);
gboolean finance_entry_date_get_formatting (FinanceEntryDate *self);
gboolean finance_date_entry_get_formatting (FinanceDateEntry *self);
void finance_entry_date_set_formatting (FinanceEntryDate *self,
gboolean formatting);
void finance_date_entry_set_formatting (FinanceDateEntry *self,
gboolean formatting);
G_END_DECLS
#endif /* __FINANCE_ENTRY_DATE_H__ */
#endif /* __FINANCE_DATE_ENTRY_H__ */
......@@ -2,12 +2,10 @@
<!-- Generated with glade 3.38.1 -->
<interface>
<requires lib="gtk+" version="3.24"/>
<template class="FinanceEntryDate" parent="GtkEntry">
<template class="FinanceDateEntry" parent="GtkEntry">
<property name="visible">True</property>
<property name="can-focus">True</property>
<property name="double-buffered">False</property>
<property name="max-width-chars">10</property>
<property name="shadow-type">none</property>
<property name="secondary-icon-name">pan-down-symbolic</property>
<property name="input-purpose">digits</property>
<signal name="icon-press" handler="on_entry_date_icon_press" swapped="no"/>
......
......@@ -5,6 +5,6 @@ built_sources += gnome.compile_resources(
)
sources += files(
'finance-entry-date.c',
'finance-date-entry.c',
'finance-entry-monetary.c',
)
......@@ -354,8 +354,8 @@ finance_transaction_editor_class_init (FinanceTransactionEditorClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
g_type_ensure (FINANCE_TYPE_DATE_ENTRY);
g_type_ensure (FINANCE_TYPE_ENTRY_MONETARY);
g_type_ensure (FINANCE_TYPE_ENTRY_DATE);
object_class->finalize = finance_transaction_editor_finalize;
object_class->dispose = finance_transaction_editor_dispose;
......
......@@ -23,7 +23,7 @@
#include <gtk/gtk.h>
#include "finance-entry-date.h"
#include "finance-date-entry.h"
#include "finance-entry-monetary.h"
#include "finance-utils.h"
......
......@@ -37,6 +37,10 @@
<col id="0">finance-deposit-symbolic</col>
<col id="1" translatable="yes">Deposit</col>
</row>
<row>
<col id="0">finance-direct-debit-symbolic</col>
<col id="1" translatable="yes">Direct Debit</col>
</row>
<row>
<col id="0">finance-eletronic-payment-symbolic</col>
<col id="1" translatable="yes">Eletronic Payment</col>
......@@ -103,7 +107,7 @@
</packing>
</child>
<child>
<object class="FinanceEntryDate" id="entry_date">
<object class="FinanceDateEntry" id="entry_date">
<property name="height-request">40</property>
<property name="visible">True</property>
<property name="can-focus">True</property>
......@@ -315,7 +319,7 @@
</packing>
</child>
<child>
<object class="FinanceEntryDate" id="entry_frequency_date">
<object class="FinanceDateEntry" id="entry_frequency_date">
<property name="height-request">40</property>
<property name="visible">False</property>
<property name="can-focus">True</property>
......
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