Display a title on report options dialog boxes.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@4329 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Robert Graham Merkel 2001-05-29 12:35:39 +00:00
parent 54c58cbbcd
commit 8ffb9865e7
7 changed files with 35 additions and 7 deletions

View File

@ -1,3 +1,15 @@
2001-05-29 Robert Graham Merkel <rgmerk@mira.net>
* src/gnome/dialog-options.{ch} (gnc_options_dialog_new):
provide the ability to (optionally) set a title for
the options dialog box. API changed.
* src/gnome/dialog-column-view.c, dialog-style-sheet.c,
window-acct-tree.c :modify to use changed API.
* src/gnome/window-report.c: use new API to title report
options dialogs.
2001-05-28 Dave Peticolas <dave@krondo.com>
* doc/sgml/pt_PT/*: add Duarte Loreto's updated transations

View File

@ -218,7 +218,7 @@ gnc_column_view_edit_options(SCM options, SCM view) {
else {
gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
r->optwin = gnc_options_dialog_new(TRUE);
r->optwin = gnc_options_dialog_new(TRUE, NULL);
tlo = GTK_OBJECT(create_Edit_Column_View_Page());

View File

@ -1935,7 +1935,7 @@ gnc_options_dialog_ok_cb(GtkWidget * w, gpointer data) {
}
GNCOptionWin *
gnc_options_dialog_new(gboolean make_toplevel) {
gnc_options_dialog_new(gboolean make_toplevel, gchar *title) {
GNCOptionWin * retval = g_new0(GNCOptionWin, 1);
GtkWidget * vbox;
GtkWidget * buttonbox;
@ -1951,6 +1951,10 @@ gnc_options_dialog_new(gboolean make_toplevel) {
if(make_toplevel) {
retval->container = gtk_window_new(GDK_WINDOW_TOPLEVEL);
if(title)
{
gtk_window_set_title(GTK_WINDOW(retval->container), title);
}
}
else {
retval->container = vbox;
@ -2125,7 +2129,7 @@ gnc_show_options_dialog(void)
if (options_dialog == NULL)
{
options_dialog = gnc_options_dialog_new(TRUE);
options_dialog = gnc_options_dialog_new(TRUE, NULL);
gnc_build_options_dialog_contents(options_dialog, global_options);
gnc_option_db_clean(global_options);

View File

@ -32,7 +32,7 @@ typedef struct _gnc_option_win GNCOptionWin;
typedef void (* GNCOptionWinCallback)(GNCOptionWin *, gpointer data);
GNCOptionWin * gnc_options_dialog_new(gboolean make_toplevel);
GNCOptionWin * gnc_options_dialog_new(gboolean make_toplevel, gchar *title);
void gnc_options_dialog_destroy(GNCOptionWin * win);
GtkWidget * gnc_options_dialog_widget(GNCOptionWin * win);

View File

@ -109,7 +109,7 @@ gnc_style_sheet_dialog_fill(StyleSheetDialog * ss, SCM selected) {
char * c_name;
/* make the options DB and dialog, but don't parent it yet */
ssinfo->odialog = gnc_options_dialog_new(FALSE);
ssinfo->odialog = gnc_options_dialog_new(FALSE, NULL);
ssinfo->odb = gnc_option_db_new(scm_options);
ssinfo->stylesheet = gh_car(stylesheets);

View File

@ -1108,7 +1108,7 @@ gnc_acct_tree_window_toolbar_options_cb(GtkWidget * widget, gpointer data) {
(gnc_options_dialog_widget(win->editor_dialog))->window);
}
else {
win->editor_dialog = gnc_options_dialog_new(TRUE);
win->editor_dialog = gnc_options_dialog_new(TRUE, NULL);
gnc_build_options_dialog_contents(win->editor_dialog,
win->odb);

View File

@ -847,9 +847,12 @@ gnc_options_dialog_close_cb(GNCOptionWin * propertybox,
GtkWidget *
gnc_report_window_default_params_editor(SCM options, SCM report) {
SCM get_editor = gh_eval_str("gnc:report-editor-widget");
SCM get_title = gh_eval_str("gnc:report-type");
SCM ptr;
SCM new_edited;
char *title = NULL;
ptr = gh_call1(get_editor, report);
if(ptr != SCM_BOOL_F) {
GtkWidget * w = gw_wcp_get_ptr(ptr);
@ -863,7 +866,16 @@ gnc_report_window_default_params_editor(SCM options, SCM report) {
prm->scm_options = options;
prm->cur_report = report;
prm->db = gnc_option_db_new(prm->scm_options);
prm->win = gnc_options_dialog_new(TRUE);
ptr = gh_call1(get_title, report);
if (ptr != SCM_BOOL_F) {
title = gh_scm2newstr(ptr, NULL);
}
prm->win = gnc_options_dialog_new(TRUE, title);
if (title) {
free(title);
}
scm_protect_object(prm->scm_options);
scm_protect_object(prm->cur_report);