gnucash maint: Multiple changes pushed
Geert Janssens
gjanssens at code.gnucash.org
Wed Sep 7 12:30:35 EDT 2016
Updated via https://github.com/Gnucash/gnucash/commit/07625b2f (commit)
via https://github.com/Gnucash/gnucash/commit/b12ce71c (commit)
from https://github.com/Gnucash/gnucash/commit/16845392 (commit)
commit 07625b2f7c701f0ff18818b2f7936250e1b91835
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Wed Sep 7 18:30:14 2016 +0200
Bug 733153 - Ambiguous view of buttons in search dialog Linux version
This changes the toggle buttons for check buttons, which are more appropriate for yes/no values.
diff --git a/src/gnome-search/search-boolean.c b/src/gnome-search/search-boolean.c
index 0a67de1..59dc2cb 100644
--- a/src/gnome-search/search-boolean.c
+++ b/src/gnome-search/search-boolean.c
@@ -107,7 +107,6 @@ gnc_search_boolean_class_init (GNCSearchBooleanClass *klass)
static void
gnc_search_boolean_init (GNCSearchBoolean *o)
{
- o->how = QOF_COMPARE_EQUAL;
o->value = TRUE;
}
@@ -143,14 +142,6 @@ gnc_search_boolean_set_value (GNCSearchBoolean *fi, gboolean value)
fi->value = value;
}
-void
-gnc_search_boolean_set_how (GNCSearchBoolean *fi, QofQueryCompare how)
-{
- g_return_if_fail (fi);
- g_return_if_fail (IS_GNCSEARCH_BOOLEAN (fi));
- fi->how = how;
-}
-
static gboolean
gncs_validate (GNCSearchCoreType *fe)
{
@@ -172,24 +163,9 @@ toggle_changed (GtkToggleButton *button, GNCSearchBoolean *fe)
}
static GtkWidget *
-make_menu (GNCSearchCoreType *fe)
-{
- GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
- GtkComboBox *combo;
-
- combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
- gnc_combo_box_search_add(combo, _("is"), QOF_COMPARE_EQUAL);
- gnc_combo_box_search_add(combo, _("is not"), QOF_COMPARE_NEQ);
- gnc_combo_box_search_changed(combo, &fi->how);
- gnc_combo_box_search_set_active(combo, fi->how ? fi->how : QOF_COMPARE_EQUAL);
-
- return GTK_WIDGET(combo);
-}
-
-static GtkWidget *
gncs_get_widget (GNCSearchCoreType *fe)
{
- GtkWidget *toggle, *menu, *box;
+ GtkWidget *toggle, *box;
GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
g_return_val_if_fail (fi, NULL);
@@ -197,12 +173,8 @@ gncs_get_widget (GNCSearchCoreType *fe)
box = gtk_hbox_new (FALSE, 3);
- /* Build and connect the option menu */
- menu = make_menu (fe);
- gtk_box_pack_start (GTK_BOX (box), menu, FALSE, FALSE, 3);
-
/* Build and connect the toggle */
- toggle = gtk_toggle_button_new_with_label (_("set true"));
+ toggle = gtk_check_button_new ();
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), fi->value);
g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fe);
gtk_box_pack_start (GTK_BOX (box), toggle, FALSE, FALSE, 3);
@@ -218,7 +190,7 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe)
g_return_val_if_fail (fi, NULL);
g_return_val_if_fail (IS_GNCSEARCH_BOOLEAN (fi), NULL);
- return qof_query_boolean_predicate (fi->how, fi->value);
+ return qof_query_boolean_predicate (QOF_COMPARE_EQUAL, fi->value);
}
static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
@@ -230,7 +202,6 @@ static GNCSearchCoreType *gncs_clone(GNCSearchCoreType *fe)
se = gnc_search_boolean_new ();
gnc_search_boolean_set_value (se, fse->value);
- gnc_search_boolean_set_how (se, fse->how);
return (GNCSearchCoreType *)se;
}
diff --git a/src/gnome-search/search-boolean.h b/src/gnome-search/search-boolean.h
index d7fb7c8..d7cfd07 100644
--- a/src/gnome-search/search-boolean.h
+++ b/src/gnome-search/search-boolean.h
@@ -37,7 +37,6 @@ struct _GNCSearchBoolean
{
GNCSearchCoreType parent;
- QofQueryCompare how;
gboolean value;
};
@@ -55,7 +54,6 @@ GNCSearchBoolean *gnc_search_boolean_new (void);
/* methods */
void gnc_search_boolean_set_value (GNCSearchBoolean *fi, gboolean val);
-void gnc_search_boolean_set_how (GNCSearchBoolean *fi, QofQueryCompare how);
#endif /* ! _GNCSEARCH_BOOLEAN_H */
diff --git a/src/gnome-search/search-reconciled.c b/src/gnome-search/search-reconciled.c
index 8390c45..609db6b 100644
--- a/src/gnome-search/search-reconciled.c
+++ b/src/gnome-search/search-reconciled.c
@@ -199,7 +199,7 @@ make_toggle (GNCSearchReconciled *fi, char *label, cleared_match_t option)
{
GtkWidget *toggle;
- toggle = gtk_toggle_button_new_with_label (label);
+ toggle = gtk_check_button_new_with_label (label);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (toggle), (fi->value & option));
g_object_set_data (G_OBJECT (toggle), "button-value", (gpointer) option);
g_signal_connect (G_OBJECT (toggle), "toggled", G_CALLBACK (toggle_changed), fi);
commit b12ce71c16873b80f190f98ab001a3671fb55fe1
Author: Geert Janssens <janssens-geert at telenet.be>
Date: Wed Sep 7 17:10:44 2016 +0200
Add small note the split action field is pre-filled by the business features
diff --git a/src/engine/Split.h b/src/engine/Split.h
index 9b0235b..e108b41 100644
--- a/src/engine/Split.h
+++ b/src/engine/Split.h
@@ -172,7 +172,8 @@ const char * xaccSplitGetMemo (const Split *split);
* It is meant to be a very short (one to ten character) string that
* signifies the "type" of this split, such as e.g. Buy, Sell, Div,
* Withdraw, Deposit, ATM, Check, etc. The idea is that this field
- * can be used to create custom reports or graphs of data. Rather than use
+ * can be used to create custom reports or graphs of data. Note that the
+ * business features auto-fill this value, but doesn't depend on it. Rather than use
* this function directly, see 'gnc_set_num_action' in
* engine/engine-helpers.c & .h which takes a user-set book option for selecting
* the source for the num-cell (the transaction-number or the split-action field)
Summary of changes:
src/engine/Split.h | 3 ++-
src/gnome-search/search-boolean.c | 35 +++--------------------------------
src/gnome-search/search-boolean.h | 2 --
src/gnome-search/search-reconciled.c | 2 +-
4 files changed, 6 insertions(+), 36 deletions(-)
More information about the gnucash-changes
mailing list