Add gnc_html_copy and enable report pages to copy to clipboard. Fixes

#343645. Readd descriptions for Cut/Copy/Paste actions in register
pages.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14318 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Andreas Köhler 2006-06-04 12:23:58 +00:00
parent 4abbcdee4e
commit 6a590e818a
5 changed files with 58 additions and 3 deletions

View File

@ -1,3 +1,13 @@
2006-06-04 Andreas Köhler <andi5.py@gmx.net>
* src/gnome-utils/gnc-html.[ch]:
* src/report/report-gnome/gnc-plugin-page-report.c: Add
gnc_html_copy and enable report pages to copy to clipboard.
Fixes #343645.
* src/gnome/gnc-plugin-page-register.c: Readd descriptions for
Cut/Copy/Paste actions in register pages.
2006-06-03 Derek Atkins <derek@ihtfp.com>
* src/engine/Split.c:

View File

@ -1267,6 +1267,14 @@ gnc_html_set_button_cb(gnc_html * html, GncHTMLButtonCB button_cb,
html->button_cb_data = data;
}
void
gnc_html_copy(gnc_html *html)
{
g_return_if_fail(html);
gtk_html_copy(GTK_HTML(html->html));
}
/**************************************************************
* gnc_html_export : wrapper around the builtin function in gtkhtml
**************************************************************/

View File

@ -97,6 +97,7 @@ void gnc_html_show_url(gnc_html * html,
void gnc_html_show_data(gnc_html * html,
const char * data, int datalen);
void gnc_html_reload(gnc_html * html);
void gnc_html_copy(gnc_html *html);
gboolean gnc_html_export(gnc_html * html, const char *file);
void gnc_html_print(gnc_html * html);
void gnc_html_cancel(gnc_html * html);

View File

@ -171,13 +171,13 @@ static GtkActionEntry gnc_plugin_page_register_actions [] =
/* Edit menu */
{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
NULL,
N_("Cut the current selection and copy it to clipboard"),
G_CALLBACK (gnc_plugin_page_register_cmd_cut) },
{ "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
NULL,
N_("Copy the current selection to clipboard"),
G_CALLBACK (gnc_plugin_page_register_cmd_copy) },
{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
NULL,
N_("Paste the clipboard content at the cursor position"),
G_CALLBACK (gnc_plugin_page_register_cmd_paste) },
{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit Account"), "<control>e",
N_("Edit the selected account"),

View File

@ -135,6 +135,7 @@ static void gnc_plugin_page_report_destroy_widget( GncPluginPage *plugin_page );
static void gnc_plugin_page_report_save_page (GncPluginPage *plugin_page, GKeyFile *file, const gchar *group);
static GncPluginPage *gnc_plugin_page_report_recreate_page (GtkWidget *window, GKeyFile *file, const gchar *group);
static void gnc_plugin_page_report_name_changed (GncPluginPage *page, const gchar *name);
static void gnc_plugin_page_report_update_edit_menu (GncPluginPage *page, gboolean hide);
static gboolean gnc_plugin_page_report_finish_pending (GncPluginPage *page);
static int gnc_plugin_page_report_check_urltype(URLType t);
@ -162,6 +163,7 @@ static void gnc_plugin_page_report_save_cb(GtkAction *action, GncPluginPageRepor
static void gnc_plugin_page_report_export_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_options_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_print_cb(GtkAction *action, GncPluginPageReport *rep);
static void gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *rep);
GType
gnc_plugin_page_report_get_type (void)
@ -262,6 +264,7 @@ gnc_plugin_page_report_class_init (GncPluginPageReportClass *klass)
gnc_plugin_page_class->save_page = gnc_plugin_page_report_save_page;
gnc_plugin_page_class->recreate_page = gnc_plugin_page_report_recreate_page;
gnc_plugin_page_class->page_name_changed = gnc_plugin_page_report_name_changed;
gnc_plugin_page_class->update_edit_menu_actions = gnc_plugin_page_report_update_edit_menu;
gnc_plugin_page_class->finish_pending = gnc_plugin_page_report_finish_pending;
g_type_class_add_private(klass, sizeof(GncPluginPageReportPrivate));
@ -854,6 +857,21 @@ gnc_plugin_page_report_name_changed (GncPluginPage *page, const gchar *name)
LEAVE(" ");
}
static void
gnc_plugin_page_report_update_edit_menu (GncPluginPage *page, gboolean hide)
{
GtkAction *action;
action = gnc_plugin_page_get_action (page, "EditCopyAction");
gtk_action_set_sensitive (action, TRUE);
gtk_action_set_visible (action, TRUE);
action = gnc_plugin_page_get_action (page, "EditCutAction");
gtk_action_set_sensitive (action, FALSE);
gtk_action_set_visible (action, !hide);
action = gnc_plugin_page_get_action (page, "EditPasteAction");
gtk_action_set_sensitive (action, FALSE);
gtk_action_set_visible (action, !hide);
}
static gboolean
gnc_plugin_page_report_finish_pending (GncPluginPage *page)
@ -914,6 +932,15 @@ static GtkActionEntry report_actions[] =
{ "FilePrintAction", GTK_STOCK_PRINT, N_("_Print Report..."), "<control>p",
N_("Print the current report"),
G_CALLBACK(gnc_plugin_page_report_print_cb) },
{ "EditCutAction", GTK_STOCK_CUT, N_("Cu_t"), NULL,
N_("Cut the current selection and copy it to clipboard"),
NULL },
{ "EditCopyAction", GTK_STOCK_COPY, N_("_Copy"), NULL,
N_("Copy the current selection to clipboard"),
G_CALLBACK(gnc_plugin_page_report_copy_cb) },
{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
N_("Paste the clipboard content at the cursor position"),
NULL },
{ "ReportSaveAction", GTK_STOCK_SAVE, N_("Add _Report"), "",
N_("Add the current report to the `Custom' menu for later use. "
"The report will be saved in the file ~/.gnucash/saved-reports-2.0. "
@ -1416,6 +1443,15 @@ gnc_plugin_page_report_print_cb( GtkAction *action, GncPluginPageReport *report
gnc_html_print(priv->html);
}
static void
gnc_plugin_page_report_copy_cb(GtkAction *action, GncPluginPageReport *report)
{
GncPluginPageReportPrivate *priv;
priv = GNC_PLUGIN_PAGE_REPORT_GET_PRIVATE(report);
gnc_html_copy(priv->html);
}
/********************************************************************
* gnc_main_window_open_report()
* open an report in a top level window from an ID number