diff options
author | Leandro A. F. Pereira <leandro@hardinfo.org> | 2006-10-25 13:38:32 +0000 |
---|---|---|
committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2006-10-25 13:38:32 +0000 |
commit | fd6337f2c940aa3aae42eb9952b32ca12f8b757d (patch) | |
tree | a50a07b2919f34ba48baec9378124533d8f92bb3 /hardinfo2/callbacks.c | |
parent | 7b773f5c8225479e0748db69b9ac7f92b127890c (diff) |
Fix report output format option.
Diffstat (limited to 'hardinfo2/callbacks.c')
-rw-r--r-- | hardinfo2/callbacks.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/hardinfo2/callbacks.c b/hardinfo2/callbacks.c index c56088f4..957f9cc0 100644 --- a/hardinfo2/callbacks.c +++ b/hardinfo2/callbacks.c @@ -35,20 +35,23 @@ void cb_refresh() 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)); - ReportContext *ctx = report_context_text_new(NULL); - - ctx->entry = entry; - - report_header(ctx); - report_table(ctx, data); - report_footer(ctx); - gtk_clipboard_set_text(clip, ctx->output, -1); - - g_free(data); - report_context_free(ctx); + if (entry) { + gchar *data = entry->func(entry->number); + GtkClipboard *clip = gtk_clipboard_get(gdk_atom_intern("CLIPBOARD", FALSE)); + ReportContext *ctx = report_context_text_new(NULL); + + ctx->entry = entry; + + report_header(ctx); + report_table(ctx, data); + report_footer(ctx); + + gtk_clipboard_set_text(clip, ctx->output, -1); + + g_free(data); + report_context_free(ctx); + } } void cb_side_pane() @@ -124,8 +127,13 @@ void cb_about() void cb_generate_report() { Shell *shell = shell_get_main_shell(); + gboolean btn_refresh = shell_action_get_enabled("RefreshAction"); + gboolean btn_copy = shell_action_get_enabled("CopyAction"); report_dialog_show(shell->tree->model, shell->window); + + shell_action_set_enabled("RefreshAction", btn_refresh); + shell_action_set_enabled("CopyAction", btn_copy); } void cb_quit(void) |