Permalink
Browse files

shell/report: allow "moreinfo" details to appear in reports

Fixes #223

The first item to use it will be Devices/Processors/Package Info.

Signed-off-by: Burt P <pburt0@gmail.com>
  • Loading branch information...
bp0 authored and lpereira committed Oct 22, 2018
1 parent 2c9c295 commit 9eaf1a7a96aabc021594bcc6f5fe2ef60da8fb0c
Showing with 268 additions and 104 deletions.
  1. +8 −1 includes/report.h
  2. +13 −6 includes/shell.h
  3. +184 −76 shell/report.c
  4. +63 −21 shell/shell.c
@@ -49,13 +49,19 @@ struct _ReportContext {
void (*subsubtitle) (ReportContext *ctx, gchar *text);
void (*keyvalue) (ReportContext *ctx, gchar *key, gchar *value, gboolean highlight);
void (*details_start) (ReportContext *ctx, gchar *key, gchar *value, gboolean highlight);
void (*details_section) (ReportContext *ctx, gchar *name);
void (*details_keyvalue) (ReportContext *ctx, gchar *key, gchar *value, gboolean highlight);
void (*details_end) (ReportContext *ctx);
ReportFormat format;
gboolean is_image_enabled;
gboolean first_table;
gboolean in_details;
gboolean show_column_headers;
guint columns;
guint columns, parent_columns;
GHashTable *column_titles;
};
@@ -83,6 +89,7 @@ void report_subtitle (ReportContext *ctx, gchar *text);
void report_subsubtitle (ReportContext *ctx, gchar *text);
void report_key_value (ReportContext *ctx, gchar *key, gchar *value, gboolean highlight);
void report_table (ReportContext *ctx, gchar *text);
void report_details (ReportContext *ctx, gchar *key, gchar *value, gboolean highlight, gchar *details);
void report_create_from_module_list(ReportContext *ctx, GSList *modules);
gchar *report_create_from_module_list_format(GSList *modules, ReportFormat format);
@@ -97,10 +97,10 @@ struct _Shell {
ShellViewType view_type;
gboolean normalize_percentage;
gint _pulses;
ShellOrderType _order_type;
GKeyFile *hosts;
HelpViewer *help_viewer;
};
@@ -109,7 +109,7 @@ struct _ShellSummary {
GtkWidget *header;
GtkWidget *scroll;
GtkWidget *view;
GSList *items;
};
@@ -127,7 +127,7 @@ struct _ShellInfoTree {
GtkWidget *view;
GtkTreeModel *model;
GtkTreeSelection *selection;
GtkTreeViewColumn *col_progress, *col_value, *col_extra1, *col_extra2, *col_textvalue;
};
@@ -144,7 +144,7 @@ struct _ShellModule {
gpointer (*aboutfunc) ();
gchar *(*summaryfunc) ();
void (*deinit) ();
guchar weight;
GSList *entries;
@@ -162,7 +162,7 @@ struct _ShellModuleEntry {
gboolean selected;
gint number;
guint32 flags;
gchar *(*func) ();
void (*scan_func) ();
@@ -220,6 +220,13 @@ void shell_update_remote_menu(void);
void shell_set_remote_label(Shell *shell, gchar *label);
/* decode special information in keys */
gboolean key_is_flagged(gchar *key); /* has $[<flags>][<tag>]$ at the start of the key */
gboolean key_is_highlighted(gchar *key); /* flag '*' = select/highlight */
gboolean key_wants_details(gchar *key); /* flag '!' = report should include the "moreinfo" */
gchar *key_mi_tag(gchar *key); /* moreinfo lookup tag */
const gchar *key_get_name(gchar *key); /* get the key's name, flagged or not */
#endif /* __SHELL_H__ */
Oops, something went wrong.

0 comments on commit 9eaf1a7

Please sign in to comment.