r21372 - gnucash/trunk - Bug #660369 - Migrate Report dialogs to Builder from GladeXML
Geert Janssens
gjanssens at code.gnucash.org
Mon Oct 3 15:17:36 EDT 2011
Author: gjanssens
Date: 2011-10-03 15:17:35 -0400 (Mon, 03 Oct 2011)
New Revision: 21372
Trac: http://svn.gnucash.org/trac/changeset/21372
Added:
gnucash/trunk/src/report/report-gnome/dialog-custom-report.glade
gnucash/trunk/src/report/report-gnome/dialog-report-column-view.c
gnucash/trunk/src/report/report-gnome/dialog-report-column-view.h
gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c
gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.h
gnucash/trunk/src/report/report-gnome/dialog-report.glade
Removed:
gnucash/trunk/src/report/report-gnome/custom-report-dialog.glade
gnucash/trunk/src/report/report-gnome/dialog-column-view.c
gnucash/trunk/src/report/report-gnome/dialog-column-view.h
gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
gnucash/trunk/src/report/report-gnome/dialog-style-sheet.h
gnucash/trunk/src/report/report-gnome/report.glade
Modified:
gnucash/trunk/po/POTFILES.in
gnucash/trunk/src/report/report-gnome/Makefile.am
gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
gnucash/trunk/src/report/report-gnome/report-gnome.i
gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c
Log:
Bug #660369 - Migrate Report dialogs to Builder from GladeXML
Patch by Robert Fewell with minor tweaks
Modified: gnucash/trunk/po/POTFILES.in
===================================================================
--- gnucash/trunk/po/POTFILES.in 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/po/POTFILES.in 2011-10-03 19:17:35 UTC (rev 21372)
@@ -502,13 +502,13 @@
src/register/register-gnome/quickfillcell-gnome.c
src/register/register-gnome/table-gnome.c
src/report/locale-specific/us/gncmod-locale-reports-us.c
-src/report/report-gnome/custom-report-dialog.glade
-src/report/report-gnome/dialog-column-view.c
src/report/report-gnome/dialog-custom-report.c
-src/report/report-gnome/dialog-style-sheet.c
+src/report/report-gnome/dialog-custom-report.glade
+src/report/report-gnome/dialog-report-column-view.c
+src/report/report-gnome/dialog-report.glade
+src/report/report-gnome/dialog-report-style-sheet.c
src/report/report-gnome/gncmod-report-gnome.c
src/report/report-gnome/gnc-plugin-page-report.c
-src/report/report-gnome/report.glade
src/report/report-gnome/window-report.c
src/report/report-system/gncmod-report-system.c
src/report/report-system/gnc-report.c
Modified: gnucash/trunk/src/report/report-gnome/Makefile.am
===================================================================
--- gnucash/trunk/src/report/report-gnome/Makefile.am 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/Makefile.am 2011-10-03 19:17:35 UTC (rev 21372)
@@ -21,18 +21,18 @@
libgncmod_report_gnome_la_SOURCES = \
swig-report-gnome.c \
- dialog-column-view.c \
+ dialog-report-column-view.c \
dialog-custom-report.c \
- dialog-style-sheet.c \
+ dialog-report-style-sheet.c \
gnc-plugin-page-report.c \
gncmod-report-gnome.c \
window-report.c
gncincludedir = ${GNC_INCLUDE_DIR}
gncinclude_HEADERS = \
- dialog-column-view.h \
+ dialog-report-column-view.h \
dialog-custom-report.h \
- dialog-style-sheet.h \
+ dialog-report-style-sheet.h \
gnc-plugin-page-report.h \
window-report.h
@@ -63,10 +63,10 @@
noinst_DATA = .scm-links
-gladedir = $(GNC_GLADE_DIR)
-glade_DATA = \
- report.glade \
- custom-report-dialog.glade
+gtkbuilderdir = $(GNC_GTKBUILDER_DIR)
+gtkbuilder_DATA = \
+ dialog-report.glade \
+ dialog-custom-report.glade
uidir = $(GNC_UI_DIR)
@@ -75,7 +75,7 @@
EXTRA_DIST = \
report-gnome.i \
- ${glade_DATA} \
+ ${gtkbuilder_DATA} \
${gncmod_DATA} \
${ui_DATA}
Deleted: gnucash/trunk/src/report/report-gnome/custom-report-dialog.glade
===================================================================
--- gnucash/trunk/src/report/report-gnome/custom-report-dialog.glade 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/custom-report-dialog.glade 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,135 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.10 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkDialog" id="custom_report_dialog">
- <property name="border_width">5</property>
- <property name="window_position">center-on-parent</property>
- <property name="type_hint">dialog</property>
- <property name="skip_taskbar_hint">True</property>
- <property name="skip_pager_hint">True</property>
- <property name="has_separator">False</property>
- <signal name="close" handler="custom_report_dialog_close_cb"/>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox1">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow1">
- <property name="height_request">150</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <widget class="GtkTreeView" id="custom_report_list_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <signal name="row_activated" handler="on_custom_report_list_view_row_activated"/>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="delete_custom_report">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Delete the currently selected report</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="on_delete_custom_report_clicked"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="cancel_custom_report">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Exit the custom report dialog</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="cancel_custom_report_clicked_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="run_custom_report">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Run the currently selected report</property>
- <signal name="clicked" handler="run_custom_report_clicked_cb"/>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox1">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-go-forward</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Run</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
Deleted: gnucash/trunk/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-column-view.c 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/dialog-column-view.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,658 +0,0 @@
-/********************************************************************
- * dialog-column-view.c -- editor for simple column view of reports *
- * Copyright (C) 2001 Bill Gribble <grib at billgribble.com> *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- ********************************************************************/
-
-#include "config.h"
-
-#include <glib/gi18n.h>
-#include <libguile.h>
-#include "swig-runtime.h"
-
-#include "dialog-column-view.h"
-#include "dialog-options.h"
-#include "dialog-utils.h"
-#include "option-util.h"
-#include "window-report.h"
-#include "guile-mappings.h"
-#include "gnc-report.h"
-
-enum available_cols
-{
- AVAILABLE_COL_NAME = 0,
- AVAILABLE_COL_ROW,
- NUM_AVAILABLE_COLS
-};
-
-enum contents_cols
-{
- CONTENTS_COL_NAME = 0,
- CONTENTS_COL_ROW,
- CONTENTS_COL_REPORT_ROWS,
- CONTENTS_COL_REPORT_COLS,
- NUM_CONTENTS_COLS
-};
-
-struct gncp_column_view_edit
-{
- GNCOptionWin * optwin;
- GtkTreeView * available;
- GtkTreeView * contents;
-
- SCM options;
- SCM view;
- GNCOptionDB * odb;
-
- SCM available_list;
- int available_selected;
-
- SCM contents_list;
- int contents_selected;
-};
-
-static void gnc_column_view_edit_add_cb(GtkButton * button,
- gpointer user_data);
-static void gnc_column_view_edit_remove_cb(GtkButton * button,
- gpointer user_data);
-static void gnc_edit_column_view_move_up_cb(GtkButton * button,
- gpointer user_data);
-static void gnc_edit_column_view_move_down_cb(GtkButton * button,
- gpointer user_data);
-static void gnc_column_view_edit_size_cb(GtkButton * button,
- gpointer user_data);
-
-
-static void
-gnc_column_view_set_option(GNCOptionDB * odb, char * section, char * name,
- SCM new_value)
-{
- GNCOption * option =
- gnc_option_db_get_option_by_name(odb, section, name);
-
- if (option)
- {
- gnc_option_db_set_option(odb, section, name, new_value);
-
- /* set_option doesn't do this */
- gnc_option_set_changed (option, TRUE);
- }
-}
-
-static void
-gnc_column_view_edit_destroy(gnc_column_view_edit * view)
-{
- gnc_options_dialog_destroy(view->optwin);
- scm_gc_unprotect_object(view->options);
- scm_gc_unprotect_object(view->view);
- gnc_option_db_destroy(view->odb);
- g_free(view);
-}
-
-static void
-update_display_lists(gnc_column_view_edit * view)
-{
- SCM get_names = scm_c_eval_string("gnc:all-report-template-names");
- SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
- SCM report_menu_name = scm_c_eval_string("gnc:report-menu-name");
- SCM names = scm_call_0(get_names);
- SCM contents =
- gnc_option_db_lookup_option(view->odb, "__general", "report-list",
- SCM_BOOL_F);
- SCM this_report;
- SCM selection;
- const gchar *name;
- int row, i, id;
- GtkListStore *store;
- GtkTreeIter iter;
- GtkTreePath *path;
- GtkTreeSelection *tree_selection;
-
-
- /* Update the list of available reports (left selection box). */
- row = view->available_selected;
-
- if (scm_is_list(view->available_list) && !scm_is_null (view->available_list))
- {
- row = MIN (row, scm_ilength (view->available_list) - 1);
- selection = scm_list_ref (view->available_list, scm_int2num (row));
- }
- else
- {
- selection = SCM_UNDEFINED;
- }
-
- scm_gc_unprotect_object(view->available_list);
- view->available_list = names;
- scm_gc_protect_object(view->available_list);
-
- store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
- gtk_list_store_clear(store);
-
- if (scm_is_list(names))
- {
- for (i = 0; !scm_is_null(names); names = SCM_CDR(names), i++)
- {
- char * str;
-
- if (scm_is_equal (SCM_CAR(names), selection))
- row = i;
- scm_dynwind_begin (0);
- str = scm_to_locale_string (scm_call_2(template_menu_name, SCM_CAR(names),
- SCM_BOOL_F));
- name = _(g_strdup (str));
- scm_dynwind_free (str);
- scm_dynwind_end ();
- gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter,
- AVAILABLE_COL_NAME, name,
- AVAILABLE_COL_ROW, i,
- -1);
- }
-
- }
-
- tree_selection = gtk_tree_view_get_selection(view->available);
- path = gtk_tree_path_new_from_indices(row, -1);
- gtk_tree_selection_select_path(tree_selection, path);
- gtk_tree_path_free(path);
-
-
- /* Update the list of selected reports (right selection box). */
- row = view->contents_selected;
-
- if (scm_is_list(view->contents_list) && !scm_is_null (view->contents_list))
- {
- row = MIN (row, scm_ilength (view->contents_list) - 1);
- selection = scm_list_ref (view->contents_list, scm_int2num (row));
- }
- else
- {
- selection = SCM_UNDEFINED;
- }
-
- scm_gc_unprotect_object(view->contents_list);
- view->contents_list = contents;
- scm_gc_protect_object(view->contents_list);
-
- store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
- gtk_list_store_clear(store);
- if (scm_is_list(contents))
- {
- for (i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++)
- {
- char * str;
-
- if (scm_is_equal (SCM_CAR(contents), selection))
- row = i;
-
- id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
- this_report = gnc_report_find(id);
- scm_dynwind_begin (0);
- str = scm_to_locale_string (scm_call_1(report_menu_name, this_report));
- name = _(g_strdup (str));
- scm_dynwind_free (str);
- scm_dynwind_end ();
-
- gtk_list_store_append(store, &iter);
- gtk_list_store_set
- (store, &iter,
- CONTENTS_COL_NAME, name,
- CONTENTS_COL_ROW, i,
- CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
- SCM_ARG1, G_STRFUNC),
- CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
- SCM_ARG1, G_STRFUNC),
- -1);
- }
- }
-
- tree_selection = gtk_tree_view_get_selection(view->contents);
- path = gtk_tree_path_new_from_indices(row, -1);
- gtk_tree_selection_select_path(tree_selection, path);
- // gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
- gtk_tree_path_free(path);
-}
-
-static void
-gnc_column_view_select_avail_cb(GtkTreeSelection *selection,
- gnc_column_view_edit *r)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- AVAILABLE_COL_ROW, &r->available_selected,
- -1);
-}
-
-static void
-gnc_column_view_select_contents_cb(GtkTreeSelection *selection,
- gnc_column_view_edit *r)
-{
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- gtk_tree_model_get(model, &iter,
- AVAILABLE_COL_ROW, &r->contents_selected,
- -1);
-}
-
-static void
-gnc_column_view_edit_apply_cb(GNCOptionWin * w, gpointer user_data)
-{
- SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
- gnc_column_view_edit * win = user_data;
-
- if (!win) return;
- gnc_option_db_commit(win->odb);
- scm_call_2(dirty_report, win->view, SCM_BOOL_T);
-}
-
-static void
-gnc_column_view_edit_close_cb(GNCOptionWin * win, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- SCM set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
-
- scm_call_2(set_editor, r->view, SCM_BOOL_F);
- gnc_column_view_edit_destroy(r);
-}
-
-
-/********************************************************************
- * gnc_column_view_edit_options
- * create the editor.
- ********************************************************************/
-
-GtkWidget *
-gnc_column_view_edit_options(SCM options, SCM view)
-{
- SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
- SCM ptr;
- GtkWidget * editor;
- GtkListStore *store;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
-
- ptr = scm_call_1(get_editor, view);
- if (ptr != SCM_BOOL_F)
- {
-#define FUNC_NAME "gtk_window_present"
- GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
- gtk_window_present(w);
-#undef FUNC_NAME
- return NULL;
- }
- else
- {
- gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
- GladeXML *xml;
-
- r->optwin = gnc_options_dialog_new(NULL);
-
- /* Hide the generic dialog page list. */
- {
- GtkWidget *dialog, *page_list;
-
- dialog = gnc_options_dialog_widget(r->optwin);
- page_list = gnc_glade_lookup_widget (dialog, "page_list");
- gtk_widget_hide(page_list);
- }
-
- xml = gnc_glade_xml_new ("report.glade", "view_contents_table");
-
- glade_xml_signal_connect_data
- (xml, "gnc_column_view_edit_add_cb",
- G_CALLBACK (gnc_column_view_edit_add_cb), r);
-
- glade_xml_signal_connect_data
- (xml, "gnc_column_view_edit_remove_cb",
- G_CALLBACK (gnc_column_view_edit_remove_cb), r);
-
- glade_xml_signal_connect_data
- (xml, "gnc_edit_column_view_move_up_cb",
- G_CALLBACK (gnc_edit_column_view_move_up_cb), r);
-
- glade_xml_signal_connect_data
- (xml, "gnc_edit_column_view_move_down_cb",
- G_CALLBACK (gnc_edit_column_view_move_down_cb), r);
-
- glade_xml_signal_connect_data
- (xml, "gnc_column_view_edit_size_cb",
- G_CALLBACK (gnc_column_view_edit_size_cb), r);
-
- editor = glade_xml_get_widget (xml, "view_contents_table");
- r->available = GTK_TREE_VIEW (glade_xml_get_widget (xml, "available_view"));
- r->contents = GTK_TREE_VIEW (glade_xml_get_widget (xml, "contents_view"));
- r->options = options;
- r->view = view;
- r->available_selected = 0;
- r->available_list = SCM_EOL;
- r->contents_selected = 0;
- r->contents_list = SCM_EOL;
- r->odb = gnc_option_db_new(r->options);
-
- gnc_options_dialog_build_contents(r->optwin, r->odb);
-
- gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
- (r->optwin)),
- editor,
- gtk_label_new(_("Contents")));
-
- scm_gc_protect_object(r->options);
- scm_gc_protect_object(r->view);
- scm_gc_protect_object(r->available_list);
- scm_gc_protect_object(r->contents_list);
-
- /* Build the 'available' view */
- store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
- gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
- gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), AVAILABLE_COL_NAME, GTK_SORT_ASCENDING);
- g_object_unref(store);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes("", renderer,
- "text", AVAILABLE_COL_NAME,
- NULL);
- gtk_tree_view_append_column(r->available, column);
-
- selection = gtk_tree_view_get_selection(r->available);
- g_signal_connect(selection, "changed",
- G_CALLBACK(gnc_column_view_select_avail_cb), r);
-
- /* Build the 'contents' view */
- store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
- G_TYPE_INT, G_TYPE_INT);
- gtk_tree_view_set_model(r->contents, GTK_TREE_MODEL(store));
- g_object_unref(store);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Report"), renderer,
- "text", CONTENTS_COL_NAME,
- NULL);
- gtk_tree_view_append_column(r->contents, column);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Rows"), renderer,
- "text", CONTENTS_COL_REPORT_ROWS,
- NULL);
- gtk_tree_view_append_column(r->contents, column);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Cols"), renderer,
- "text", CONTENTS_COL_REPORT_COLS,
- NULL);
- gtk_tree_view_append_column(r->contents, column);
-
- selection = gtk_tree_view_get_selection(r->contents);
- g_signal_connect(selection, "changed",
- G_CALLBACK(gnc_column_view_select_contents_cb), r);
-
- update_display_lists(r);
-
- gnc_options_dialog_set_apply_cb(r->optwin,
- gnc_column_view_edit_apply_cb, r);
- gnc_options_dialog_set_close_cb(r->optwin,
- gnc_column_view_edit_close_cb, r);
-
- gtk_widget_show(gnc_options_dialog_widget(r->optwin));
- return gnc_options_dialog_widget(r->optwin);
- }
-}
-
-static void
-gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- SCM make_report = scm_c_eval_string("gnc:make-report");
- SCM mark_report = scm_c_eval_string("gnc:report-set-needs-save?!");
- SCM template_name;
- SCM new_report;
- SCM newlist = SCM_EOL;
- SCM oldlist = r->contents_list;
- int count;
- int oldlength, id;
-
- if (scm_is_list(r->available_list) &&
- (scm_ilength(r->available_list) > r->available_selected))
- {
- template_name = scm_list_ref(r->available_list,
- scm_int2num(r->available_selected));
- new_report = scm_call_1(make_report, template_name);
- id = scm_num2int(new_report, SCM_ARG1, G_STRFUNC);
- scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
- oldlength = scm_ilength(r->contents_list);
-
- if (oldlength > r->contents_selected)
- {
- for (count = 0; count < r->contents_selected; count++)
- {
- newlist = scm_cons(SCM_CAR(oldlist), newlist);
- oldlist = SCM_CDR(oldlist);
- }
- newlist = scm_append
- (scm_listify(scm_reverse(scm_cons(SCM_LIST4(new_report,
- scm_int2num(1),
- scm_int2num(1),
- SCM_BOOL_F),
- newlist)),
- oldlist,
- SCM_UNDEFINED));
- }
- else
- {
- newlist = scm_append
- (scm_listify(oldlist,
- SCM_LIST1(SCM_LIST4(new_report,
- scm_int2num(1),
- scm_int2num(1),
- SCM_BOOL_F)),
- SCM_UNDEFINED));
- r->contents_selected = oldlength;
- }
-
- scm_gc_unprotect_object(r->contents_list);
- r->contents_list = newlist;
- scm_gc_protect_object(r->contents_list);
-
- gnc_column_view_set_option(r->odb, "__general", "report-list",
- r->contents_list);
- gnc_options_dialog_changed (r->optwin);
- }
-
- update_display_lists(r);
-}
-
-static void
-gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- SCM newlist = SCM_EOL;
- SCM oldlist = r->contents_list;
- int count;
- int oldlength;
-
- if (scm_is_list(r->contents_list))
- {
- oldlength = scm_ilength(r->contents_list);
- if (oldlength > r->contents_selected)
- {
- for (count = 0; count < r->contents_selected; count++)
- {
- newlist = scm_cons(SCM_CAR(oldlist), newlist);
- oldlist = SCM_CDR(oldlist);
- }
- if (count <= oldlength)
- {
- newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
- }
- }
-
- if (r->contents_selected > 0 && oldlength == r->contents_selected + 1)
- {
- r->contents_selected --;
- }
-
- scm_gc_unprotect_object(r->contents_list);
- r->contents_list = newlist;
- scm_gc_protect_object(r->contents_list);
-
- gnc_column_view_set_option(r->odb, "__general", "report-list",
- r->contents_list);
-
- gnc_options_dialog_changed (r->optwin);
- }
-
- update_display_lists(r);
-}
-
-static void
-gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- SCM oldlist = r->contents_list;
- SCM newlist = SCM_EOL;
- SCM temp;
- int oldlength;
- int count;
-
- oldlength = scm_ilength(r->contents_list);
- if ((r->contents_selected > 0) && (oldlength > r->contents_selected))
- {
- for (count = 1; count < r->contents_selected; count++)
- {
- newlist = scm_cons(SCM_CAR(oldlist), newlist);
- oldlist = SCM_CDR(oldlist);
- }
- temp = SCM_CAR(oldlist);
- oldlist = SCM_CDR(oldlist);
- newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
- newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
-
- scm_gc_unprotect_object(r->contents_list);
- r->contents_list = newlist;
- scm_gc_protect_object(r->contents_list);
-
- r->contents_selected = r->contents_selected - 1;
-
- gnc_column_view_set_option(r->odb, "__general", "report-list",
- r->contents_list);
-
- gnc_options_dialog_changed (r->optwin);
-
- update_display_lists(r);
- }
-}
-
-static void
-gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- SCM oldlist = r->contents_list;
- SCM newlist = SCM_EOL;
- SCM temp;
- int oldlength;
- int count;
-
- oldlength = scm_ilength(r->contents_list);
- if (oldlength > (r->contents_selected + 1))
- {
- for (count = 0; count < r->contents_selected; count++)
- {
- newlist = scm_cons(SCM_CAR(oldlist), newlist);
- oldlist = SCM_CDR(oldlist);
- }
- temp = SCM_CAR(oldlist);
- oldlist = SCM_CDR(oldlist);
- newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
- newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
-
- scm_gc_unprotect_object(r->contents_list);
- r->contents_list = newlist;
- scm_gc_protect_object(r->contents_list);
-
- r->contents_selected = r->contents_selected + 1;
-
- gnc_column_view_set_option(r->odb, "__general", "report-list",
- r->contents_list);
-
- gnc_options_dialog_changed (r->optwin);
-
- update_display_lists(r);
- }
-}
-
-static void
-gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
-{
- gnc_column_view_edit * r = user_data;
- GtkWidget * rowspin;
- GtkWidget * colspin;
- GtkWidget * dlg;
- GladeXML *xml;
- SCM current;
- int length;
- int dlg_ret;
-
- xml = gnc_glade_xml_new ("report.glade", "Edit Report Size");
- dlg = glade_xml_get_widget (xml, "Edit Report Size");
-
- /* get the spinner widgets */
- rowspin = glade_xml_get_widget (xml, "row_spin");
- colspin = glade_xml_get_widget (xml, "col_spin");
-
- length = scm_ilength(r->contents_list);
- if (length > r->contents_selected)
- {
- current = scm_list_ref(r->contents_list,
- scm_int2num(r->contents_selected));
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
- (float)scm_num2int(SCM_CADR(current),
- SCM_ARG1, G_STRFUNC));
- gtk_spin_button_set_value(GTK_SPIN_BUTTON(rowspin),
- (float)scm_num2int(SCM_CADDR(current),
- SCM_ARG1, G_STRFUNC));
-
- dlg_ret = gtk_dialog_run(GTK_DIALOG(dlg));
- gtk_widget_hide(dlg);
-
- if (dlg_ret == GTK_RESPONSE_OK)
- {
- current = SCM_LIST4(SCM_CAR(current),
- scm_int2num(gtk_spin_button_get_value_as_int
- (GTK_SPIN_BUTTON(colspin))),
- scm_int2num(gtk_spin_button_get_value_as_int
- (GTK_SPIN_BUTTON(rowspin))),
- SCM_BOOL_F);
- scm_gc_unprotect_object(r->contents_list);
- r->contents_list = scm_list_set_x(r->contents_list,
- scm_int2num(r->contents_selected),
- current);
- scm_gc_protect_object(r->contents_list);
- gnc_options_dialog_changed (r->optwin);
- update_display_lists(r);
- }
- gtk_widget_destroy(dlg);
- }
-}
Deleted: gnucash/trunk/src/report/report-gnome/dialog-column-view.h
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-column-view.h 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/dialog-column-view.h 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,33 +0,0 @@
-/********************************************************************
- * dialog-column-view.h -- editor for simple column view *
- * Copyright (C) 2001 Bill Gribble <grib at billgribble.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- ********************************************************************/
-
-#ifndef GNC_DIALOG_COLUMN_VIEW_H
-#define GNC_DIALOG_COLUMN_VIEW_H
-
-#include <libguile.h>
-#include <gtk/gtk.h>
-
-typedef struct gncp_column_view_edit gnc_column_view_edit;
-
-GtkWidget * gnc_column_view_edit_options(SCM options, SCM view);
-
-#endif
Modified: gnucash/trunk/src/report/report-gnome/dialog-custom-report.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-custom-report.c 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/dialog-custom-report.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,36 +1,30 @@
-/********************************************************************\
- * dialog-custom-report.h -- dialog for managing custom reports *
- * *
- * *
- * Copyright (C) 2009 *
- * *
- * Andrew Sackville-West *
- * (andrew at swclan.homelinux.org) *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
+/**************************************************************************\
+ * dialog-custom-report.c -- dialog for managing custom reports *
+ * *
+ * Copyright (C) 2009 Andrew Sackville-West (andrew at swclan.homelinux.org) *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+\*************************************************************************/
-
#include "config.h"
#include <glib/gi18n.h>
#include <gtk/gtk.h>
-#include <glade/glade.h>
#include <libguile.h>
#include "swig-runtime.h"
@@ -69,35 +63,39 @@
} CustomReportDialog;
-static void
-custom_report_dialog_close_cb(GtkWidget* widget,
- CustomReportDialog *crd)
+void custom_report_dialog_close_cb(GtkWidget* widget, gpointer data);
+void cancel_custom_report_clicked_cb(GtkWidget* widget, gpointer data);
+void run_custom_report_clicked_cb(GtkWidget* button, gpointer data);
+void delete_custom_report_clicked_cb(GtkWidget *button, gpointer data);
+void custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column, gpointer data);
+
+void
+custom_report_dialog_close_cb(GtkWidget* widget, gpointer data)
{
+ CustomReportDialog *crd = data;
gtk_widget_destroy(crd->dialog);
g_free(crd);
-
}
-static void
-cancel_custom_report_clicked_cb(GtkWidget* widget,
- CustomReportDialog *crd)
+void
+cancel_custom_report_clicked_cb(GtkWidget* widget, gpointer data)
{
+ CustomReportDialog *crd = data;
custom_report_dialog_close_cb(NULL, crd);
}
-/**
+/********************************************************************
* update_report_list
*
* this procedure does the real work of displaying a sorted list of
* available custom reports
- *
- */
+ ********************************************************************/
static void
update_report_list(GtkListStore *store, CustomReportDialog *crd)
{
-
SCM get_names = scm_c_eval_string("gnc:custom-report-template-names");
SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
SCM names;
@@ -114,7 +112,6 @@
if (scm_is_list(names))
{
-
/* for all the names in the list, store them, with a reference,
in the gtkliststore */
for (i = 0; !scm_is_null(names); i++)
@@ -133,11 +130,8 @@
COL_NUM, i,
-1);
names = SCM_CDR(names);
-
}
-
}
-
}
@@ -152,9 +146,9 @@
update_report_list(store, crd);
return GTK_TREE_MODEL (store);
-
}
+
static void
set_reports_model(CustomReportDialog *crd)
{
@@ -170,30 +164,25 @@
gtk_tree_view_set_model (GTK_TREE_VIEW (crd->reportview), model);
g_object_unref(model);
-
-
}
-/**
- *
+/**************************************************************
* custom_report_run_report
*
* this procedure sets up and calls the report on the scheme
* side. This is what makes the report actually run.
- */
+ **************************************************************/
static void
custom_report_run_report(SCM guid,
CustomReportDialog *crd)
{
-
SCM make_report = scm_c_eval_string("gnc:make-report");
int report_id;
GncMainWindow *window = crd->window;
if (!scm_is_null(guid))
{
-
/* this runs the report */
report_id = SCM_INUM(scm_call_1(make_report, guid));
@@ -203,12 +192,11 @@
/* display the report */
gnc_main_window_open_report(report_id, window);
-
}
-
}
-/**
+
+/********************************************************************
* get_custom_report_selection
*
* this helper function is called to get the selection when the user
@@ -217,8 +205,7 @@
*
* const gchar* message -- the message to provide user if there is no
* actual selection found.
- *
- */
+ *********************************************************************/
static SCM
get_custom_report_selection(CustomReportDialog *crd,
const gchar* message)
@@ -237,7 +224,6 @@
gtk_tree_model_get(model, &iter, COL_NUM, &num, -1);
guid = scm_list_ref(crd->reportlist, scm_int2num(num));
}
-
else
{
/* no selection, notify user */
@@ -245,26 +231,22 @@
return SCM_EOL;
}
-
return guid;
-
}
-/**
- * on_custom_report_list_view_row_activated
+
+/**************************************************************
+ * custom_report_list_view_row_activated_cb
*
* this is the double-click signal. No need to call
* get_custom_report_selection as the double-click implies the
* selection.
- *
- */
-static void
-on_custom_report_list_view_row_activated(GtkTreeView *view,
- GtkTreePath *path,
- GtkTreeViewColumn *column,
- CustomReportDialog *crd)
+ **************************************************************/
+void
+custom_report_list_view_row_activated_cb(GtkTreeView *view, GtkTreePath *path,
+ GtkTreeViewColumn *column, gpointer data)
{
-
+ CustomReportDialog *crd = data;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -280,22 +262,20 @@
guid = scm_list_ref(crd->reportlist, scm_int2num(num));
custom_report_run_report(guid, crd);
-
}
-
}
-/**
- * on_delete_custom_report_clicked
+
+/*********************************************************************
+ * delete_custom_report_clicked_cb
*
* this will delete the report, update the reports list and leave the
* dialog active for additional usage.
- *
- */
-static void
-on_delete_custom_report_clicked(GtkWidget *button,
- CustomReportDialog *crd)
+ *********************************************************************/
+void
+delete_custom_report_clicked_cb(GtkWidget *button, gpointer data)
{
+ CustomReportDialog *crd = data;
GtkTreeSelection *sel;
GtkTreeModel *model;
GtkTreeIter iter;
@@ -329,46 +309,42 @@
}
}
-static void
-run_custom_report_clicked_cb (GtkWidget* button,
- CustomReportDialog *crd)
-{
+void
+run_custom_report_clicked_cb (GtkWidget* button, gpointer data)
+{
+ CustomReportDialog *crd = data;
SCM guid = get_custom_report_selection(crd, _("You must select a report to run."));
custom_report_run_report(guid, crd);
}
-
-/**
+/***********************************************************
* gnc_ui_custom_report
*
* this is the primary driver for the custom report dialog.
- *
- */
+ ***********************************************************/
void gnc_ui_custom_report(GncMainWindow * window)
{
- GladeXML* xml;
+ GtkBuilder *builder;
CustomReportDialog *crd;
crd = g_new0(CustomReportDialog, 1);
- xml = gnc_glade_xml_new("custom-report-dialog.glade", "custom_report_dialog");
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder, "dialog-custom-report.glade", "custom_report_dialog");
- crd->dialog = glade_xml_get_widget(xml, "custom_report_dialog");
- crd->reportview = glade_xml_get_widget(xml, "custom_report_list_view");
+ crd->dialog = GTK_WIDGET(gtk_builder_get_object (builder, "custom_report_dialog"));
+ crd->reportview = GTK_WIDGET(gtk_builder_get_object (builder, "custom_report_list_view"));
set_reports_model(crd);
crd->window = window;
/* connect the signals */
- glade_xml_signal_connect_data(xml, "cancel_custom_report_clicked_cb", G_CALLBACK(cancel_custom_report_clicked_cb), crd);
- glade_xml_signal_connect_data(xml, "custom_report_dialog_close_cb", G_CALLBACK(custom_report_dialog_close_cb), crd);
- glade_xml_signal_connect_data(xml, "on_custom_report_list_view_row_activated", G_CALLBACK(on_custom_report_list_view_row_activated), crd);
- glade_xml_signal_connect_data(xml, "on_delete_custom_report_clicked", G_CALLBACK(on_delete_custom_report_clicked), crd);
- glade_xml_signal_connect_data(xml, "run_custom_report_clicked_cb", G_CALLBACK(run_custom_report_clicked_cb), crd);
+ gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, crd);
gtk_widget_show_all(crd->dialog);
+ g_object_unref(G_OBJECT(builder));
}
Copied: gnucash/trunk/src/report/report-gnome/dialog-custom-report.glade (from rev 21371, gnucash/trunk/src/report/report-gnome/custom-report-dialog.glade)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-custom-report.glade (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-custom-report.glade 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,156 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkDialog" id="custom_report_dialog">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="window_position">center-on-parent</property>
+ <property name="type_hint">dialog</property>
+ <property name="skip_taskbar_hint">True</property>
+ <property name="skip_pager_hint">True</property>
+ <signal name="close" handler="custom_report_dialog_close_cb" swapped="no"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="delete_report_button">
+ <property name="label">gtk-delete</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Delete the currently selected report</property>
+ <property name="tooltip_text" translatable="yes">Delete the currently selected report</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="delete_custom_report_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="cancel_report_button">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Exit the custom report dialog</property>
+ <property name="tooltip_text" translatable="yes">Exit the custom report dialog</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="cancel_custom_report_clicked_cb" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="run_report_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="has_tooltip">True</property>
+ <property name="tooltip_markup">Run the currently selected report</property>
+ <property name="tooltip_text" translatable="yes">Run the currently selected report</property>
+ <property name="use_action_appearance">False</property>
+ <signal name="clicked" handler="run_custom_report_clicked_cb" swapped="no"/>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-go-forward</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Run</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow1">
+ <property name="height_request">150</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <child>
+ <object class="GtkTreeView" id="custom_report_list_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <signal name="row-activated" handler="custom_report_list_view_row_activated_cb" swapped="no"/>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="0">delete_report_button</action-widget>
+ <action-widget response="0">cancel_report_button</action-widget>
+ <action-widget response="0">run_report_button</action-widget>
+ </action-widgets>
+ </object>
+</interface>
Copied: gnucash/trunk/src/report/report-gnome/dialog-report-column-view.c (from rev 21371, gnucash/trunk/src/report/report-gnome/dialog-column-view.c)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report-column-view.c (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-report-column-view.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,645 @@
+/********************************************************************
+ * dialog-report-column-view.c -- editor for column view of reports *
+ * Copyright (C) 2001 Bill Gribble <grib at billgribble.com> *
+ * Copyright (c) 2006 David Hampton <hampton at employees.org> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ ********************************************************************/
+
+#include "config.h"
+
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <libguile.h>
+#include "swig-runtime.h"
+
+#include "dialog-report-column-view.h"
+#include "dialog-options.h"
+#include "dialog-utils.h"
+#include "option-util.h"
+#include "window-report.h"
+#include "guile-mappings.h"
+#include "gnc-report.h"
+
+enum available_cols
+{
+ AVAILABLE_COL_NAME = 0,
+ AVAILABLE_COL_ROW,
+ NUM_AVAILABLE_COLS
+};
+
+enum contents_cols
+{
+ CONTENTS_COL_NAME = 0,
+ CONTENTS_COL_ROW,
+ CONTENTS_COL_REPORT_ROWS,
+ CONTENTS_COL_REPORT_COLS,
+ NUM_CONTENTS_COLS
+};
+
+struct gncp_column_view_edit
+{
+ GNCOptionWin * optwin;
+ GtkTreeView * available;
+ GtkTreeView * contents;
+
+ SCM options;
+ SCM view;
+ GNCOptionDB * odb;
+
+ SCM available_list;
+ int available_selected;
+
+ SCM contents_list;
+ int contents_selected;
+};
+
+void gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data);
+void gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data);
+void gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data);
+void gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data);
+void gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data);
+
+static void
+gnc_column_view_set_option(GNCOptionDB * odb, char * section, char * name,
+ SCM new_value)
+{
+ GNCOption * option =
+ gnc_option_db_get_option_by_name(odb, section, name);
+
+ if (option)
+ {
+ gnc_option_db_set_option(odb, section, name, new_value);
+
+ /* set_option doesn't do this */
+ gnc_option_set_changed (option, TRUE);
+ }
+}
+
+static void
+gnc_column_view_edit_destroy(gnc_column_view_edit * view)
+{
+ gnc_options_dialog_destroy(view->optwin);
+ scm_gc_unprotect_object(view->options);
+ scm_gc_unprotect_object(view->view);
+ gnc_option_db_destroy(view->odb);
+ g_free(view);
+}
+
+static void
+update_display_lists(gnc_column_view_edit * view)
+{
+ SCM get_names = scm_c_eval_string("gnc:all-report-template-names");
+ SCM template_menu_name = scm_c_eval_string("gnc:report-template-menu-name/report-guid");
+ SCM report_menu_name = scm_c_eval_string("gnc:report-menu-name");
+ SCM names = scm_call_0(get_names);
+ SCM contents =
+ gnc_option_db_lookup_option(view->odb, "__general", "report-list",
+ SCM_BOOL_F);
+ SCM this_report;
+ SCM selection;
+ const gchar *name;
+ int row, i, id;
+ GtkListStore *store;
+ GtkTreeIter iter;
+ GtkTreePath *path;
+ GtkTreeSelection *tree_selection;
+
+
+ /* Update the list of available reports (left selection box). */
+ row = view->available_selected;
+
+ if (scm_is_list(view->available_list) && !scm_is_null (view->available_list))
+ {
+ row = MIN (row, scm_ilength (view->available_list) - 1);
+ selection = scm_list_ref (view->available_list, scm_int2num (row));
+ }
+ else
+ {
+ selection = SCM_UNDEFINED;
+ }
+
+ scm_gc_unprotect_object(view->available_list);
+ view->available_list = names;
+ scm_gc_protect_object(view->available_list);
+
+ store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
+ gtk_list_store_clear(store);
+
+ if (scm_is_list(names))
+ {
+ for (i = 0; !scm_is_null(names); names = SCM_CDR(names), i++)
+ {
+ char * str;
+
+ if (scm_is_equal (SCM_CAR(names), selection))
+ row = i;
+ scm_dynwind_begin (0);
+ str = scm_to_locale_string (scm_call_2(template_menu_name, SCM_CAR(names),
+ SCM_BOOL_F));
+ name = _(g_strdup (str));
+ scm_dynwind_free (str);
+ scm_dynwind_end ();
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set(store, &iter,
+ AVAILABLE_COL_NAME, name,
+ AVAILABLE_COL_ROW, i,
+ -1);
+ }
+
+ }
+
+ tree_selection = gtk_tree_view_get_selection(view->available);
+ path = gtk_tree_path_new_from_indices(row, -1);
+ gtk_tree_selection_select_path(tree_selection, path);
+ gtk_tree_path_free(path);
+
+
+ /* Update the list of selected reports (right selection box). */
+ row = view->contents_selected;
+
+ if (scm_is_list(view->contents_list) && !scm_is_null (view->contents_list))
+ {
+ row = MIN (row, scm_ilength (view->contents_list) - 1);
+ selection = scm_list_ref (view->contents_list, scm_int2num (row));
+ }
+ else
+ {
+ selection = SCM_UNDEFINED;
+ }
+
+ scm_gc_unprotect_object(view->contents_list);
+ view->contents_list = contents;
+ scm_gc_protect_object(view->contents_list);
+
+ store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
+ gtk_list_store_clear(store);
+ if (scm_is_list(contents))
+ {
+ for (i = 0; !scm_is_null(contents); contents = SCM_CDR(contents), i++)
+ {
+ char * str;
+
+ if (scm_is_equal (SCM_CAR(contents), selection))
+ row = i;
+
+ id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, G_STRFUNC);
+ this_report = gnc_report_find(id);
+ scm_dynwind_begin (0);
+ str = scm_to_locale_string (scm_call_1(report_menu_name, this_report));
+ name = _(g_strdup (str));
+ scm_dynwind_free (str);
+ scm_dynwind_end ();
+
+ gtk_list_store_append(store, &iter);
+ gtk_list_store_set
+ (store, &iter,
+ CONTENTS_COL_NAME, name,
+ CONTENTS_COL_ROW, i,
+ CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
+ SCM_ARG1, G_STRFUNC),
+ CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
+ SCM_ARG1, G_STRFUNC),
+ -1);
+ }
+ }
+
+ tree_selection = gtk_tree_view_get_selection(view->contents);
+ path = gtk_tree_path_new_from_indices(row, -1);
+ gtk_tree_selection_select_path(tree_selection, path);
+ // gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
+ gtk_tree_path_free(path);
+}
+
+static void
+gnc_column_view_select_avail_cb(GtkTreeSelection *selection,
+ gnc_column_view_edit *r)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ AVAILABLE_COL_ROW, &r->available_selected,
+ -1);
+}
+
+static void
+gnc_column_view_select_contents_cb(GtkTreeSelection *selection,
+ gnc_column_view_edit *r)
+{
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+
+ if (gtk_tree_selection_get_selected(selection, &model, &iter))
+ gtk_tree_model_get(model, &iter,
+ AVAILABLE_COL_ROW, &r->contents_selected,
+ -1);
+}
+
+static void
+gnc_column_view_edit_apply_cb(GNCOptionWin * w, gpointer user_data)
+{
+ SCM dirty_report = scm_c_eval_string("gnc:report-set-dirty?!");
+ gnc_column_view_edit * win = user_data;
+
+ if (!win) return;
+ gnc_option_db_commit(win->odb);
+ scm_call_2(dirty_report, win->view, SCM_BOOL_T);
+}
+
+static void
+gnc_column_view_edit_close_cb(GNCOptionWin * win, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ SCM set_editor = scm_c_eval_string("gnc:report-set-editor-widget!");
+
+ scm_call_2(set_editor, r->view, SCM_BOOL_F);
+ gnc_column_view_edit_destroy(r);
+}
+
+
+/********************************************************************
+ * gnc_column_view_edit_options
+ * create the editor.
+ ********************************************************************/
+
+GtkWidget *
+gnc_column_view_edit_options(SCM options, SCM view)
+{
+ SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
+ SCM ptr;
+ GtkWidget * editor;
+ GtkListStore *store;
+ GtkCellRenderer *renderer;
+ GtkTreeViewColumn *column;
+ GtkTreeSelection *selection;
+
+ ptr = scm_call_1(get_editor, view);
+ if (ptr != SCM_BOOL_F)
+ {
+#define FUNC_NAME "gtk_window_present"
+ GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+ gtk_window_present(w);
+#undef FUNC_NAME
+ return NULL;
+ }
+ else
+ {
+ gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
+ GtkBuilder *builder;
+
+ r->optwin = gnc_options_dialog_new(NULL);
+
+ /* Hide the generic dialog page list. */
+ {
+ GtkWidget *dialog, *page_list;
+
+ dialog = gnc_options_dialog_widget(r->optwin);
+ page_list = gnc_glade_lookup_widget (dialog, "page_list");
+ gtk_widget_hide(page_list);
+ }
+
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder, "dialog-report.glade", "view_contents_table");
+
+ editor = GTK_WIDGET(gtk_builder_get_object (builder, "view_contents_table"));
+ r->available = GTK_TREE_VIEW (gtk_builder_get_object (builder, "available_view"));
+ r->contents = GTK_TREE_VIEW (gtk_builder_get_object (builder, "contents_view"));
+ r->options = options;
+ r->view = view;
+ r->available_selected = 0;
+ r->available_list = SCM_EOL;
+ r->contents_selected = 0;
+ r->contents_list = SCM_EOL;
+ r->odb = gnc_option_db_new(r->options);
+
+ gnc_options_dialog_build_contents(r->optwin, r->odb);
+
+ gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
+ (r->optwin)),
+ editor,
+ gtk_label_new(_("Contents")));
+
+ scm_gc_protect_object(r->options);
+ scm_gc_protect_object(r->view);
+ scm_gc_protect_object(r->available_list);
+ scm_gc_protect_object(r->contents_list);
+
+ /* Build the 'available' view */
+ store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
+ gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
+ gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), AVAILABLE_COL_NAME, GTK_SORT_ASCENDING);
+ g_object_unref(store);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes("", renderer,
+ "text", AVAILABLE_COL_NAME,
+ NULL);
+ gtk_tree_view_append_column(r->available, column);
+
+ selection = gtk_tree_view_get_selection(r->available);
+ g_signal_connect(selection, "changed",
+ G_CALLBACK(gnc_column_view_select_avail_cb), r);
+
+ /* Build the 'contents' view */
+ store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
+ G_TYPE_INT, G_TYPE_INT);
+ gtk_tree_view_set_model(r->contents, GTK_TREE_MODEL(store));
+ g_object_unref(store);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Report"), renderer,
+ "text", CONTENTS_COL_NAME,
+ NULL);
+ gtk_tree_view_append_column(r->contents, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Rows"), renderer,
+ "text", CONTENTS_COL_REPORT_ROWS,
+ NULL);
+ gtk_tree_view_append_column(r->contents, column);
+
+ renderer = gtk_cell_renderer_text_new();
+ column = gtk_tree_view_column_new_with_attributes(_("Cols"), renderer,
+ "text", CONTENTS_COL_REPORT_COLS,
+ NULL);
+ gtk_tree_view_append_column(r->contents, column);
+
+ selection = gtk_tree_view_get_selection(r->contents);
+ g_signal_connect(selection, "changed",
+ G_CALLBACK(gnc_column_view_select_contents_cb), r);
+
+ update_display_lists(r);
+
+ gnc_options_dialog_set_apply_cb(r->optwin,
+ gnc_column_view_edit_apply_cb, r);
+ gnc_options_dialog_set_close_cb(r->optwin,
+ gnc_column_view_edit_close_cb, r);
+
+ gtk_widget_show(gnc_options_dialog_widget(r->optwin));
+
+ gtk_builder_connect_signals_full (builder, gnc_builder_connect_full_func, r);
+
+ g_object_unref(G_OBJECT(builder));
+
+ return gnc_options_dialog_widget(r->optwin);
+ }
+}
+
+void
+gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ SCM make_report = scm_c_eval_string("gnc:make-report");
+ SCM mark_report = scm_c_eval_string("gnc:report-set-needs-save?!");
+ SCM template_name;
+ SCM new_report;
+ SCM newlist = SCM_EOL;
+ SCM oldlist = r->contents_list;
+ int count;
+ int oldlength, id;
+
+ if (scm_is_list(r->available_list) &&
+ (scm_ilength(r->available_list) > r->available_selected))
+ {
+ template_name = scm_list_ref(r->available_list,
+ scm_int2num(r->available_selected));
+ new_report = scm_call_1(make_report, template_name);
+ id = scm_num2int(new_report, SCM_ARG1, G_STRFUNC);
+ scm_call_2(mark_report, gnc_report_find(id), SCM_BOOL_T);
+ oldlength = scm_ilength(r->contents_list);
+
+ if (oldlength > r->contents_selected)
+ {
+ for (count = 0; count < r->contents_selected; count++)
+ {
+ newlist = scm_cons(SCM_CAR(oldlist), newlist);
+ oldlist = SCM_CDR(oldlist);
+ }
+ newlist = scm_append
+ (scm_listify(scm_reverse(scm_cons(SCM_LIST4(new_report,
+ scm_int2num(1),
+ scm_int2num(1),
+ SCM_BOOL_F),
+ newlist)),
+ oldlist,
+ SCM_UNDEFINED));
+ }
+ else
+ {
+ newlist = scm_append
+ (scm_listify(oldlist,
+ SCM_LIST1(SCM_LIST4(new_report,
+ scm_int2num(1),
+ scm_int2num(1),
+ SCM_BOOL_F)),
+ SCM_UNDEFINED));
+ r->contents_selected = oldlength;
+ }
+
+ scm_gc_unprotect_object(r->contents_list);
+ r->contents_list = newlist;
+ scm_gc_protect_object(r->contents_list);
+
+ gnc_column_view_set_option(r->odb, "__general", "report-list",
+ r->contents_list);
+ gnc_options_dialog_changed (r->optwin);
+ }
+
+ update_display_lists(r);
+}
+
+void
+gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ SCM newlist = SCM_EOL;
+ SCM oldlist = r->contents_list;
+ int count;
+ int oldlength;
+
+ if (scm_is_list(r->contents_list))
+ {
+ oldlength = scm_ilength(r->contents_list);
+ if (oldlength > r->contents_selected)
+ {
+ for (count = 0; count < r->contents_selected; count++)
+ {
+ newlist = scm_cons(SCM_CAR(oldlist), newlist);
+ oldlist = SCM_CDR(oldlist);
+ }
+ if (count <= oldlength)
+ {
+ newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+ }
+ }
+
+ if (r->contents_selected > 0 && oldlength == r->contents_selected + 1)
+ {
+ r->contents_selected --;
+ }
+
+ scm_gc_unprotect_object(r->contents_list);
+ r->contents_list = newlist;
+ scm_gc_protect_object(r->contents_list);
+
+ gnc_column_view_set_option(r->odb, "__general", "report-list",
+ r->contents_list);
+
+ gnc_options_dialog_changed (r->optwin);
+ }
+
+ update_display_lists(r);
+}
+
+void
+gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ SCM oldlist = r->contents_list;
+ SCM newlist = SCM_EOL;
+ SCM temp;
+ int oldlength;
+ int count;
+
+ oldlength = scm_ilength(r->contents_list);
+ if ((r->contents_selected > 0) && (oldlength > r->contents_selected))
+ {
+ for (count = 1; count < r->contents_selected; count++)
+ {
+ newlist = scm_cons(SCM_CAR(oldlist), newlist);
+ oldlist = SCM_CDR(oldlist);
+ }
+ temp = SCM_CAR(oldlist);
+ oldlist = SCM_CDR(oldlist);
+ newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
+ newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+
+ scm_gc_unprotect_object(r->contents_list);
+ r->contents_list = newlist;
+ scm_gc_protect_object(r->contents_list);
+
+ r->contents_selected = r->contents_selected - 1;
+
+ gnc_column_view_set_option(r->odb, "__general", "report-list",
+ r->contents_list);
+
+ gnc_options_dialog_changed (r->optwin);
+
+ update_display_lists(r);
+ }
+}
+
+void
+gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ SCM oldlist = r->contents_list;
+ SCM newlist = SCM_EOL;
+ SCM temp;
+ int oldlength;
+ int count;
+
+ oldlength = scm_ilength(r->contents_list);
+ if (oldlength > (r->contents_selected + 1))
+ {
+ for (count = 0; count < r->contents_selected; count++)
+ {
+ newlist = scm_cons(SCM_CAR(oldlist), newlist);
+ oldlist = SCM_CDR(oldlist);
+ }
+ temp = SCM_CAR(oldlist);
+ oldlist = SCM_CDR(oldlist);
+ newlist = scm_cons(temp, scm_cons(SCM_CAR(oldlist), newlist));
+ newlist = scm_append(scm_listify(scm_reverse(newlist), SCM_CDR(oldlist), SCM_UNDEFINED));
+
+ scm_gc_unprotect_object(r->contents_list);
+ r->contents_list = newlist;
+ scm_gc_protect_object(r->contents_list);
+
+ r->contents_selected = r->contents_selected + 1;
+
+ gnc_column_view_set_option(r->odb, "__general", "report-list",
+ r->contents_list);
+
+ gnc_options_dialog_changed (r->optwin);
+
+ update_display_lists(r);
+ }
+}
+
+void
+gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
+{
+ gnc_column_view_edit * r = user_data;
+ GtkWidget * rowspin;
+ GtkWidget * colspin;
+ GtkWidget * dlg;
+ GtkBuilder *builder;
+ SCM current;
+ int length;
+ int dlg_ret;
+
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder, "dialog-report.glade", "col_adjustment");
+ gnc_builder_add_from_file (builder, "dialog-report.glade", "row_adjustment");
+ gnc_builder_add_from_file (builder, "dialog-report.glade", "Edit Report Size");
+ dlg = GTK_WIDGET(gtk_builder_get_object (builder, "Edit Report Size"));
+
+ /* get the spinner widgets */
+ rowspin = GTK_WIDGET(gtk_builder_get_object (builder, "row_spin"));
+ colspin = GTK_WIDGET(gtk_builder_get_object (builder, "col_spin"));
+
+ length = scm_ilength(r->contents_list);
+ if (length > r->contents_selected)
+ {
+ current = scm_list_ref(r->contents_list,
+ scm_int2num(r->contents_selected));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(colspin),
+ (float)scm_num2int(SCM_CADR(current),
+ SCM_ARG1, G_STRFUNC));
+ gtk_spin_button_set_value(GTK_SPIN_BUTTON(rowspin),
+ (float)scm_num2int(SCM_CADDR(current),
+ SCM_ARG1, G_STRFUNC));
+
+ dlg_ret = gtk_dialog_run(GTK_DIALOG(dlg));
+ gtk_widget_hide(dlg);
+
+ if (dlg_ret == GTK_RESPONSE_OK)
+ {
+ current = SCM_LIST4(SCM_CAR(current),
+ scm_int2num(gtk_spin_button_get_value_as_int
+ (GTK_SPIN_BUTTON(colspin))),
+ scm_int2num(gtk_spin_button_get_value_as_int
+ (GTK_SPIN_BUTTON(rowspin))),
+ SCM_BOOL_F);
+ scm_gc_unprotect_object(r->contents_list);
+ r->contents_list = scm_list_set_x(r->contents_list,
+ scm_int2num(r->contents_selected),
+ current);
+ scm_gc_protect_object(r->contents_list);
+ gnc_options_dialog_changed (r->optwin);
+ update_display_lists(r);
+ }
+
+ g_object_unref(G_OBJECT(builder));
+
+ gtk_widget_destroy(dlg);
+ }
+}
Copied: gnucash/trunk/src/report/report-gnome/dialog-report-column-view.h (from rev 21371, gnucash/trunk/src/report/report-gnome/dialog-column-view.h)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report-column-view.h (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-report-column-view.h 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,33 @@
+/********************************************************************
+ * dialog-report-column-view.h -- editor for simple column view *
+ * Copyright (C) 2001 Bill Gribble <grib at billgribble.com> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ ********************************************************************/
+
+#ifndef GNC_DIALOG_COLUMN_VIEW_H
+#define GNC_DIALOG_COLUMN_VIEW_H
+
+#include <libguile.h>
+#include <gtk/gtk.h>
+
+typedef struct gncp_column_view_edit gnc_column_view_edit;
+
+GtkWidget * gnc_column_view_edit_options(SCM options, SCM view);
+
+#endif
Copied: gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c (from rev 21371, gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,460 @@
+/********************************************************************
+ * dialog-report-style-sheet.c -- window for configuring HTML style *
+ * sheets in GnuCash *
+ * Copyright (C) 2000 Bill Gribble <grib at billgribble.com> *
+ * Copyright (c) 2006 David Hampton <hampton at employees.org> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ ********************************************************************/
+
+#include "config.h"
+
+#include <gtk/gtk.h>
+#include <glib/gi18n.h>
+
+#include "dialog-report-style-sheet.h"
+#include "dialog-options.h"
+#include "dialog-utils.h"
+#include "gnc-gtk-utils.h"
+#include "gnc-report.h"
+#include "gnc-ui.h"
+
+StyleSheetDialog * gnc_style_sheet_dialog = NULL;
+
+struct _stylesheetdialog
+{
+ GtkWidget * toplevel;
+ GtkTreeView * list_view;
+ GtkListStore * list_store;
+ GtkWidget * options_frame;
+};
+
+typedef struct ss_info
+{
+ GNCOptionWin * odialog;
+ GNCOptionDB * odb;
+ SCM stylesheet;
+ GtkTreeRowReference *row_ref;
+} ss_info;
+
+enum
+{
+ COLUMN_NAME,
+ COLUMN_STYLESHEET,
+ COLUMN_DIALOG,
+ N_COLUMNS
+};
+
+
+/************************************************************
+ * Style Sheet Edit Dialog (I.E. an options dialog) *
+ ************************************************************/
+
+static void
+dirty_same_stylesheet(gpointer key, gpointer val, gpointer data)
+{
+ SCM dirty_ss = data;
+ SCM rep_ss = NULL;
+ SCM report = val;
+ SCM func = NULL;
+
+ func = scm_c_eval_string("gnc:report-stylesheet");
+ if (scm_is_procedure(func))
+ rep_ss = scm_call_1(func, report);
+ else
+ return;
+
+ if (scm_is_true(scm_eq_p(rep_ss, dirty_ss)))
+ {
+ func = scm_c_eval_string("gnc:report-set-dirty?!");
+ /* This makes _me_ feel dirty! */
+ if (scm_is_procedure(func))
+ scm_call_2(func, report, SCM_BOOL_T);
+ }
+}
+
+static void
+gnc_style_sheet_options_apply_cb(GNCOptionWin * propertybox,
+ gpointer user_data)
+{
+ ss_info * ssi = (ss_info *)user_data;
+ GHashTable *reports = NULL;
+
+ /* FIXME: shouldn't be global */
+ reports = gnc_reports_get_global();
+ if (reports)
+ g_hash_table_foreach(reports, dirty_same_stylesheet, ssi->stylesheet);
+
+ gnc_option_db_commit(ssi->odb);
+}
+
+
+static void
+gnc_style_sheet_options_close_cb(GNCOptionWin * propertybox,
+ gpointer user_data)
+{
+ ss_info * ssi = user_data;
+ GtkTreeIter iter;
+
+ if (gtk_tree_row_reference_valid (ssi->row_ref))
+ {
+ StyleSheetDialog * ss = gnc_style_sheet_dialog;
+ GtkTreePath *path = gtk_tree_row_reference_get_path (ssi->row_ref);
+ if (gtk_tree_model_get_iter (GTK_TREE_MODEL(ss->list_store), &iter, path))
+ gtk_list_store_set (ss->list_store, &iter,
+ COLUMN_DIALOG, NULL,
+ -1);
+ gtk_tree_path_free(path);
+ }
+ gtk_tree_row_reference_free (ssi->row_ref);
+ gnc_options_dialog_destroy(ssi->odialog);
+ gnc_option_db_destroy(ssi->odb);
+ scm_gc_unprotect_object(ssi->stylesheet);
+ g_free(ssi);
+}
+
+
+static ss_info *
+gnc_style_sheet_dialog_create(StyleSheetDialog * ss,
+ gchar *name,
+ SCM sheet_info,
+ GtkTreeRowReference *row_ref)
+{
+ SCM get_options = scm_c_eval_string("gnc:html-style-sheet-options");
+
+ SCM scm_options = scm_call_1(get_options, sheet_info);
+ ss_info * ssinfo = g_new0(ss_info, 1);
+ GtkWidget * window;
+ gchar * title;
+
+ title = g_strdup_printf(_("HTML Style Sheet Properties: %s"), name);
+ ssinfo->odialog = gnc_options_dialog_new(title);
+ ssinfo->odb = gnc_option_db_new(scm_options);
+ ssinfo->stylesheet = sheet_info;
+ ssinfo->row_ref = row_ref;
+ g_free(title);
+
+ scm_gc_protect_object(ssinfo->stylesheet);
+ g_object_ref(gnc_options_dialog_widget(ssinfo->odialog));
+
+ gnc_options_dialog_build_contents(ssinfo->odialog,
+ ssinfo->odb);
+ gnc_options_dialog_set_apply_cb(ssinfo->odialog,
+ gnc_style_sheet_options_apply_cb,
+ ssinfo);
+ gnc_options_dialog_set_close_cb(ssinfo->odialog,
+ gnc_style_sheet_options_close_cb,
+ ssinfo);
+ window = gnc_options_dialog_widget(ssinfo->odialog);
+ gtk_window_set_transient_for(GTK_WINDOW(window),
+ GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
+ gtk_window_set_destroy_with_parent(GTK_WINDOW(window), TRUE);
+ gtk_window_present(GTK_WINDOW(window));
+
+ return(ssinfo);
+}
+
+
+static SCM
+gnc_style_sheet_new (StyleSheetDialog * ssd)
+{
+ SCM make_ss = scm_c_eval_string("gnc:make-html-style-sheet");
+ SCM templates = scm_c_eval_string("(gnc:get-html-templates)");
+ SCM t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
+ SCM new_ss = SCM_BOOL_F;
+ GtkWidget * template_combo;
+ GtkTreeModel * template_model;
+ GtkWidget * name_entry;
+ gint dialog_retval;
+ GList *template_names = NULL;
+
+ /* get the new name for the style sheet */
+ GtkBuilder *builder;
+ GtkWidget *dlg;
+
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder,"dialog-report.glade", "template_liststore");
+ gnc_builder_add_from_file (builder,"dialog-report.glade", "New Style Sheet Dialog");
+
+ dlg = GTK_WIDGET(gtk_builder_get_object (builder, "New Style Sheet Dialog"));
+ template_combo = GTK_WIDGET(gtk_builder_get_object (builder, "template_combobox"));
+ name_entry = GTK_WIDGET(gtk_builder_get_object (builder, "name_entry"));
+
+ g_assert(ssd);
+
+ /* Erase the initial dummy entry. */
+ template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
+ gtk_list_store_clear(GTK_LIST_STORE(template_model));
+
+ /* put in the list of style sheet type names */
+ for (; !scm_is_null(templates); templates = SCM_CDR(templates))
+ {
+ char * str;
+ const char* orig_name;
+
+ SCM t = SCM_CAR(templates);
+ scm_dynwind_begin (0);
+ str = scm_to_locale_string (scm_call_1(t_name, t));
+ orig_name = g_strdup (str);
+ scm_dynwind_free (str);
+ scm_dynwind_end ();
+
+ /* Store the untranslated names for lookup later */
+ template_names = g_list_prepend (template_names, (gpointer)orig_name);
+
+ /* The displayed name should be translated */
+ gtk_combo_box_prepend_text(GTK_COMBO_BOX(template_combo),
+ _(orig_name));
+ }
+ gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
+
+ /* get the name */
+ gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
+ dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
+
+ if (dialog_retval == GTK_RESPONSE_OK)
+ {
+ gint choice = gtk_combo_box_get_active (GTK_COMBO_BOX(template_combo));
+ const char *template_str = g_list_nth_data (template_names, choice);
+ const char *name_str = gtk_entry_get_text(GTK_ENTRY(name_entry));
+ if (name_str && strlen(name_str) == 0)
+ {
+ /* If the name is empty, we display an error dialog but
+ * refuse to create the new style sheet. */
+ gnc_error_dialog (ssd->toplevel, "%s", _("You must provide a name for the new style sheet."));
+ name_str = NULL;
+ }
+ if (template_str && name_str)
+ {
+ new_ss = scm_call_2(make_ss,
+ scm_makfrom0str(template_str),
+ scm_makfrom0str(name_str));
+ }
+ }
+
+ g_list_free (template_names);
+
+ g_object_unref(G_OBJECT(builder));
+
+ gtk_widget_destroy(dlg);
+ return(new_ss);
+}
+
+
+/************************************************************
+ * Style Sheet Selection Dialog *
+ ************************************************************/
+static void
+gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
+ SCM sheet_info,
+ gboolean select)
+{
+ SCM get_name, scm_name;
+ const gchar *c_name;
+ char * str;
+ GtkTreeSelection *selection;
+ GtkTreeIter iter;
+
+ get_name = scm_c_eval_string("gnc:html-style-sheet-name");
+ scm_name = scm_call_1(get_name, sheet_info);
+ scm_dynwind_begin (0);
+ str = scm_to_locale_string (scm_name);
+ c_name = g_strdup (str);
+ scm_dynwind_free (str);
+ scm_dynwind_end ();
+ if (!c_name)
+ return;
+
+ /* add the column name */
+ scm_gc_protect_object(sheet_info);
+ gtk_list_store_append (ss->list_store, &iter);
+ gtk_list_store_set (ss->list_store, &iter,
+ /* Translate the displayed name */
+ COLUMN_NAME, _(c_name),
+ COLUMN_STYLESHEET, sheet_info,
+ -1);
+ /* The translation of the name fortunately doesn't affect the
+ * lookup because that is done through the sheet_info argument. */
+
+ if (select)
+ {
+ selection = gtk_tree_view_get_selection (ss->list_view);
+ gtk_tree_selection_select_iter (selection, &iter);
+ }
+}
+
+static void
+gnc_style_sheet_select_dialog_fill(StyleSheetDialog * ss)
+{
+ SCM stylesheets = scm_c_eval_string("(gnc:get-html-style-sheets)");
+ SCM sheet_info;
+
+ /* pack it full of content */
+ for (; !scm_is_null(stylesheets); stylesheets = SCM_CDR(stylesheets))
+ {
+ sheet_info = SCM_CAR(stylesheets);
+ gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
+ }
+}
+
+static void
+gnc_style_sheet_select_dialog_response_cb (GtkDialog *unused,
+ gint response,
+ gpointer user_data)
+{
+ StyleSheetDialog * ss;
+ GtkTreeSelection * selection;
+ GtkTreeRowReference * row_ref;
+ GtkTreeModel * model;
+ GtkTreePath * path;
+ GtkTreeIter iter;
+ ss_info * ssinfo;
+ SCM remover;
+ SCM sheet_info;
+ gchar *name;
+
+ ss = (StyleSheetDialog *)user_data;
+ switch (response)
+ {
+ case GNC_RESPONSE_NEW:
+ sheet_info = gnc_style_sheet_new(ss);
+ if (sheet_info == SCM_BOOL_F)
+ break;
+ gnc_style_sheet_select_dialog_add_one(ss, sheet_info, TRUE);
+ /* Fall through */
+
+ case GNC_RESPONSE_EDIT:
+ selection = gtk_tree_view_get_selection (ss->list_view);
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ {
+ gtk_tree_model_get (model, &iter,
+ COLUMN_NAME, &name,
+ COLUMN_STYLESHEET, &sheet_info,
+ -1);
+ /* Fire off options dialog here */
+ path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
+ row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
+ ssinfo = gnc_style_sheet_dialog_create(ss, name, sheet_info, row_ref);
+ gtk_list_store_set (ss->list_store, &iter,
+ COLUMN_DIALOG, ssinfo,
+ -1);
+ g_free(name);
+ }
+ break;
+
+ case GNC_RESPONSE_DELETE:
+ selection = gtk_tree_view_get_selection (ss->list_view);
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ {
+ gtk_tree_model_get (model, &iter,
+ COLUMN_STYLESHEET, &sheet_info,
+ COLUMN_DIALOG, &ssinfo,
+ -1);
+ gtk_list_store_remove (ss->list_store, &iter);
+
+ if (ssinfo)
+ gnc_style_sheet_options_close_cb(NULL, ssinfo);
+ remover = scm_c_eval_string("gnc:html-style-sheet-remove");
+ scm_call_1(remover, sheet_info);
+ scm_gc_unprotect_object(sheet_info);
+ }
+ break;
+
+ case GTK_RESPONSE_CLOSE:
+ default:
+ gnc_style_sheet_dialog = NULL;
+ gtk_widget_destroy(ss->toplevel);
+ g_free(ss);
+ break;
+ }
+}
+
+
+static void
+gnc_style_sheet_select_dialog_event_cb (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ StyleSheetDialog * ss = user_data;
+
+ g_return_if_fail(event != NULL);
+ g_return_if_fail(ss != NULL);
+
+ if (event->type != GDK_2BUTTON_PRESS)
+ return;
+
+ /* Synthesize a click of the edit button */
+ gnc_style_sheet_select_dialog_response_cb (NULL, GNC_RESPONSE_EDIT, ss);
+}
+
+
+static StyleSheetDialog *
+gnc_style_sheet_select_dialog_create(void)
+{
+ StyleSheetDialog * ss = g_new0(StyleSheetDialog, 1);
+ GtkBuilder * builder;
+ GtkCellRenderer * renderer;
+ GtkTreeSelection * selection;
+
+ builder = gtk_builder_new();
+ gnc_builder_add_from_file (builder,"dialog-report.glade", "Select Style Sheet Dialog");
+
+ ss->toplevel = GTK_WIDGET(gtk_builder_get_object (builder, "Select Style Sheet Dialog"));
+
+ ss->list_view = GTK_TREE_VIEW(gtk_builder_get_object (builder, "style_sheet_list_view"));
+ ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
+ gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
+ g_object_unref(ss->list_store);
+ renderer = gtk_cell_renderer_text_new ();
+ gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
+ _("Style Sheet Name"), renderer,
+ "text", COLUMN_NAME,
+ NULL);
+
+ selection = gtk_tree_view_get_selection (ss->list_view);
+ gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
+
+ g_signal_connect(ss->toplevel, "response",
+ G_CALLBACK(gnc_style_sheet_select_dialog_response_cb), ss);
+ g_signal_connect(ss->list_view, "event-after",
+ G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss);
+
+ gnc_style_sheet_select_dialog_fill(ss);
+
+ gtk_widget_show_all(ss->toplevel);
+
+ g_object_unref(G_OBJECT(builder));
+
+ return ss;
+}
+
+
+void
+gnc_style_sheet_dialog_open(void)
+{
+ if (gnc_style_sheet_dialog)
+ {
+ gtk_window_present(GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
+ }
+ else
+ {
+ gnc_style_sheet_dialog =
+ gnc_style_sheet_select_dialog_create();
+ }
+}
+
Copied: gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.h (from rev 21371, gnucash/trunk/src/report/report-gnome/dialog-style-sheet.h)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.h (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-report-style-sheet.h 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,31 @@
+/********************************************************************
+ * dialog-report-style-sheet.h -- window for configuring HTML style *
+ * sheets in GnuCash *
+ * Copyright (C) 2000 Bill Gribble <grib at billgribble.com> *
+ * *
+ * This program is free software; you can redistribute it and/or *
+ * modify it under the terms of the GNU General Public License as *
+ * published by the Free Software Foundation; either version 2 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License*
+ * along with this program; if not, contact: *
+ * *
+ * Free Software Foundation Voice: +1-617-542-5942 *
+ * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
+ * Boston, MA 02110-1301, USA gnu at gnu.org *
+ ********************************************************************/
+
+#ifndef GNC_DIALOG_STYLE_SHEET_H
+#define GNC_DIALOG_STYLE_SHEET_H
+
+typedef struct _stylesheetdialog StyleSheetDialog;
+
+void gnc_style_sheet_dialog_open(void);
+
+#endif
Copied: gnucash/trunk/src/report/report-gnome/dialog-report.glade (from rev 21371, gnucash/trunk/src/report/report-gnome/report.glade)
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-report.glade (rev 0)
+++ gnucash/trunk/src/report/report-gnome/dialog-report.glade 2011-10-03 19:17:35 UTC (rev 21372)
@@ -0,0 +1,935 @@
+<?xml version="1.0"?>
+<interface>
+ <requires lib="gtk+" version="2.16"/>
+ <!-- interface-naming-policy project-wide -->
+ <object class="GtkWindow" id="Edit Column View Page">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <child>
+ <object class="GtkTable" id="view_contents_table">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">3</property>
+ <property name="column_spacing">6</property>
+ <property name="row_spacing">3</property>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow27">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="contents_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="rules_hint">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847720">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>A_vailable reports</b></property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">available_view</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847736">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>_Selected Reports</b></property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ <property name="mnemonic_widget">contents_view</property>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="right_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox109">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label847721">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"> </property>
+ <property name="justify">center</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button85">
+ <property name="label" translatable="yes">A_dd >></property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gnc_column_view_edit_add_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button86">
+ <property name="label" translatable="yes"><< _Remove</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gnc_column_view_edit_remove_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847722">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="justify">center</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button87">
+ <property name="label" translatable="yes">Move _up</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gnc_edit_column_view_move_up_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button88">
+ <property name="label" translatable="yes">Move dow_n</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gnc_edit_column_view_move_down_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847723">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="justify">center</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button89">
+ <property name="label" translatable="yes">Si_ze...</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <signal name="clicked" handler="gnc_column_view_edit_size_cb"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847728">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="justify">center</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow26">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">never</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkTreeView" id="available_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="rules_hint">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ </child>
+ </object>
+ <object class="GtkDialog" id="Edit Report Size">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Report Size</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="okbutton">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="n_rows">3</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label847729">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Enter report row/column span</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="row_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">row_adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="col_spin">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ <property name="adjustment">col_adjustment</property>
+ <property name="climb_rate">1</property>
+ <property name="numeric">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options"></property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Row span:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">row_spin</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847730">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">_Column span:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">col_spin</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton</action-widget>
+ <action-widget response="-5">okbutton</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkDialog" id="HTML Style Sheet Dialog">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">HTML Style Sheets</property>
+ <property name="type_hint">dialog</property>
+ <signal name="response" handler="gnc_options_dialog_response_cb"/>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="closebutton1">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHPaned" id="hpaned1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkVBox" id="vbox92">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label847671">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Available style sheets</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow17">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">automatic</property>
+ <property name="vscrollbar_policy">automatic</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHButtonBox" id="hbox81">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">3</property>
+ <property name="layout_style">spread</property>
+ <child>
+ <object class="GtkButton" id="new_button">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete_button1">
+ <property name="label">gtk-delete</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">False</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="vbox112">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label847672">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>Style sheet options</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkVBox" id="style_sheet_options">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="resize">True</property>
+ <property name="shrink">True</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-7">closebutton1</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkDialog" id="New Style Sheet Dialog">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">New Style Sheet</property>
+ <property name="modal">True</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">8</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area12">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="cancelbutton1">
+ <property name="label">gtk-cancel</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="okbutton1">
+ <property name="label">gtk-ok</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes"><b>New style sheet info</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkTable" id="table2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label847669">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Name:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">name_entry</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847670">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">1</property>
+ <property name="label" translatable="yes">_Template:</property>
+ <property name="use_underline">True</property>
+ <property name="justify">center</property>
+ <property name="mnemonic_widget">template_combobox</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="name_entry">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">●</property>
+ <property name="activates_default">True</property>
+ <property name="invisible_char_set">True</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ <property name="primary_icon_sensitive">True</property>
+ <property name="secondary_icon_sensitive">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="y_options"></property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBox" id="template_combobox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="model">template_liststore</property>
+ <child>
+ <object class="GtkCellRendererText" id="cellrenderertext1"/>
+ <attributes>
+ <attribute name="text">0</attribute>
+ </attributes>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ <property name="y_options">GTK_FILL</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="-6">cancelbutton1</action-widget>
+ <action-widget response="-5">okbutton1</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkDialog" id="Select Style Sheet Dialog">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="title" translatable="yes">Select HTML Style Sheet</property>
+ <property name="default_width">300</property>
+ <property name="default_height">200</property>
+ <property name="type_hint">dialog</property>
+ <child internal-child="vbox">
+ <object class="GtkVBox" id="dialog-vbox9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child internal-child="action_area">
+ <object class="GtkHButtonBox" id="dialog-action_area9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="layout_style">end</property>
+ <child>
+ <object class="GtkButton" id="edit_button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <child>
+ <object class="GtkHBox" id="hbox98">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkImage" id="image1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="stock">gtk-preferences</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label847734">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Edit</property>
+ <property name="use_underline">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="add_button">
+ <property name="label">gtk-new</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="delete_button">
+ <property name="label">gtk-delete</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="close_button">
+ <property name="label">gtk-close</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="can_default">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkScrolledWindow" id="scrolledwindow28">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkTreeView" id="style_sheet_list_view">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="headers_visible">False</property>
+ <property name="enable_search">False</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <action-widgets>
+ <action-widget response="3">edit_button</action-widget>
+ <action-widget response="1">add_button</action-widget>
+ <action-widget response="2">delete_button</action-widget>
+ <action-widget response="-7">close_button</action-widget>
+ </action-widgets>
+ </object>
+ <object class="GtkAdjustment" id="col_adjustment">
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkAdjustment" id="row_adjustment">
+ <property name="upper">100</property>
+ <property name="value">1</property>
+ <property name="step_increment">1</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkListStore" id="template_liststore">
+ <columns>
+ <!-- column-name item -->
+ <column type="gchararray"/>
+ </columns>
+ <data>
+ <row>
+ <col id="0" translatable="yes">Dummy</col>
+ </row>
+ </data>
+ </object>
+</interface>
Deleted: gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/dialog-style-sheet.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,449 +0,0 @@
-/********************************************************************
- * dialog-style-sheet.c -- window for configuring HTML style *
- * sheets in GnuCash *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.com> *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- ********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "dialog-style-sheet.h"
-#include "dialog-options.h"
-#include "dialog-utils.h"
-#include "gnc-gtk-utils.h"
-#include "gnc-report.h"
-#include "gnc-ui.h"
-
-StyleSheetDialog * gnc_style_sheet_dialog = NULL;
-
-struct _stylesheetdialog
-{
- GtkWidget * toplevel;
- GtkTreeView * list_view;
- GtkListStore * list_store;
- GtkWidget * options_frame;
-};
-
-typedef struct ss_info
-{
- GNCOptionWin * odialog;
- GNCOptionDB * odb;
- SCM stylesheet;
- GtkTreeRowReference *row_ref;
-} ss_info;
-
-enum
-{
- COLUMN_NAME,
- COLUMN_STYLESHEET,
- COLUMN_DIALOG,
- N_COLUMNS
-};
-
-
-/************************************************************
- * Style Sheet Edit Dialog (I.E. an options dialog) *
- ************************************************************/
-
-static void
-dirty_same_stylesheet(gpointer key, gpointer val, gpointer data)
-{
- SCM dirty_ss = data;
- SCM rep_ss = NULL;
- SCM report = val;
- SCM func = NULL;
-
- func = scm_c_eval_string("gnc:report-stylesheet");
- if (scm_is_procedure(func))
- rep_ss = scm_call_1(func, report);
- else
- return;
-
- if (scm_is_true(scm_eq_p(rep_ss, dirty_ss)))
- {
- func = scm_c_eval_string("gnc:report-set-dirty?!");
- /* This makes _me_ feel dirty! */
- if (scm_is_procedure(func))
- scm_call_2(func, report, SCM_BOOL_T);
- }
-}
-
-static void
-gnc_style_sheet_options_apply_cb(GNCOptionWin * propertybox,
- gpointer user_data)
-{
- ss_info * ssi = (ss_info *)user_data;
- GHashTable *reports = NULL;
-
- /* FIXME: shouldn't be global */
- reports = gnc_reports_get_global();
- if (reports)
- g_hash_table_foreach(reports, dirty_same_stylesheet, ssi->stylesheet);
-
- gnc_option_db_commit(ssi->odb);
-}
-
-
-static void
-gnc_style_sheet_options_close_cb(GNCOptionWin * propertybox,
- gpointer user_data)
-{
- ss_info * ssi = user_data;
- GtkTreeIter iter;
-
- if (gtk_tree_row_reference_valid (ssi->row_ref))
- {
- StyleSheetDialog * ss = gnc_style_sheet_dialog;
- GtkTreePath *path = gtk_tree_row_reference_get_path (ssi->row_ref);
- if (gtk_tree_model_get_iter (GTK_TREE_MODEL(ss->list_store), &iter, path))
- gtk_list_store_set (ss->list_store, &iter,
- COLUMN_DIALOG, NULL,
- -1);
- gtk_tree_path_free(path);
- }
- gtk_tree_row_reference_free (ssi->row_ref);
- gnc_options_dialog_destroy(ssi->odialog);
- gnc_option_db_destroy(ssi->odb);
- scm_gc_unprotect_object(ssi->stylesheet);
- g_free(ssi);
-}
-
-
-static ss_info *
-gnc_style_sheet_dialog_create(StyleSheetDialog * ss,
- gchar *name,
- SCM sheet_info,
- GtkTreeRowReference *row_ref)
-{
- SCM get_options = scm_c_eval_string("gnc:html-style-sheet-options");
-
- SCM scm_options = scm_call_1(get_options, sheet_info);
- ss_info * ssinfo = g_new0(ss_info, 1);
- GtkWidget * window;
- gchar * title;
-
- title = g_strdup_printf(_("HTML Style Sheet Properties: %s"), name);
- ssinfo->odialog = gnc_options_dialog_new(title);
- ssinfo->odb = gnc_option_db_new(scm_options);
- ssinfo->stylesheet = sheet_info;
- ssinfo->row_ref = row_ref;
- g_free(title);
-
- scm_gc_protect_object(ssinfo->stylesheet);
- g_object_ref(gnc_options_dialog_widget(ssinfo->odialog));
-
- gnc_options_dialog_build_contents(ssinfo->odialog,
- ssinfo->odb);
- gnc_options_dialog_set_apply_cb(ssinfo->odialog,
- gnc_style_sheet_options_apply_cb,
- ssinfo);
- gnc_options_dialog_set_close_cb(ssinfo->odialog,
- gnc_style_sheet_options_close_cb,
- ssinfo);
- window = gnc_options_dialog_widget(ssinfo->odialog);
- gtk_window_set_transient_for(GTK_WINDOW(window),
- GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
- gtk_window_set_destroy_with_parent(GTK_WINDOW(window), TRUE);
- gtk_window_present(GTK_WINDOW(window));
-
- return(ssinfo);
-}
-
-
-static SCM
-gnc_style_sheet_new (StyleSheetDialog * ssd)
-{
- SCM make_ss = scm_c_eval_string("gnc:make-html-style-sheet");
- SCM templates = scm_c_eval_string("(gnc:get-html-templates)");
- SCM t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
- SCM new_ss = SCM_BOOL_F;
- GtkWidget * template_combo;
- GtkTreeModel * template_model;
- GtkWidget * name_entry;
- gint dialog_retval;
- GList *template_names = NULL;
-
- /* get the new name for the style sheet */
- GladeXML *xml = gnc_glade_xml_new ("report.glade",
- "New Style Sheet Dialog");
- GtkWidget * dlg = glade_xml_get_widget (xml, "New Style Sheet Dialog");
- template_combo = glade_xml_get_widget (xml, "template_combobox");
- name_entry = glade_xml_get_widget (xml, "name_entry");
-
- g_assert(ssd);
-
- /* Erase the initial dummy entry. */
- template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
- gtk_list_store_clear(GTK_LIST_STORE(template_model));
-
- /* put in the list of style sheet type names */
- for (; !scm_is_null(templates); templates = SCM_CDR(templates))
- {
- char * str;
- const char* orig_name;
-
- SCM t = SCM_CAR(templates);
- scm_dynwind_begin (0);
- str = scm_to_locale_string (scm_call_1(t_name, t));
- orig_name = g_strdup (str);
- scm_dynwind_free (str);
- scm_dynwind_end ();
-
- /* Store the untranslated names for lookup later */
- template_names = g_list_prepend (template_names, (gpointer)orig_name);
-
- /* The displayed name should be translated */
- gtk_combo_box_prepend_text(GTK_COMBO_BOX(template_combo),
- _(orig_name));
- }
- gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
-
- /* get the name */
- gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
- dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
-
- if (dialog_retval == GTK_RESPONSE_OK)
- {
- gint choice = gtk_combo_box_get_active (GTK_COMBO_BOX(template_combo));
- const char *template_str = g_list_nth_data (template_names, choice);
- const char *name_str = gtk_entry_get_text(GTK_ENTRY(name_entry));
- if (name_str && strlen(name_str) == 0)
- {
- /* If the name is empty, we display an error dialog but
- * refuse to create the new style sheet. */
- gnc_error_dialog (ssd->toplevel, "%s", _("You must provide a name for the new style sheet."));
- name_str = NULL;
- }
- if (template_str && name_str)
- {
- new_ss = scm_call_2(make_ss,
- scm_makfrom0str(template_str),
- scm_makfrom0str(name_str));
- }
- }
-
- g_list_free (template_names);
- gtk_widget_destroy(dlg);
- return(new_ss);
-}
-
-
-/************************************************************
- * Style Sheet Selection Dialog *
- ************************************************************/
-static void
-gnc_style_sheet_select_dialog_add_one(StyleSheetDialog * ss,
- SCM sheet_info,
- gboolean select)
-{
- SCM get_name, scm_name;
- const gchar *c_name;
- char * str;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
-
- get_name = scm_c_eval_string("gnc:html-style-sheet-name");
- scm_name = scm_call_1(get_name, sheet_info);
- scm_dynwind_begin (0);
- str = scm_to_locale_string (scm_name);
- c_name = g_strdup (str);
- scm_dynwind_free (str);
- scm_dynwind_end ();
- if (!c_name)
- return;
-
- /* add the column name */
- scm_gc_protect_object(sheet_info);
- gtk_list_store_append (ss->list_store, &iter);
- gtk_list_store_set (ss->list_store, &iter,
- /* Translate the displayed name */
- COLUMN_NAME, _(c_name),
- COLUMN_STYLESHEET, sheet_info,
- -1);
- /* The translation of the name fortunately doesn't affect the
- * lookup because that is done through the sheet_info argument. */
-
- if (select)
- {
- selection = gtk_tree_view_get_selection (ss->list_view);
- gtk_tree_selection_select_iter (selection, &iter);
- }
-}
-
-static void
-gnc_style_sheet_select_dialog_fill(StyleSheetDialog * ss)
-{
- SCM stylesheets = scm_c_eval_string("(gnc:get-html-style-sheets)");
- SCM sheet_info;
-
- /* pack it full of content */
- for (; !scm_is_null(stylesheets); stylesheets = SCM_CDR(stylesheets))
- {
- sheet_info = SCM_CAR(stylesheets);
- gnc_style_sheet_select_dialog_add_one(ss, sheet_info, FALSE);
- }
-}
-
-static void
-gnc_style_sheet_select_dialog_response_cb (GtkDialog *unused,
- gint response,
- gpointer user_data)
-{
- StyleSheetDialog * ss;
- GtkTreeSelection * selection;
- GtkTreeRowReference * row_ref;
- GtkTreeModel * model;
- GtkTreePath * path;
- GtkTreeIter iter;
- ss_info * ssinfo;
- SCM remover;
- SCM sheet_info;
- gchar *name;
-
- ss = (StyleSheetDialog *)user_data;
- switch (response)
- {
- case GNC_RESPONSE_NEW:
- sheet_info = gnc_style_sheet_new(ss);
- if (sheet_info == SCM_BOOL_F)
- break;
- gnc_style_sheet_select_dialog_add_one(ss, sheet_info, TRUE);
- /* Fall through */
-
- case GNC_RESPONSE_EDIT:
- selection = gtk_tree_view_get_selection (ss->list_view);
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- {
- gtk_tree_model_get (model, &iter,
- COLUMN_NAME, &name,
- COLUMN_STYLESHEET, &sheet_info,
- -1);
- /* Fire off options dialog here */
- path = gtk_tree_model_get_path (GTK_TREE_MODEL(ss->list_store), &iter);
- row_ref = gtk_tree_row_reference_new (GTK_TREE_MODEL(ss->list_store), path);
- ssinfo = gnc_style_sheet_dialog_create(ss, name, sheet_info, row_ref);
- gtk_list_store_set (ss->list_store, &iter,
- COLUMN_DIALOG, ssinfo,
- -1);
- g_free(name);
- }
- break;
-
- case GNC_RESPONSE_DELETE:
- selection = gtk_tree_view_get_selection (ss->list_view);
- if (gtk_tree_selection_get_selected (selection, &model, &iter))
- {
- gtk_tree_model_get (model, &iter,
- COLUMN_STYLESHEET, &sheet_info,
- COLUMN_DIALOG, &ssinfo,
- -1);
- gtk_list_store_remove (ss->list_store, &iter);
-
- if (ssinfo)
- gnc_style_sheet_options_close_cb(NULL, ssinfo);
- remover = scm_c_eval_string("gnc:html-style-sheet-remove");
- scm_call_1(remover, sheet_info);
- scm_gc_unprotect_object(sheet_info);
- }
- break;
-
- case GTK_RESPONSE_CLOSE:
- default:
- gnc_style_sheet_dialog = NULL;
- gtk_widget_destroy(ss->toplevel);
- g_free(ss);
- break;
- }
-}
-
-
-static void
-gnc_style_sheet_select_dialog_event_cb (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data)
-{
- StyleSheetDialog * ss = user_data;
-
- g_return_if_fail(event != NULL);
- g_return_if_fail(ss != NULL);
-
- if (event->type != GDK_2BUTTON_PRESS)
- return;
-
- /* Synthesize a click of the edit button */
- gnc_style_sheet_select_dialog_response_cb (NULL, GNC_RESPONSE_EDIT, ss);
-}
-
-
-static StyleSheetDialog *
-gnc_style_sheet_select_dialog_create(void)
-{
- StyleSheetDialog * ss = g_new0(StyleSheetDialog, 1);
- GladeXML * xml;
- GtkCellRenderer * renderer;
- GtkTreeSelection * selection;
-
- xml = gnc_glade_xml_new ("report.glade", "Select Style Sheet Dialog");
-
- ss->toplevel = glade_xml_get_widget (xml, "Select Style Sheet Dialog");
-
- ss->list_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "style_sheet_list_view"));
- ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
- gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
- g_object_unref(ss->list_store);
- renderer = gtk_cell_renderer_text_new ();
- gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
- _("Style Sheet Name"), renderer,
- "text", COLUMN_NAME,
- NULL);
-
- selection = gtk_tree_view_get_selection (ss->list_view);
- gtk_tree_selection_set_mode (selection, GTK_SELECTION_BROWSE);
-
- g_signal_connect(ss->toplevel, "response",
- G_CALLBACK(gnc_style_sheet_select_dialog_response_cb), ss);
- g_signal_connect(ss->list_view, "event-after",
- G_CALLBACK(gnc_style_sheet_select_dialog_event_cb), ss);
-
- gnc_style_sheet_select_dialog_fill(ss);
-
- gtk_widget_show_all(ss->toplevel);
-
- return ss;
-}
-
-
-void
-gnc_style_sheet_dialog_open(void)
-{
- if (gnc_style_sheet_dialog)
- {
- gtk_window_present(GTK_WINDOW(gnc_style_sheet_dialog->toplevel));
- }
- else
- {
- gnc_style_sheet_dialog =
- gnc_style_sheet_select_dialog_create();
- }
-}
-
Deleted: gnucash/trunk/src/report/report-gnome/dialog-style-sheet.h
===================================================================
--- gnucash/trunk/src/report/report-gnome/dialog-style-sheet.h 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/dialog-style-sheet.h 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,31 +0,0 @@
-/********************************************************************
- * dialog-style-sheet.h -- window for configuring HTML style *
- * sheets in GnuCash *
- * Copyright (C) 2000 Bill Gribble <grib at billgribble.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
- ********************************************************************/
-
-#ifndef GNC_DIALOG_STYLE_SHEET_H
-#define GNC_DIALOG_STYLE_SHEET_H
-
-typedef struct _stylesheetdialog StyleSheetDialog;
-
-void gnc_style_sheet_dialog_open(void);
-
-#endif
Modified: gnucash/trunk/src/report/report-gnome/report-gnome.i
===================================================================
--- gnucash/trunk/src/report/report-gnome/report-gnome.i 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/report-gnome.i 2011-10-03 19:17:35 UTC (rev 21372)
@@ -3,7 +3,7 @@
/* Includes the header in the wrapper code */
#include <config.h>
#include <gtk/gtk.h>
-#include <dialog-column-view.h>
+#include <dialog-report-column-view.h>
#include <gnc-plugin-page-report.h>
#include <window-report.h>
#include <dialog-custom-report.h>
Deleted: gnucash/trunk/src/report/report-gnome/report.glade
===================================================================
--- gnucash/trunk/src/report/report-gnome/report.glade 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/report-gnome/report.glade 2011-10-03 19:17:35 UTC (rev 21372)
@@ -1,840 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.10 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkDialog" id="New Style Sheet Dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">New Style Sheet</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox15">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>New style sheet info</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkTable" id="table2">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label847669">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Name:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">name_entry</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847670">
- <property name="visible">True</property>
- <property name="xalign">1</property>
- <property name="label" translatable="yes">_Template:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">template_combobox</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="name_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkComboBox" id="template_combobox">
- <property name="visible">True</property>
- <property name="items">Dummy Entry</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area15">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancelbutton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="okbutton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkWindow" id="Edit Column View Page">
- <property name="visible">True</property>
- <property name="border_width">6</property>
- <child>
- <widget class="GtkTable" id="view_contents_table">
- <property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">3</property>
- <property name="column_spacing">6</property>
- <property name="row_spacing">3</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow27">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTreeView" id="contents_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="rules_hint">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847720">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>A_vailable reports</b></property>
- <property name="use_markup">True</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">available_view</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847736">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>_Selected Reports</b></property>
- <property name="use_markup">True</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">contents_view</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox109">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label847721">
- <property name="visible">True</property>
- <property name="label"> </property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button85">
- <property name="label" translatable="yes">A_dd >></property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gnc_column_view_edit_add_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button86">
- <property name="label" translatable="yes"><< _Remove</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gnc_column_view_edit_remove_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847722">
- <property name="visible">True</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button87">
- <property name="label" translatable="yes">Move _up</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gnc_edit_column_view_move_up_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button88">
- <property name="label" translatable="yes">Move dow_n</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gnc_edit_column_view_move_down_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847723">
- <property name="visible">True</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button89">
- <property name="label" translatable="yes">Si_ze...</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <signal name="clicked" handler="gnc_column_view_edit_size_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">7</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847728">
- <property name="visible">True</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">8</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow26">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTreeView" id="available_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="rules_hint">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="Edit Report Size">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Report Size</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox17">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="border_width">6</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label847729">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter report row/column span</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="row_spin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">1 0 100 1 10 0</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkSpinButton" id="col_spin">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="adjustment">1 0 100 1 10 0</property>
- <property name="climb_rate">1</property>
- <property name="numeric">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options"></property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Row span:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">row_spin</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847730">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">_Column span:</property>
- <property name="use_underline">True</property>
- <property name="justify">center</property>
- <property name="mnemonic_widget">col_spin</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area17">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancelbutton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="okbutton">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HTML Style Sheet Dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">HTML Style Sheets</property>
- <property name="type_hint">dialog</property>
- <signal name="response" handler="gnc_options_dialog_response_cb"/>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox18">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkHPaned" id="hpaned1">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkVBox" id="vbox92">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label847671">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Available style sheets</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow17">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkCList" id="style_sheet_list">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="n_columns">1</property>
- <property name="shadow_type">in</property>
- <property name="selection_mode">single</property>
- <child>
- <widget class="GtkLabel" id="label847668">
- <property name="label" translatable="yes">label847668</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0.5</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHButtonBox" id="hbox81">
- <property name="visible">True</property>
- <property name="spacing">3</property>
- <property name="layout_style">spread</property>
- <child>
- <widget class="GtkButton" id="new_button">
- <property name="label">gtk-new</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="delete_button">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">False</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="vbox112">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label847672">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Style sheet options</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVBox" id="style_sheet_options">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="resize">True</property>
- <property name="shrink">True</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area18">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="closebutton1">
- <property name="label">gtk-close</property>
- <property name="response_id">-7</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="Select Style Sheet Dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Select HTML Style Sheet</property>
- <property name="default_width">300</property>
- <property name="default_height">200</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox19">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow28">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <child>
- <widget class="GtkTreeView" id="style_sheet_list_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="headers_visible">False</property>
- <property name="enable_search">False</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area19">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="edit_button">
- <property name="response_id">3</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox98">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-preferences</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847734">
- <property name="visible">True</property>
- <property name="label" translatable="yes">_Edit</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="add_button">
- <property name="label">gtk-new</property>
- <property name="response_id">1</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="delete_button">
- <property name="label">gtk-delete</property>
- <property name="response_id">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="close_button">
- <property name="label">gtk-close</property>
- <property name="response_id">-7</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
Modified: gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c
===================================================================
--- gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c 2011-10-03 18:15:57 UTC (rev 21371)
+++ gnucash/trunk/src/report/stylesheets/gnc-plugin-stylesheets.c 2011-10-03 19:17:35 UTC (rev 21372)
@@ -25,7 +25,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
-#include "dialog-style-sheet.h"
+#include "dialog-report-style-sheet.h"
#include "gnc-gnome-utils.h"
#include "gnc-plugin-stylesheets.h"
#include "gnc-plugin-manager.h"
More information about the gnucash-changes
mailing list