Merge branch 'fixes2' of https://github.com/Bob-IT/gnucash into unstable

This commit is contained in:
Geert Janssens 2018-04-14 17:23:21 +02:00
commit 3a46088ca8
8 changed files with 75 additions and 66 deletions

View File

@ -2046,9 +2046,10 @@ gnc_main_window_set_tab_ellipsize (GtkWidget *label, gint tab_width)
if (tab_width != 0)
{
if (g_utf8_strlen (lab_text, -1) < tab_width)
gint text_length = g_utf8_strlen (lab_text, -1);
if (text_length < tab_width)
{
gtk_label_set_width_chars (GTK_LABEL(label), strlen (lab_text));
gtk_label_set_width_chars (GTK_LABEL(label), text_length);
gtk_label_set_ellipsize (GTK_LABEL(label), PANGO_ELLIPSIZE_NONE);
}
else

View File

@ -350,6 +350,9 @@ gnc_query_view_init_view (GNCQueryView *qview)
else if (((GNCSearchParam *) param)->justify == GTK_JUSTIFY_RIGHT)
algn = 1.0;
/* Set the column title alignment to that of the column */
gtk_tree_view_column_set_alignment (col, algn);
/* Set column resizable */
if (((GNCSearchParam *) param)->non_resizeable)
{
@ -830,7 +833,8 @@ gnc_query_view_fill (GNCQueryView *qview)
if (qview->numeric_abs)
value = gnc_numeric_abs (value);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, i + 1, xaccPrintAmount (value, gnc_default_print_info (FALSE)), -1);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, i + 1,
xaccPrintAmount (value, gnc_default_print_info (FALSE)), -1);
}
else
{

View File

@ -170,7 +170,6 @@ gnc_reconcile_view_tooltip_cb (GNCQueryView *qview, gint x, gint y,
device_manager = gdk_display_get_device_manager (gdk_window_get_display (parent_window));
pointer = gdk_device_manager_get_client_pointer (device_manager);
#endif
gdk_window_get_device_position (parent_window, pointer, &cur_x, &cur_y, NULL);
gdk_window_get_origin (parent_window, &root_x, &root_y);
@ -214,7 +213,6 @@ gnc_reconcile_view_tooltip_cb (GNCQueryView *qview, gint x, gint y,
monitor_num = gdk_screen_get_monitor_at_point (screen, x, y);
gdk_screen_get_monitor_geometry (screen, monitor_num, &monitor);
#endif
if (x + requisition.width > monitor.x + monitor.width)
x -= x - (monitor.x + monitor.width) + requisition.width;
else if (x < monitor.x)
@ -262,7 +260,7 @@ gnc_reconcile_view_construct (GNCReconcileView *view, Query *query)
gnc_query_view_set_numerics (qview, TRUE, inv_sort);
/* Set the description field to have spare space */
col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), 2);
col = gtk_tree_view_get_column (GTK_TREE_VIEW (qview), 3);
gtk_tree_view_column_set_expand (col, TRUE);
/* Get the renderer of the description column and set ellipsize value */
@ -310,8 +308,8 @@ gnc_reconcile_view_new (Account *account, GNCReconcileViewType type,
/* Create the list store with 6 columns and add to treeview,
column 0 will be a pointer to the entry */
liststore = gtk_list_store_new (6, G_TYPE_POINTER, G_TYPE_STRING,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN );
liststore = gtk_list_store_new (6, G_TYPE_POINTER, G_TYPE_BOOLEAN,
G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING );
gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (liststore));
g_object_unref (liststore);
@ -389,14 +387,6 @@ gnc_reconcile_view_init (GNCReconcileView *view)
view->account = NULL;
view->sibling = NULL;
param = gnc_search_param_simple_new();
gnc_search_param_set_param_fcn (param, QOF_TYPE_BOOLEAN,
gnc_reconcile_view_is_reconciled, view);
gnc_search_param_set_title ((GNCSearchParam *) param, _("Reconciled:R") + 11);
gnc_search_param_set_justify ((GNCSearchParam *) param, GTK_JUSTIFY_CENTER);
gnc_search_param_set_passive ((GNCSearchParam *) param, TRUE);
gnc_search_param_set_non_resizeable ((GNCSearchParam *) param, TRUE);
columns = g_list_prepend (columns, param);
columns = gnc_search_param_prepend_with_justify (columns, _("Amount"),
GTK_JUSTIFY_RIGHT,
NULL, GNC_ID_SPLIT,
@ -416,6 +406,15 @@ gnc_reconcile_view_init (GNCReconcileView *view)
columns = gnc_search_param_prepend (columns, _("Date"), NULL, GNC_ID_SPLIT,
SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
param = gnc_search_param_simple_new();
gnc_search_param_set_param_fcn (param, QOF_TYPE_BOOLEAN,
gnc_reconcile_view_is_reconciled, view);
gnc_search_param_set_title ((GNCSearchParam *) param, _("Reconciled:R") + 11);
gnc_search_param_set_justify ((GNCSearchParam *) param, GTK_JUSTIFY_CENTER);
gnc_search_param_set_passive ((GNCSearchParam *) param, TRUE);
gnc_search_param_set_non_resizeable ((GNCSearchParam *) param, TRUE);
columns = g_list_prepend (columns, param);
view->column_list = columns;
}
@ -546,8 +545,8 @@ gnc_reconcile_view_toggle_children (Account *account, GNCReconcileView *view, Sp
if(pointer == other_split)
{
gboolean toggled;
gtk_tree_model_get (model, &iter, 5, &toggled, -1);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 5, !toggled, -1);
gtk_tree_model_get (model, &iter, 1, &toggled, -1);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 1, !toggled, -1);
break;
}
@ -661,9 +660,9 @@ gnc_reconcile_view_set_list ( GNCReconcileView *view, gboolean reconcile)
{
/* now iter is a valid row iterator */
gtk_tree_model_get (model, &iter, 0, &entry, -1);
gtk_tree_model_get (model, &iter, 5, &toggled, -1);
gtk_tree_model_get (model, &iter, 1, &toggled, -1);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 5, reconcile, -1);
gtk_list_store_set (GTK_LIST_STORE (model), &iter, 1, reconcile, -1);
if(reconcile != toggled)
gnc_reconcile_view_toggle (view, entry);
@ -710,7 +709,7 @@ gnc_reconcile_view_set_toggle (GNCReconcileView *view)
if(gtk_tree_model_get_iter(model, &iter, node->data))
{
/* now iter is a valid row iterator */
gtk_tree_model_get (model, &iter, 5, &toggled, -1);
gtk_tree_model_get (model, &iter, 1, &toggled, -1);
if(toggled)
num_toggled++;
@ -993,4 +992,3 @@ gnc_reconcile_view_changed (GNCReconcileView *view)
return g_hash_table_size (view->reconciled) != 0;
}

View File

@ -480,7 +480,8 @@ recnInterestXferWindow( startRecnWindowData *data)
{
gchar *title;
if ( !account_type_has_auto_interest_xfer( data->account_type ) ) return;
if ( !account_type_has_auto_interest_xfer( data->account_type ) )
return;
/* get a normal transfer dialog... */
data->xferData = gnc_xfer_dialog( GTK_WIDGET(data->startRecnWindow),
@ -1185,6 +1186,12 @@ gnc_reconcile_window_create_view_box(Account *account,
gtk_box_set_homogeneous (GTK_BOX (hbox), FALSE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
#if GTK_CHECK_VERSION(3,12,0)
gtk_widget_set_margin_end (GTK_WIDGET(hbox), 10);
#else
gtk_widget_set_margin_right (GTK_WIDGET(hbox), 10);
#endif
label = gtk_label_new(_("Total:"));
gnc_label_set_alignment(label, 1.0, 0.5);
gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
@ -1656,7 +1663,7 @@ recnWindow (GtkWidget *parent, Account *account)
enable_subaccounts))
return NULL;
return recnWindowWithBalance (parent, account, new_ending, statement_date);
return recnWindowWithBalance (account, new_ending, statement_date);
}
@ -1676,15 +1683,14 @@ recnWindow_add_widget (GtkUIManager *merge,
* Opens up the window to reconcile an account, but with ending
* balance and statement date already given.
*
* Args: parent - The parent widget of the new window
* account - The account to reconcile
* Args: account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* Return: recnData - the instance of this RecnWindow
\********************************************************************/
RecnWindow *
recnWindowWithBalance (GtkWidget *parent, Account *account,
gnc_numeric new_ending, time64 statement_date)
recnWindowWithBalance (Account *account, gnc_numeric new_ending,
time64 statement_date)
{
RecnWindow *recnData;
GtkWidget *statusbar;
@ -1918,8 +1924,6 @@ recnWindowWithBalance (GtkWidget *parent, Account *account,
/* Allow resize */
gtk_window_set_resizable(GTK_WINDOW(recnData->window), TRUE);
gtk_window_set_transient_for(GTK_WINDOW(recnData->window),
GTK_WINDOW (parent));
gtk_widget_show_all(recnData->window);
gnc_reconcile_window_set_titles(recnData);

View File

@ -52,14 +52,12 @@ RecnWindow *recnWindow (GtkWidget *parent, Account *account);
* Opens up the window to reconcile an account, but with ending
* balance and statement date already given.
*
* Args: parent - The parent widget of the new window
* account - The account to reconcile
* Args: account - The account to reconcile
* new_ending - The amount for ending balance
* statement_date - The date of the statement
* Return: recnData - the instance of this RecnWindow
\********************************************************************/
RecnWindow *recnWindowWithBalance (GtkWidget *parent,
Account *account,
RecnWindow *recnWindowWithBalance (Account *account,
gnc_numeric new_ending,
time64 statement_date);

View File

@ -35,7 +35,6 @@
</data>
</object>
<object class="GtkWindow" id="gnc_date_format_window">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="title" translatable="yes">Date Format</property>
<property name="resizable">False</property>

View File

@ -1060,7 +1060,7 @@ bal_accountinfo_cb(AB_IMEXPORTER_ACCOUNTINFO *element, gpointer user_data)
/* Show reconciliation window */
if (show_recn_window)
recnWindowWithBalance(data->parent, gnc_acc, value, booked_tt);
recnWindowWithBalance(gnc_acc, value, booked_tt);
return NULL;
}

View File

@ -92,6 +92,8 @@ gnc_entry_ledger_get_account_by_name (GncEntryLedger *ledger, BasicCell * bcell,
/* Find the account */
account = gnc_account_lookup_for_register (gnc_get_current_root_account (), name);
if (!account)
account = gnc_account_lookup_by_code (gnc_get_current_root_account(), name);
if (!account)
{
@ -116,13 +118,16 @@ gnc_entry_ledger_get_account_by_name (GncEntryLedger *ledger, BasicCell * bcell,
if (!account)
return NULL;
*isnew = TRUE;
}
/* Now have a new account. Update the cell with the name as created. */
account_name = gnc_get_account_name_for_register (account);
if (g_strcmp0(account_name, gnc_basic_cell_get_value(bcell)))
{
gnc_combo_cell_set_value (cell, account_name);
gnc_basic_cell_set_changed (&cell->cell, TRUE);
g_free (account_name);
}
g_free (account_name);
/* See if the account (either old or new) is a placeholder. */
if (xaccAccountGetPlaceholder (account))