mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Bug #660369 - Migrate Report dialogs to Builder from GladeXML
Patch by Robert Fewell with minor tweaks git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21372 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -502,13 +502,13 @@ src/register/register-gnome/pricecell-gnome.c
|
||||
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
|
||||
|
||||
@@ -21,18 +21,18 @@ AM_CPPFLAGS = \
|
||||
|
||||
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 @@ gncmod_DATA = report-gnome.scm
|
||||
|
||||
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 @@ ui_DATA = \
|
||||
|
||||
EXTRA_DIST = \
|
||||
report-gnome.i \
|
||||
${glade_DATA} \
|
||||
${gtkbuilder_DATA} \
|
||||
${gncmod_DATA} \
|
||||
${ui_DATA}
|
||||
|
||||
|
||||
@@ -1,36 +1,30 @@
|
||||
/********************************************************************\
|
||||
* dialog-custom-report.h -- dialog for managing custom reports *
|
||||
* *
|
||||
* *
|
||||
* Copyright (C) 2009 *
|
||||
* *
|
||||
* Andrew Sackville-West *
|
||||
* (andrew@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@gnu.org *
|
||||
\********************************************************************/
|
||||
|
||||
/**************************************************************************\
|
||||
* dialog-custom-report.c -- dialog for managing custom reports *
|
||||
* *
|
||||
* Copyright (C) 2009 Andrew Sackville-West (andrew@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@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 @@ typedef struct _CustomReportDialog
|
||||
|
||||
} 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 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
|
||||
|
||||
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 @@ update_report_list(GtkListStore *store, CustomReportDialog *crd)
|
||||
COL_NUM, i,
|
||||
-1);
|
||||
names = SCM_CDR(names);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -152,9 +146,9 @@ create_and_fill_report_list(CustomReportDialog *crd)
|
||||
update_report_list(store, crd);
|
||||
|
||||
return GTK_TREE_MODEL (store);
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
set_reports_model(CustomReportDialog *crd)
|
||||
{
|
||||
@@ -170,30 +164,25 @@ set_reports_model(CustomReportDialog *crd)
|
||||
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 @@ custom_report_run_report(SCM guid,
|
||||
|
||||
/* 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 @@ custom_report_run_report(SCM guid,
|
||||
*
|
||||
* 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 @@ get_custom_report_selection(CustomReportDialog *crd,
|
||||
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 @@ get_custom_report_selection(CustomReportDialog *crd,
|
||||
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 @@ on_custom_report_list_view_row_activated(GtkTreeView *view,
|
||||
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 @@ on_delete_custom_report_clicked(GtkWidget *button,
|
||||
}
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -1,54 +1,38 @@
|
||||
<?xml version="1.0"?>
|
||||
<glade-interface>
|
||||
<!-- interface-requires gtk+ 2.10 -->
|
||||
<!-- interface-naming-policy toplevel-contextual -->
|
||||
<widget class="GtkDialog" id="custom_report_dialog">
|
||||
<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>
|
||||
<property name="has_separator">False</property>
|
||||
<signal name="close" handler="custom_report_dialog_close_cb"/>
|
||||
<signal name="close" handler="custom_report_dialog_close_cb" swapped="no"/>
|
||||
<child internal-child="vbox">
|
||||
<widget class="GtkVBox" id="dialog-vbox1">
|
||||
<object class="GtkVBox" id="dialog-vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="can_focus">False</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">
|
||||
<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>
|
||||
<widget class="GtkButton" id="delete_custom_report">
|
||||
<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">False</property>
|
||||
<property name="tooltip" translatable="yes">Delete the currently selected report</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="on_delete_custom_report_clicked"/>
|
||||
</widget>
|
||||
<signal name="clicked" handler="delete_custom_report_clicked_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
@@ -56,15 +40,18 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="cancel_custom_report">
|
||||
<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">False</property>
|
||||
<property name="tooltip" translatable="yes">Exit the custom report dialog</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"/>
|
||||
</widget>
|
||||
<signal name="clicked" handler="cancel_custom_report_clicked_cb" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
@@ -72,27 +59,32 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkButton" id="run_custom_report">
|
||||
<object class="GtkButton" id="run_report_button">
|
||||
<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"/>
|
||||
<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>
|
||||
<widget class="GtkAlignment" id="alignment1">
|
||||
<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>
|
||||
<widget class="GtkHBox" id="hbox1">
|
||||
<object class="GtkHBox" id="hbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
<child>
|
||||
<widget class="GtkImage" id="image1">
|
||||
<object class="GtkImage" id="image1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="stock">gtk-go-forward</property>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
@@ -100,36 +92,65 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<widget class="GtkLabel" id="label1">
|
||||
<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>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
</child>
|
||||
</widget>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</widget>
|
||||
</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>
|
||||
</widget>
|
||||
<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>
|
||||
</widget>
|
||||
</glade-interface>
|
||||
<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>
|
||||
@@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* dialog-column-view.c -- editor for simple column view of reports *
|
||||
* dialog-report-column-view.c -- editor for column view of reports *
|
||||
* Copyright (C) 2001 Bill Gribble <grib@billgribble.com> *
|
||||
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
|
||||
* *
|
||||
@@ -24,10 +24,11 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <libguile.h>
|
||||
#include "swig-runtime.h"
|
||||
|
||||
#include "dialog-column-view.h"
|
||||
#include "dialog-report-column-view.h"
|
||||
#include "dialog-options.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "option-util.h"
|
||||
@@ -68,17 +69,11 @@ struct gncp_column_view_edit
|
||||
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);
|
||||
|
||||
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,
|
||||
@@ -307,7 +302,7 @@ gnc_column_view_edit_options(SCM options, SCM view)
|
||||
else
|
||||
{
|
||||
gnc_column_view_edit * r = g_new0(gnc_column_view_edit, 1);
|
||||
GladeXML *xml;
|
||||
GtkBuilder *builder;
|
||||
|
||||
r->optwin = gnc_options_dialog_new(NULL);
|
||||
|
||||
@@ -320,31 +315,12 @@ gnc_column_view_edit_options(SCM options, SCM view)
|
||||
gtk_widget_hide(page_list);
|
||||
}
|
||||
|
||||
xml = gnc_glade_xml_new ("report.glade", "view_contents_table");
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder, "dialog-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"));
|
||||
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;
|
||||
@@ -417,11 +393,16 @@ gnc_column_view_edit_options(SCM options, SCM view)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
|
||||
{
|
||||
gnc_column_view_edit * r = user_data;
|
||||
@@ -484,7 +465,7 @@ gnc_column_view_edit_add_cb(GtkButton * button, gpointer user_data)
|
||||
update_display_lists(r);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
|
||||
{
|
||||
gnc_column_view_edit * r = user_data;
|
||||
@@ -527,7 +508,7 @@ gnc_column_view_edit_remove_cb(GtkButton * button, gpointer user_data)
|
||||
update_display_lists(r);
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
|
||||
{
|
||||
gnc_column_view_edit * r = user_data;
|
||||
@@ -565,7 +546,7 @@ gnc_edit_column_view_move_up_cb(GtkButton * button, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
void
|
||||
gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
|
||||
{
|
||||
gnc_column_view_edit * r = user_data;
|
||||
@@ -603,24 +584,27 @@ gnc_edit_column_view_move_down_cb(GtkButton * button, gpointer user_data)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
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;
|
||||
GtkBuilder *builder;
|
||||
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");
|
||||
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 = glade_xml_get_widget (xml, "row_spin");
|
||||
colspin = glade_xml_get_widget (xml, "col_spin");
|
||||
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)
|
||||
@@ -653,6 +637,9 @@ gnc_column_view_edit_size_cb(GtkButton * button, gpointer user_data)
|
||||
gnc_options_dialog_changed (r->optwin);
|
||||
update_display_lists(r);
|
||||
}
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
|
||||
gtk_widget_destroy(dlg);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* dialog-column-view.h -- editor for simple column view *
|
||||
* dialog-report-column-view.h -- editor for simple column view *
|
||||
* Copyright (C) 2001 Bill Gribble <grib@billgribble.com> *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or *
|
||||
@@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* dialog-style-sheet.c -- window for configuring HTML style *
|
||||
* dialog-report-style-sheet.c -- window for configuring HTML style *
|
||||
* sheets in GnuCash *
|
||||
* Copyright (C) 2000 Bill Gribble <grib@billgribble.com> *
|
||||
* Copyright (c) 2006 David Hampton <hampton@employees.org> *
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
#include "dialog-style-sheet.h"
|
||||
#include "dialog-report-style-sheet.h"
|
||||
#include "dialog-options.h"
|
||||
#include "dialog-utils.h"
|
||||
#include "gnc-gtk-utils.h"
|
||||
@@ -184,11 +184,16 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
|
||||
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");
|
||||
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);
|
||||
|
||||
@@ -243,6 +248,9 @@ gnc_style_sheet_new (StyleSheetDialog * ssd)
|
||||
}
|
||||
|
||||
g_list_free (template_names);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
|
||||
gtk_widget_destroy(dlg);
|
||||
return(new_ss);
|
||||
}
|
||||
@@ -399,15 +407,16 @@ static StyleSheetDialog *
|
||||
gnc_style_sheet_select_dialog_create(void)
|
||||
{
|
||||
StyleSheetDialog * ss = g_new0(StyleSheetDialog, 1);
|
||||
GladeXML * xml;
|
||||
GtkBuilder * builder;
|
||||
GtkCellRenderer * renderer;
|
||||
GtkTreeSelection * selection;
|
||||
|
||||
xml = gnc_glade_xml_new ("report.glade", "Select Style Sheet Dialog");
|
||||
builder = gtk_builder_new();
|
||||
gnc_builder_add_from_file (builder,"dialog-report.glade", "Select Style Sheet Dialog");
|
||||
|
||||
ss->toplevel = glade_xml_get_widget (xml, "Select Style Sheet Dialog");
|
||||
ss->toplevel = GTK_WIDGET(gtk_builder_get_object (builder, "Select Style Sheet Dialog"));
|
||||
|
||||
ss->list_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "style_sheet_list_view"));
|
||||
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);
|
||||
@@ -429,6 +438,8 @@ gnc_style_sheet_select_dialog_create(void)
|
||||
|
||||
gtk_widget_show_all(ss->toplevel);
|
||||
|
||||
g_object_unref(G_OBJECT(builder));
|
||||
|
||||
return ss;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/********************************************************************
|
||||
* dialog-style-sheet.h -- window for configuring HTML style *
|
||||
* dialog-report-style-sheet.h -- window for configuring HTML style *
|
||||
* sheets in GnuCash *
|
||||
* Copyright (C) 2000 Bill Gribble <grib@billgribble.com> *
|
||||
* *
|
||||
File diff suppressed because it is too large
Load Diff
@@ -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>
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user