mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Re-title the search dialog based upon the menu used to invoke it.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13088 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
13
ChangeLog
13
ChangeLog
@@ -1,3 +1,16 @@
|
||||
2006-02-03 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/business/business-gnome/dialog-order.c:
|
||||
* src/business/business-gnome/dialog-vendor.c:
|
||||
* src/business/business-gnome/dialog-customer.c:
|
||||
* src/business/business-gnome/dialog-job.c:
|
||||
* src/business/business-gnome/dialog-employee.c:
|
||||
* src/business/business-gnome/dialog-invoice.c:
|
||||
* src/gnome/dialog-find-transactions.c:
|
||||
* src/gnome-search/search.glade:
|
||||
* src/gnome-search/dialog-search.[ch]: Re-title the search dialog
|
||||
based upon the menu used to invoke it. Fixes #329538.
|
||||
|
||||
2006-02-02 David Hampton <hampton@employees.org>
|
||||
|
||||
* src/gnome-utils/gnc-tree-view.[ch]: Andreas Köhler's patch to
|
||||
|
||||
@@ -829,8 +829,8 @@ gnc_customer_search (GncCustomer *start, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type, params, columns,
|
||||
q, q2, buttons, NULL,
|
||||
return gnc_search_dialog_create (type, _("Find Customer"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_customer_cb, sw, free_userdata_cb,
|
||||
GCONF_SECTION_SEARCH, NULL);
|
||||
}
|
||||
|
||||
@@ -724,7 +724,8 @@ gnc_employee_search (GncEmployee *start, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type, params, columns, q, q2,
|
||||
return gnc_search_dialog_create (type, _("Find Employee"),
|
||||
params, columns, q, q2,
|
||||
buttons, NULL, new_employee_cb,
|
||||
sw, free_employee_cb,
|
||||
GCONF_SECTION_SEARCH, NULL);
|
||||
|
||||
@@ -2186,8 +2186,10 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, GNCBook *book)
|
||||
struct _invoice_select_window *sw;
|
||||
QueryNew *q, *q2 = NULL;
|
||||
GncOwnerType owner_type = GNC_OWNER_CUSTOMER;
|
||||
static GList *inv_params = NULL, *bill_params = NULL, *emp_params = NULL;
|
||||
static GList *inv_params = NULL, *bill_params = NULL, *emp_params = NULL, *params;
|
||||
static GList *columns = NULL;
|
||||
const gchar *title, *label;
|
||||
static GNCSearchCallbackButton *buttons;
|
||||
static GNCSearchCallbackButton inv_buttons[] = {
|
||||
{ N_("View/Edit Invoice"), edit_invoice_cb},
|
||||
{ N_("Process Payment"), pay_invoice_cb},
|
||||
@@ -2381,25 +2383,30 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type,
|
||||
(owner_type == GNC_OWNER_VENDOR ?
|
||||
bill_params :
|
||||
(owner_type == GNC_OWNER_EMPLOYEE ?
|
||||
emp_params :
|
||||
inv_params)),
|
||||
columns, q, q2,
|
||||
(owner_type == GNC_OWNER_VENDOR ?
|
||||
bill_buttons :
|
||||
(owner_type == GNC_OWNER_EMPLOYEE ?
|
||||
emp_buttons :
|
||||
inv_buttons)),
|
||||
NULL, new_invoice_cb,
|
||||
switch (owner_type) {
|
||||
case GNC_OWNER_VENDOR:
|
||||
title = _("Find Bill");
|
||||
label = _("Bill");
|
||||
params = bill_params;
|
||||
buttons = bill_buttons;
|
||||
break;
|
||||
case GNC_OWNER_EMPLOYEE:
|
||||
title = _("Find Expense Voucher");
|
||||
label = _("Expense Voucher");
|
||||
params = emp_params;
|
||||
buttons = emp_buttons;
|
||||
break;
|
||||
default:
|
||||
title = _("Find Invoice");
|
||||
label = _("Invoice");
|
||||
params = inv_params;
|
||||
buttons = inv_buttons;
|
||||
break;
|
||||
}
|
||||
return gnc_search_dialog_create (type, title, params, columns, q, q2,
|
||||
buttons, NULL, new_invoice_cb,
|
||||
sw, free_invoice_cb, GCONF_SECTION_SEARCH,
|
||||
(owner_type == GNC_OWNER_VENDOR ?
|
||||
_("Bill") :
|
||||
(owner_type == GNC_OWNER_EMPLOYEE ?
|
||||
_("Expense Voucher") :
|
||||
_("Invoice"))));
|
||||
label);
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
|
||||
@@ -587,8 +587,8 @@ gnc_job_search (GncJob *start, GncOwner *owner, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type, params, columns,
|
||||
q, q2, buttons, NULL,
|
||||
return gnc_search_dialog_create (type, _("Find Job"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_job_cb, sw, free_userdata_cb,
|
||||
GCONF_SECTION_SEARCH, NULL);
|
||||
}
|
||||
|
||||
@@ -881,7 +881,8 @@ gnc_order_search (GncOrder *start, GncOwner *owner, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type, params, columns, q, q2,
|
||||
return gnc_search_dialog_create (type, _("Find Order"),
|
||||
params, columns, q, q2,
|
||||
buttons, NULL, new_order_cb,
|
||||
sw, free_order_cb, GCONF_SECTION_SEARCH,
|
||||
NULL);
|
||||
|
||||
@@ -691,8 +691,8 @@ gnc_vendor_search (GncVendor *start, GNCBook *book)
|
||||
sw->book = book;
|
||||
sw->q = q;
|
||||
|
||||
return gnc_search_dialog_create (type, params, columns, q, q2,
|
||||
buttons, NULL,
|
||||
return gnc_search_dialog_create (type, _("Find Vendor"),
|
||||
params, columns, q, q2, buttons, NULL,
|
||||
new_vendor_cb, sw, free_vendor_cb,
|
||||
GCONF_SECTION_SEARCH, NULL);
|
||||
}
|
||||
|
||||
@@ -744,7 +744,7 @@ close_handler (gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
gnc_search_dialog_init_widgets (GNCSearchWindow *sw)
|
||||
gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
|
||||
{
|
||||
GladeXML *xml;
|
||||
GtkWidget *label, *add, *box;
|
||||
@@ -757,6 +757,7 @@ gnc_search_dialog_init_widgets (GNCSearchWindow *sw)
|
||||
|
||||
/* Grab the dialog, save the dialog info */
|
||||
sw->dialog = glade_xml_get_widget (xml, "Search Dialog");
|
||||
gtk_window_set_title(GTK_WINDOW(sw->dialog), title);
|
||||
g_object_set_data (G_OBJECT (sw->dialog), "dialog-info", sw);
|
||||
|
||||
/* grab the result hbox */
|
||||
@@ -896,7 +897,8 @@ gnc_search_dialog_raise (GNCSearchWindow *sw)
|
||||
}
|
||||
|
||||
GNCSearchWindow *
|
||||
gnc_search_dialog_create (GNCIdTypeConst obj_type, GList *param_list,
|
||||
gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
|
||||
GList *param_list,
|
||||
GList *display_list,
|
||||
QueryNew *start_query, QueryNew *show_start_query,
|
||||
GNCSearchCallbackButton *callbacks,
|
||||
@@ -936,7 +938,7 @@ gnc_search_dialog_create (GNCIdTypeConst obj_type, GList *param_list,
|
||||
sw->start_q = gncQueryCopy (start_query);
|
||||
sw->q = show_start_query;
|
||||
|
||||
gnc_search_dialog_init_widgets (sw);
|
||||
gnc_search_dialog_init_widgets (sw, title);
|
||||
if (sw->gconf_section)
|
||||
gnc_restore_window_size(sw->gconf_section, GTK_WINDOW(sw->dialog));
|
||||
|
||||
@@ -1071,7 +1073,8 @@ gnc_search_dialog_test (void)
|
||||
if (display == NULL)
|
||||
display = get_display_list (GNC_ID_SPLIT);
|
||||
|
||||
sw = gnc_search_dialog_create (GNC_ID_SPLIT, params, display,
|
||||
sw = gnc_search_dialog_create (GNC_ID_SPLIT, _("Find Transaction"),
|
||||
params, display,
|
||||
NULL, NULL, buttons, NULL, NULL, NULL, NULL,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
@@ -89,7 +89,8 @@ typedef struct {
|
||||
* the dialog will use the obj_type instead.
|
||||
*/
|
||||
GNCSearchWindow *
|
||||
gnc_search_dialog_create (GNCIdTypeConst obj_type, GList *param_list,
|
||||
gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
|
||||
GList *param_list,
|
||||
GList *display_list,
|
||||
QueryNew *start_query, QueryNew *show_start_query,
|
||||
GNCSearchCallbackButton *callbacks,
|
||||
|
||||
@@ -5,12 +5,17 @@
|
||||
<requires lib="gnome"/>
|
||||
|
||||
<widget class="GtkDialog" id="Search Dialog">
|
||||
<property name="title" translatable="yes">Search for...</property>
|
||||
<property name="title"></property>
|
||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
||||
<property name="window_position">GTK_WIN_POS_NONE</property>
|
||||
<property name="modal">False</property>
|
||||
<property name="resizable">True</property>
|
||||
<property name="destroy_with_parent">False</property>
|
||||
<property name="decorated">True</property>
|
||||
<property name="skip_taskbar_hint">False</property>
|
||||
<property name="skip_pager_hint">False</property>
|
||||
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
|
||||
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
|
||||
<property name="has_separator">True</property>
|
||||
|
||||
<child internal-child="vbox">
|
||||
@@ -30,6 +35,7 @@
|
||||
<property name="can_default">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_ui_search_new_cb" last_modification_time="Thu, 15 May 2003 14:03:10 GMT"/>
|
||||
|
||||
@@ -40,6 +46,10 @@
|
||||
<property name="yalign">0.5</property>
|
||||
<property name="xscale">0</property>
|
||||
<property name="yscale">0</property>
|
||||
<property name="top_padding">0</property>
|
||||
<property name="bottom_padding">0</property>
|
||||
<property name="left_padding">0</property>
|
||||
<property name="right_padding">0</property>
|
||||
|
||||
<child>
|
||||
<widget class="GtkHBox" id="hbox74">
|
||||
@@ -99,6 +109,7 @@
|
||||
<property name="label">gtk-close</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-7</property>
|
||||
<signal name="clicked" handler="gnc_ui_search_close_cb" last_modification_time="Thu, 15 May 2003 14:02:29 GMT"/>
|
||||
</widget>
|
||||
@@ -112,6 +123,7 @@
|
||||
<property name="label">gtk-help</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-11</property>
|
||||
<signal name="clicked" handler="gnc_ui_search_help_cb"/>
|
||||
</widget>
|
||||
@@ -125,6 +137,7 @@
|
||||
<property name="label">gtk-cancel</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">-6</property>
|
||||
<signal name="clicked" handler="gnc_ui_search_cancel_cb"/>
|
||||
</widget>
|
||||
@@ -138,6 +151,7 @@
|
||||
<property name="label">gtk-find</property>
|
||||
<property name="use_stock">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="response_id">0</property>
|
||||
<signal name="clicked" handler="gnc_ui_search_find_cb" last_modification_time="Thu, 15 May 2003 14:02:53 GMT"/>
|
||||
</widget>
|
||||
@@ -407,6 +421,7 @@
|
||||
<property name="label" translatable="yes">New search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
@@ -426,6 +441,7 @@
|
||||
<property name="label" translatable="yes">Refine current search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
@@ -446,6 +462,7 @@
|
||||
<property name="label" translatable="yes">Add results to current search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
@@ -466,6 +483,7 @@
|
||||
<property name="label" translatable="yes">Delete results from current search</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">False</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
@@ -498,6 +516,7 @@
|
||||
<property name="label" translatable="yes">Search only active data</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
|
||||
@@ -168,7 +168,8 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
|
||||
ftd->q = start_q; /* save this to destroy it later */
|
||||
}
|
||||
|
||||
ftd->sw = gnc_search_dialog_create (type, params, NULL, start_q, show_q,
|
||||
ftd->sw = gnc_search_dialog_create (type, _("Find Transaction"),
|
||||
params, NULL, start_q, show_q,
|
||||
NULL, do_find_cb, NULL,
|
||||
ftd, free_ftd_cb, GCONF_SECTION, NULL);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user