From 2fa751f6d98995e73db4d0edd0d22b9560281644 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 1 Jun 2011 17:57:31 +0200 Subject: wizard: hook selection checkboxes to reporters. Checkboxes are controlled by the following elements in .xml: ITEM1,ITEM2 ITEM1,ITEM2 ITEM1,ITEM2 yes / no ITEM1,ITEM2 exclude-items-by-default and exclude-items-always can be "*" meaning "all". include-items-by-default specifies which items are included (checked) is exclude-items-by-default is "*". Else, all are checked by default. the set of iters NOT included is passed in $EXCLUDE_FROM_REPORT variable. bugzilla, kerneloops, mailx, print and rhtsupport are made aware of this variable. Signed-off-by: Denys Vlasenko --- src/include/report/event_config.h | 13 +++++++++---- src/include/report/problem_data.h | 9 ++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/include') diff --git a/src/include/report/event_config.h b/src/include/report/event_config.h index 2e2783de..8ab9477d 100644 --- a/src/include/report/event_config.h +++ b/src/include/report/event_config.h @@ -66,12 +66,17 @@ void free_event_option(event_option_t *p); //structure to hold the option data typedef struct { - char *screen_name; //ui friendly name of the event: "Bugzilla" "RedHat Support Upload" - //char *title; //window title - not used right now, maybe the "name" is enough? - //char *action; //action description to show in gui like: Upload report to the Red Hat bugzilla" + char *screen_name; //ui friendly name of the event: "Bugzilla" "RedHat Support Upload" char *description; // "Report to..."/"Save to file". Should be one sentence, not long char *long_descr; // Long(er) explanation, if needed - char *creates_elements; + + char *ec_creates_items; + char *ec_requires_items; + char *ec_exclude_items_by_default; + char *ec_include_items_by_default; + char *ec_exclude_items_always; + bool ec_exclude_binary_items; + GList *options; } event_config_t; diff --git a/src/include/report/problem_data.h b/src/include/report/problem_data.h index f7178077..31ef7d25 100644 --- a/src/include/report/problem_data.h +++ b/src/include/report/problem_data.h @@ -40,6 +40,11 @@ enum { struct problem_item { char *content; unsigned flags; + /* Used by UI for presenting "item allowed/not allowed" checkboxes: */ + int selected_by_user; /* 0 "don't know", -1 "no", 1 "yes" */ + int allowed_by_reporter; /* 0 "no", 1 "yes" */ + int default_by_reporter; /* 0 "no", 1 "yes" */ + int required_by_reporter; /* 0 "no", 1 "yes" */ }; typedef struct problem_item problem_item; @@ -80,8 +85,10 @@ const char *get_problem_item_content_or_die(problem_data_t *problem_data, const /* Conversions between in-memory and on-disk formats */ -void load_problem_data_from_dump_dir(problem_data_t *problem_data, struct dump_dir *dd); +void load_problem_data_from_dump_dir(problem_data_t *problem_data, struct dump_dir *dd, char **excluding); problem_data_t *create_problem_data_from_dump_dir(struct dump_dir *dd); +/* Helper for typical operation in reporters: */ +problem_data_t *create_problem_data_for_reporting(const char *dump_dir_name); struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name); -- cgit