mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix mistake in adding style context to Find Transactions dialog
Added another parameter to gnc_search_dialog_create to pass a style class so it can be added to the search dialog which resulted in updating other files as well.
This commit is contained in:
parent
ad6ad923df
commit
e5ca36cf55
@ -960,7 +960,8 @@ gnc_customer_search (GncCustomer *start, QofBook *book)
|
||||
return gnc_search_dialog_create (type, _("Find Customer"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_customer_cb, sw, free_userdata_cb,
|
||||
GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindCustomerDialog");
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
|
@ -762,7 +762,8 @@ gnc_employee_search (GncEmployee *start, QofBook *book)
|
||||
params, columns, q, q2,
|
||||
buttons, NULL, new_employee_cb,
|
||||
sw, free_employee_cb,
|
||||
GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindEmployeeDialog");
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
|
@ -3011,7 +3011,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
|
||||
GncOwnerType owner_type = GNC_OWNER_CUSTOMER;
|
||||
static GList *inv_params = NULL, *bill_params = NULL, *emp_params = NULL, *params;
|
||||
static GList *columns = NULL;
|
||||
const gchar *title, *label;
|
||||
const gchar *title, *label, *style_class;
|
||||
static GNCSearchCallbackButton *buttons;
|
||||
static GNCSearchCallbackButton inv_buttons[] =
|
||||
{
|
||||
@ -3251,18 +3251,21 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
|
||||
case GNC_OWNER_VENDOR:
|
||||
title = _("Find Bill");
|
||||
label = _("Bill");
|
||||
style_class = "GncFindBillDialog";
|
||||
params = bill_params;
|
||||
buttons = bill_buttons;
|
||||
break;
|
||||
case GNC_OWNER_EMPLOYEE:
|
||||
title = _("Find Expense Voucher");
|
||||
label = _("Expense Voucher");
|
||||
style_class = "GncFindExpenseVoucherDialog";
|
||||
params = emp_params;
|
||||
buttons = emp_buttons;
|
||||
break;
|
||||
default:
|
||||
title = _("Find Invoice");
|
||||
label = _("Invoice");
|
||||
style_class = "GncFindInvoiceDialog";
|
||||
params = inv_params;
|
||||
buttons = inv_buttons;
|
||||
break;
|
||||
@ -3270,7 +3273,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
|
||||
return gnc_search_dialog_create (type, title, params, columns, q, q2,
|
||||
buttons, NULL, new_invoice_cb,
|
||||
sw, free_invoice_cb, GNC_PREFS_GROUP_SEARCH,
|
||||
label);
|
||||
label, style_class);
|
||||
}
|
||||
|
||||
DialogQueryView *
|
||||
|
@ -650,7 +650,8 @@ gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book)
|
||||
return gnc_search_dialog_create (type, _("Find Job"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_job_cb, sw, free_userdata_cb,
|
||||
GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindJobDialog");
|
||||
}
|
||||
|
||||
/* Functions for widgets for job selection */
|
||||
|
@ -954,7 +954,7 @@ gnc_order_search (GncOrder *start, GncOwner *owner, QofBook *book)
|
||||
params, columns, q, q2,
|
||||
buttons, NULL, new_order_cb,
|
||||
sw, free_order_cb, GNC_PREFS_GROUP_SEARCH,
|
||||
NULL);
|
||||
NULL, "GncFindOrderDialog");
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
|
@ -762,7 +762,8 @@ gnc_vendor_search (GncVendor *start, QofBook *book)
|
||||
return gnc_search_dialog_create (type, _("Find Vendor"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_vendor_cb, sw, free_vendor_cb,
|
||||
GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindVendorDialog");
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
|
@ -1311,7 +1311,8 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
|
||||
GNCSearchNewItemCB new_item_cb,
|
||||
gpointer user_data, GNCSearchFree free_cb,
|
||||
const gchar *prefs_group,
|
||||
const gchar *type_label)
|
||||
const gchar *type_label,
|
||||
const gchar *style_class)
|
||||
{
|
||||
GNCSearchWindow *sw = g_new0 (GNCSearchWindow, 1);
|
||||
|
||||
@ -1348,6 +1349,12 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
|
||||
gnc_restore_window_size(sw->prefs_group, GTK_WINDOW(sw->dialog));
|
||||
gtk_widget_show(sw->dialog);
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
if (style_class == NULL)
|
||||
gnc_widget_set_style_context (GTK_WIDGET(sw->dialog), "GncSearchDialog");
|
||||
else
|
||||
gnc_widget_set_style_context (GTK_WIDGET(sw->dialog), style_class);
|
||||
|
||||
/* Maybe display the original query results? */
|
||||
if (callbacks && show_start_query)
|
||||
{
|
||||
@ -1492,6 +1499,6 @@ gnc_search_dialog_test (void)
|
||||
gnc_search_dialog_create (GNC_ID_SPLIT, _("Find Transaction"),
|
||||
params, display,
|
||||
NULL, NULL, buttons, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL);
|
||||
NULL, NULL, NULL);
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,8 @@ gnc_search_dialog_create (QofIdTypeConst obj_type, const gchar *title,
|
||||
GNCSearchNewItemCB new_item_cb,
|
||||
gpointer user_data, GNCSearchFree free_user_data,
|
||||
const gchar *prefs_group,
|
||||
const gchar *type_label);
|
||||
const gchar *type_label,
|
||||
const gchar *style_class);
|
||||
|
||||
void gnc_search_dialog_destroy (GNCSearchWindow *sw);
|
||||
void gnc_search_dialog_raise (GNCSearchWindow *sw);
|
||||
|
@ -224,11 +224,8 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
|
||||
ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
|
||||
params, NULL, start_q, show_q,
|
||||
NULL, do_find_cb, NULL,
|
||||
ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(ftd->sw), "GncFindTransDialog");
|
||||
|
||||
ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindTransDialog");
|
||||
if (!ftd->sw)
|
||||
{
|
||||
free_ftd_cb (ftd);
|
||||
|
@ -225,11 +225,8 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
|
||||
ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
|
||||
params, NULL, start_q, show_q,
|
||||
NULL, do_find_cb, NULL,
|
||||
ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL);
|
||||
|
||||
// Set the style context for this dialog so it can be easily manipulated with css
|
||||
gnc_widget_set_style_context (GTK_WIDGET(ftd->sw), "GncFindTransDialog");
|
||||
|
||||
ftd, free_ftd_cb, GNC_PREFS_GROUP_SEARCH, NULL,
|
||||
"GncFindTransDialog");
|
||||
if (!ftd->sw)
|
||||
{
|
||||
free_ftd_cb (ftd);
|
||||
|
Loading…
Reference in New Issue
Block a user