Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/plugins/reporter-rhtsupport.c | 38 ++++++++++++++++++++++++++++++++------
1 file changed, 32 insertions(+), 6 deletions(-)
diff --git a/src/plugins/reporter-rhtsupport.c b/src/plugins/reporter-rhtsupport.c
index fe13423..c5e3c95 100644
--- a/src/plugins/reporter-rhtsupport.c
+++ b/src/plugins/reporter-rhtsupport.c
@@ -265,21 +265,47 @@ int main(int argc, char **argv)
{
if (!case_no)
{
- /* -t: extract URL where we previously reported it */
+ /* -t: ask for it */
report_result_t *reported_to = get_reported_to(dump_dir_name);
if (!reported_to || !reported_to->url)
- error_msg_and_die("Can't attach: problem data in '%s'
"
- "was not reported to RHTSupport and therefore has no
URL",
- dump_dir_name);
- //log("URL:'%s'", reported_to->url);
- //log("MSG:'%s'", reported_to->msg);
+ {
+ case_no = ask(_("Case number:"));
+ if (!case_no)
+ perror_msg_and_die("ask");
+ strtrim((char*)case_no);
+ if (case_no[0])
+ goto got_case_no;
+ /* User just pressed [enter] (or [cancel] in GIU). */
+ error_msg_and_die(_("Reporting cancelled"));
+ }
+ /* We have a preexisting URL */
+ log(_("Note: was already reported to '%s'"),
reported_to->url);
+#if 1
+ case_no = ask(_("Case number:"));
+#else
+ case_no = ask(_("Case number (default:previously reported
case):"));
+#endif
+ if (!case_no)
+ perror_msg_and_die("ask");
+ strtrim((char*)case_no);
+ if (case_no[0])
+ goto got_case_no;
+ /* User just pressed [enter]. Use previous URL */
+#if 1
+ error_msg_and_die(_("Reporting cancelled"));
+#else
+//GUI BUG: would like to use this, but in GUI, [cancel] in ask dialog
+//also results in ""!
+//Enabling this will make [cancel] in GUI to NOT cancel!
free(url);
url = reported_to->url;
reported_to->url = NULL;
free_report_result(reported_to);
+#endif
}
else
{
+ got_case_no:;
/* -tCASE */
char *url1 = concat_path_file(url, "cases");
free(url);
--
1.8.1.4
Show replies by date
This makes abrt-cli and wizard's event lists look more similar.
Signed-off-by: Denys Vlasenko <dvlasenk(a)redhat.com>
---
src/gui-wizard-gtk/wizard.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
index 1db97b2..f701817 100644
--- a/src/gui-wizard-gtk/wizard.c
+++ b/src/gui-wizard-gtk/wizard.c
@@ -1005,7 +1005,7 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
if (missing)
{
red_choice = true;
- event_description = tmp_description = xasprintf(_("(requires:
%s)"), missing);
+ tmp_description = xasprintf(_("(requires: %s)"), missing);
free(missing);
}
else
@@ -1019,7 +1019,7 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
else
{
green_choice = true;
- event_description = tmp_description = xasprintf(_("(not
needed, data already exist: %s)"), cfg->ec_creates_items);
+ tmp_description = xasprintf(_("(not needed, data already
exist: %s)"), cfg->ec_creates_items);
}
}
}
@@ -1029,9 +1029,9 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
//VERB2 log("adding button '%s' to box %p", event_name, box);
char *event_label = xasprintf("%s%s%s",
- event_screen_name,
- (event_description ? " - " : ""),
- event_description ? event_description : ""
+ event_description ? event_description : event_screen_name,
+ tmp_description ? " - " : "",
+ tmp_description ? tmp_description : ""
);
free(tmp_description);
--
1.8.1.4