aboutsummaryrefslogtreecommitdiff
path: root/hardinfo2/callbacks.c
diff options
context:
space:
mode:
authorLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-24 15:25:46 +0000
committerLeandro A. F. Pereira <leandro@hardinfo.org>2006-10-24 15:25:46 +0000
commitc4fea4934333faac2a6629c945333697d2d15142 (patch)
tree4188f38426bd77be834735c1e97f537a2e0115cf /hardinfo2/callbacks.c
parente7ac08270d6d5e984a84ea60a44d8b9e4256ba4f (diff)
Cleanups
Generate report in plain text (no UI yet) Copy information to clipboard
Diffstat (limited to 'hardinfo2/callbacks.c')
-rw-r--r--hardinfo2/callbacks.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c
index 173d6fe7..1146bc50 100644
--- a/hardinfo2/callbacks.c
+++ b/hardinfo2/callbacks.c
@@ -32,6 +32,27 @@ void cb_refresh()
shell_do_reload();
}
+void cb_copy_to_clipboard()
+{
+ ShellModuleEntry *entry = shell_get_main_shell()->selected;
+ gchar *data = entry->func(entry->number);
+ GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE));
+ gchar *fmtdata = g_strdup("");
+ ReportContext *ctx = report_context_string_new(NULL, fmtdata);
+
+ ctx->entry = entry;
+
+ report_header(ctx);
+ report_table(ctx, data);
+ report_footer(ctx);
+
+ gtk_clipboard_set_text(clip, ctx->stream, -1);
+
+ g_free((gchar*) ctx->stream);
+ g_free(ctx);
+ g_free(data);
+}
+
void cb_side_pane()
{
gboolean visible;