Blame SOURCES/0193-report-gtk-Require-Reproducer-for-RHTSupport.patch

28bab8
From df9da3bc28d316032f56c6b8d538575e4f097bf5 Mon Sep 17 00:00:00 2001
28bab8
From: Matej Habrnal <mhabrnal@redhat.com>
28bab8
Date: Tue, 29 Mar 2016 11:06:24 +0200
28bab8
Subject: [PATCH] report-gtk: Require Reproducer for RHTSupport
28bab8
28bab8
- Introduce a new event configuration option to mark events that
28bab8
  needs good reproducer or comprehensive description. I decided
28bab8
  to go this way because there are events like uReport or e-mail
28bab8
  that can have Comment but do not need to be so strict.
28bab8
  (We can use the new option for Bugzilla in future).
28bab8
- Add problem description policies based on problem reproducibility
28bab8
  * unknow reproducer -> detailed description of circumstances
28bab8
  * known reproducer -> description of circumstances + steps
28bab8
  * recurrent problem -> steps
28bab8
28bab8
Related: #1258482
28bab8
28bab8
Signed-off-by: Matej Habrnal <mhabrnal@redhat.com>
28bab8
---
28bab8
 src/gui-wizard-gtk/wizard.c      | 198 +++++++++++++++++++++++++++++++++++++--
28bab8
 src/gui-wizard-gtk/wizard.glade  | 166 ++++++++++++++++++++++++++------
28bab8
 src/include/event_config.h       |   1 +
28bab8
 src/include/internal_libreport.h |   4 +
28bab8
 src/include/problem_data.h       |  11 +++
28bab8
 src/lib/event_xml_parser.c       |   5 +
28bab8
 src/lib/problem_data.c           |  35 +++++++
28bab8
 7 files changed, 383 insertions(+), 37 deletions(-)
28bab8
28bab8
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
28bab8
index 6a1bdc0..31861a1 100644
28bab8
--- a/src/gui-wizard-gtk/wizard.c
28bab8
+++ b/src/gui-wizard-gtk/wizard.c
28bab8
@@ -88,6 +88,13 @@ static GtkLabel *g_lbl_cd_reason;
28bab8
 static GtkTextView *g_tv_comment;
28bab8
 static GtkEventBox *g_eb_comment;
28bab8
 static GtkCheckButton *g_cb_no_comment;
28bab8
+static GtkBox *g_vb_simple_details;
28bab8
+
28bab8
+static GtkComboBoxText *g_cmb_reproducible;
28bab8
+static GtkTextView *g_tv_steps;
28bab8
+static GtkLabel *g_lbl_complex_details_hint;
28bab8
+static GtkBox *g_vb_complex_details;
28bab8
+
28bab8
 static GtkWidget *g_widget_warnings_area;
28bab8
 static GtkBox *g_box_warning_labels;
28bab8
 static GtkToggleButton *g_tb_approve_bt;
28bab8
@@ -1187,6 +1194,51 @@ static event_gui_data_t *add_event_buttons(GtkBox *box,
28bab8
     return active_button;
28bab8
 }
28bab8
 
28bab8
+static bool isdigit_str(const char *str)
28bab8
+{
28bab8
+    do
28bab8
+    {
28bab8
+        if (*str < '0' || *str > '9') return false;
28bab8
+        str++;
28bab8
+    } while (*str);
28bab8
+    return true;
28bab8
+}
28bab8
+
28bab8
+static void update_reproducible_hints(void)
28bab8
+{
28bab8
+    int reproducible = gtk_combo_box_get_active(GTK_COMBO_BOX(g_cmb_reproducible));
28bab8
+    switch(reproducible)
28bab8
+    {
28bab8
+        case -1:
28bab8
+            return;
28bab8
+
28bab8
+        case PROBLEM_REPRODUCIBLE_UNKNOWN:
28bab8
+            gtk_label_set_text(g_lbl_complex_details_hint,
28bab8
+                    _("Since crashes without a known reproducer can be "
28bab8
+                      "difficult to diagnose, please provide a comprehensive "
28bab8
+                      "description of the problem you have encountered."));
28bab8
+            break;
28bab8
+
28bab8
+        case PROBLEM_REPRODUCIBLE_YES:
28bab8
+            gtk_label_set_text(g_lbl_complex_details_hint,
28bab8
+                    _("Please provide a short description of the problem and "
28bab8
+                      "please include the steps you have used to reproduce "
28bab8
+                      "the problem."));
28bab8
+            break;
28bab8
+
28bab8
+        case PROBLEM_REPRODUCIBLE_RECURRENT:
28bab8
+            gtk_label_set_text(g_lbl_complex_details_hint,
28bab8
+                    _("Please provide the steps you have used to reproduce the "
28bab8
+                      "problem."));
28bab8
+            break;
28bab8
+
28bab8
+        default:
28bab8
+            error_msg("BUG: %s:%s:%d: forgotten 'how reproducible' value",
28bab8
+                        __FILE__, __func__, __LINE__);
28bab8
+            break;
28bab8
+    }
28bab8
+}
28bab8
+
28bab8
 struct cd_stats {
28bab8
     off_t filesize;
28bab8
     unsigned filecount;
28bab8
@@ -1425,6 +1477,7 @@ void update_gui_state_from_problem_data(int flags)
28bab8
     free(msg);
28bab8
 
28bab8
     load_text_to_text_view(g_tv_comment, FILENAME_COMMENT);
28bab8
+    load_text_to_text_view(g_tv_steps, FILENAME_REPRODUCER);
28bab8
 
28bab8
     add_workflow_buttons(g_box_workflows, g_workflow_list,
28bab8
                         G_CALLBACK(set_auto_event_chain));
28bab8
@@ -1460,6 +1513,38 @@ void update_gui_state_from_problem_data(int flags)
28bab8
      * We created new widgets (buttons). Need to make them visible.
28bab8
      */
28bab8
     gtk_widget_show_all(GTK_WIDGET(g_wnd_assistant));
28bab8
+
28bab8
+    /* Update Reproducible */
28bab8
+    /* Try to get the old value */
28bab8
+    const int reproducible = get_problem_data_reproducible(g_cd);
28bab8
+    if (reproducible > -1)
28bab8
+    {
28bab8
+        gtk_combo_box_set_active(GTK_COMBO_BOX(g_cmb_reproducible), reproducible);
28bab8
+        goto reproducible_done;
28bab8
+    }
28bab8
+
28bab8
+    /* OK, no old value.
28bab8
+     * Try to guess the reproducibility from the number of occurrences */
28bab8
+    const char *count_str = problem_data_get_content_or_NULL(g_cd, FILENAME_COUNT);
28bab8
+    if (   count_str == NULL
28bab8
+        || strcmp(count_str, "0") == 0
28bab8
+        || strcmp(count_str, "1") == 0
28bab8
+        || strcmp(count_str, "2") == 0
28bab8
+        || !isdigit_str(count_str))
28bab8
+    {
28bab8
+        gtk_combo_box_set_active(GTK_COMBO_BOX(g_cmb_reproducible), PROBLEM_REPRODUCIBLE_UNKNOWN);
28bab8
+    }
28bab8
+    else
28bab8
+    {
28bab8
+        int count = xatoi(count_str);
28bab8
+        if (count < 5)
28bab8
+           gtk_combo_box_set_active(GTK_COMBO_BOX(g_cmb_reproducible), PROBLEM_REPRODUCIBLE_YES);
28bab8
+        else
28bab8
+            gtk_combo_box_set_active(GTK_COMBO_BOX(g_cmb_reproducible), PROBLEM_REPRODUCIBLE_RECURRENT);
28bab8
+    }
28bab8
+
28bab8
+reproducible_done:
28bab8
+    update_reproducible_hints();
28bab8
 }
28bab8
 
28bab8
 
28bab8
@@ -1886,6 +1971,12 @@ _("If you want to update the configuration and try to report again, please open
28bab8
     show_warnings();
28bab8
 }
28bab8
 
28bab8
+static bool event_requires_details(const char *event_name)
28bab8
+{
28bab8
+    event_config_t *cfg = get_event_config(event_name);
28bab8
+    return cfg != NULL && cfg->ec_requires_details;
28bab8
+}
28bab8
+
28bab8
 static gboolean consume_cmd_output(GIOChannel *source, GIOCondition condition, gpointer data)
28bab8
 {
28bab8
     struct analyze_event_data *evd = data;
28bab8
@@ -2274,18 +2365,53 @@ static void toggle_eb_comment(void)
28bab8
     if (pages[PAGENO_EDIT_COMMENT].page_widget == NULL)
28bab8
         return;
28bab8
 
28bab8
-    bool good =
28bab8
-        gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10
28bab8
-        || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_cb_no_comment));
28bab8
+    bool complex_details = g_event_selected
28bab8
+                           && event_requires_details(g_event_selected);
28bab8
+    bool good = false;
28bab8
+    if (complex_details)
28bab8
+    {
28bab8
+        int reproducible = gtk_combo_box_get_active(GTK_COMBO_BOX(g_cmb_reproducible));
28bab8
+        const int comment_chars = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment));
28bab8
+        const int steps_chars = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_steps));
28bab8
+        const int steps_lines = steps_chars == 0 ? 0 : gtk_text_buffer_get_line_count(gtk_text_view_get_buffer(g_tv_steps));
28bab8
+        switch(reproducible)
28bab8
+        {
28bab8
+            case -1:
28bab8
+                VERB1 log("Uninitialized 'How reproducible' combobox");
28bab8
+                break;
28bab8
 
28bab8
-    /* Allow next page only when the comment has at least 10 chars */
28bab8
-    gtk_widget_set_sensitive(g_btn_next, good);
28bab8
+            case PROBLEM_REPRODUCIBLE_UNKNOWN:
28bab8
+                good = comment_chars + (steps_chars * 2) >= 20;
28bab8
+                break;
28bab8
+
28bab8
+            case PROBLEM_REPRODUCIBLE_YES:
28bab8
+                good = comment_chars >= 10 && steps_lines;
28bab8
+                break;
28bab8
 
28bab8
-    /* And show the eventbox with label */
28bab8
-    if (good)
28bab8
-        gtk_widget_hide(GTK_WIDGET(g_eb_comment));
28bab8
+            case PROBLEM_REPRODUCIBLE_RECURRENT:
28bab8
+                good = comment_chars >= 10 || steps_lines;
28bab8
+                break;
28bab8
+
28bab8
+            default:
28bab8
+                error_msg("BUG: %s:%s:%d: forgotten 'how reproducible' value",
28bab8
+                            __FILE__, __func__, __LINE__);
28bab8
+                break;
28bab8
+        }
28bab8
+    }
28bab8
     else
28bab8
-        gtk_widget_show(GTK_WIDGET(g_eb_comment));
28bab8
+    {
28bab8
+        good = gtk_text_buffer_get_char_count(gtk_text_view_get_buffer(g_tv_comment)) >= 10
28bab8
+               || gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(g_cb_no_comment));
28bab8
+
28bab8
+        /* And show the eventbox with label */
28bab8
+        if (good)
28bab8
+            gtk_widget_hide(GTK_WIDGET(g_eb_comment));
28bab8
+        else
28bab8
+            gtk_widget_show(GTK_WIDGET(g_eb_comment));
28bab8
+    }
28bab8
+
28bab8
+    /* Allow next page only when the comment has at least 10 chars */
28bab8
+    gtk_widget_set_sensitive(g_btn_next, good);
28bab8
 }
28bab8
 
28bab8
 static void on_comment_changed(GtkTextBuffer *buffer, gpointer user_data)
28bab8
@@ -2298,6 +2424,11 @@ static void on_no_comment_toggled(GtkToggleButton *togglebutton, gpointer user_d
28bab8
     toggle_eb_comment();
28bab8
 }
28bab8
 
28bab8
+static void on_steps_changed(GtkTextBuffer *buffer, gpointer user_data)
28bab8
+{
28bab8
+    toggle_eb_comment();
28bab8
+}
28bab8
+
28bab8
 static void on_log_changed(GtkTextBuffer *buffer, gpointer user_data)
28bab8
 {
28bab8
     gtk_widget_show(GTK_WIDGET(g_exp_report_log));
28bab8
@@ -2723,6 +2854,23 @@ static void on_page_prepare(GtkNotebook *assistant, GtkWidget *page, gpointer us
28bab8
      * these tabs will be lost */
28bab8
     save_items_from_notepad();
28bab8
     save_text_from_text_view(g_tv_comment, FILENAME_COMMENT);
28bab8
+    save_text_from_text_view(g_tv_steps, FILENAME_REPRODUCER);
28bab8
+
28bab8
+    int reproducible = gtk_combo_box_get_active(GTK_COMBO_BOX(g_cmb_reproducible));
28bab8
+    if (reproducible > -1)
28bab8
+    {
28bab8
+        const char *reproducible_str = get_problem_data_reproducible_name(reproducible);
28bab8
+        if (reproducible_str != NULL)
28bab8
+        {
28bab8
+            struct dump_dir *dd = wizard_open_directory_for_writing(g_dump_dir_name);
28bab8
+            if (dd)
28bab8
+                dd_save_text(dd, FILENAME_REPRODUCIBLE, reproducible_str);
28bab8
+            else
28bab8
+                error_msg(_("Failed to save file '%s'"), FILENAME_REPRODUCIBLE);
28bab8
+
28bab8
+            dd_close(dd);
28bab8
+        }
28bab8
+    }
28bab8
     problem_data_reload_from_dump_dir();
28bab8
     update_gui_state_from_problem_data(/* don't update selected event */ 0);
28bab8
 
28bab8
@@ -2782,6 +2930,11 @@ static void on_page_prepare(GtkNotebook *assistant, GtkWidget *page, gpointer us
28bab8
 
28bab8
     if (pages[PAGENO_EDIT_COMMENT].page_widget == page)
28bab8
     {
28bab8
+        bool complex_details = g_event_selected
28bab8
+                               && event_requires_details(g_event_selected);
28bab8
+
28bab8
+        gtk_widget_set_visible(GTK_WIDGET(g_vb_simple_details), !complex_details);
28bab8
+        gtk_widget_set_visible(GTK_WIDGET(g_vb_complex_details), complex_details);
28bab8
         update_private_ticket_creation_warning_for_selected_event();
28bab8
 
28bab8
         gtk_widget_set_sensitive(g_btn_next, false);
28bab8
@@ -3024,7 +3177,9 @@ static gint select_next_page_no(gint current_page_no, gpointer data)
28bab8
             exit(0);
28bab8
         /* No! this would SEGV (infinitely recurse into select_next_page_no) */
28bab8
         /*gtk_assistant_commit(g_assistant);*/
28bab8
-        current_page_no = pages[PAGENO_EVENT_SELECTOR].page_no - 1;
28bab8
+        gtk_widget_set_sensitive(pages[PAGENO_EVENT_SELECTOR].page_widget,
28bab8
+                    /*Radio buttons used == always selected*/FALSE);
28bab8
+        current_page_no = pages[PAGENO_EVENT_SELECTOR].page_no-1;
28bab8
         goto again;
28bab8
     }
28bab8
 
28bab8
@@ -3297,6 +3452,12 @@ static gint on_key_press_event_in_item_list(GtkTreeView *treeview, GdkEventKey *
28bab8
     return FALSE;
28bab8
 }
28bab8
 
28bab8
+static void on_reproducible_changed(GtkComboBox *widget, gpointer user_data)
28bab8
+{
28bab8
+    update_reproducible_hints();
28bab8
+    toggle_eb_comment();
28bab8
+}
28bab8
+
28bab8
 /* Initialization */
28bab8
 
28bab8
 static void on_next_btn_cb(GtkWidget *btn, gpointer user_data)
28bab8
@@ -3353,6 +3514,11 @@ static void add_pages(void)
28bab8
     g_img_process_fail     = GTK_IMAGE(      gtk_builder_get_object(g_builder, "img_process_fail"));
28bab8
     g_btn_startcast        = GTK_BUTTON(    gtk_builder_get_object(g_builder, "btn_startcast"));
28bab8
     g_exp_report_log       = GTK_EXPANDER(     gtk_builder_get_object(g_builder, "expand_report"));
28bab8
+    g_vb_simple_details    = GTK_BOX(          gtk_builder_get_object(g_builder, "vb_simple_details"));
28bab8
+    g_cmb_reproducible     = GTK_COMBO_BOX_TEXT(gtk_builder_get_object(g_builder, "cmb_reproducible"));
28bab8
+    g_tv_steps             = GTK_TEXT_VIEW(    gtk_builder_get_object(g_builder, "tv_steps"));
28bab8
+    g_vb_complex_details   = GTK_BOX(          gtk_builder_get_object(g_builder, "vb_complex_details"));
28bab8
+    g_lbl_complex_details_hint = GTK_LABEL(    gtk_builder_get_object(g_builder, "lbl_complex_details_hint"));
28bab8
 
28bab8
     gtk_widget_set_no_show_all(GTK_WIDGET(g_spinner_event_log), true);
28bab8
 
28bab8
@@ -3371,6 +3537,17 @@ static void add_pages(void)
28bab8
 
28bab8
     g_signal_connect(g_tv_details, "key-press-event", G_CALLBACK(on_key_press_event_in_item_list), NULL);
28bab8
     g_tv_sensitive_sel_hndlr = g_signal_connect(g_tv_sensitive_sel, "changed", G_CALLBACK(on_sensitive_word_selection_changed), NULL);
28bab8
+
28bab8
+    gtk_combo_box_text_insert(g_cmb_reproducible, PROBLEM_REPRODUCIBLE_UNKNOWN, NULL,
28bab8
+                            _("I have experienced this problem for the first time"));
28bab8
+
28bab8
+    gtk_combo_box_text_insert(g_cmb_reproducible, PROBLEM_REPRODUCIBLE_YES, NULL,
28bab8
+                            _("I can reproduce this problem"));
28bab8
+
28bab8
+    gtk_combo_box_text_insert(g_cmb_reproducible, PROBLEM_REPRODUCIBLE_RECURRENT, NULL,
28bab8
+                            _("This problem occurs repeatedly"));
28bab8
+
28bab8
+    g_signal_connect(g_cmb_reproducible, "changed", G_CALLBACK(on_reproducible_changed), NULL);
28bab8
 }
28bab8
 
28bab8
 static void create_details_treeview(void)
28bab8
@@ -3649,6 +3826,7 @@ void create_assistant(GtkApplication *app, bool expert_mode)
28bab8
 
28bab8
     g_signal_connect(g_tb_approve_bt, "toggled", G_CALLBACK(on_bt_approve_toggle), NULL);
28bab8
     g_signal_connect(gtk_text_view_get_buffer(g_tv_comment), "changed", G_CALLBACK(on_comment_changed), NULL);
28bab8
+    g_signal_connect(gtk_text_view_get_buffer(g_tv_steps),   "changed", G_CALLBACK(on_steps_changed),   NULL);
28bab8
 
28bab8
     g_signal_connect(g_btn_add_file, "clicked", G_CALLBACK(on_btn_add_file), NULL);
28bab8
 
28bab8
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
28bab8
index 441b2fc..1c45bd9 100644
28bab8
--- a/src/gui-wizard-gtk/wizard.glade
28bab8
+++ b/src/gui-wizard-gtk/wizard.glade
28bab8
@@ -111,6 +111,7 @@
28bab8
             <property name="yalign">0</property>
28bab8
             <property name="label" translatable="yes">How did this problem happen (step-by-step)? How can it be reproduced? Any additional comments useful for diagnosing the problem? Please use English if possible.</property>
28bab8
             <property name="wrap">True</property>
28bab8
+            <property name="xalign">0</property>
28bab8
           </object>
28bab8
           <packing>
28bab8
             <property name="expand">False</property>
28bab8
@@ -122,12 +123,13 @@
28bab8
           <object class="GtkScrolledWindow" id="scrolledwindow4">
28bab8
             <property name="visible">True</property>
28bab8
             <property name="can_focus">True</property>
28bab8
+            <property name="hexpand">True</property>
28bab8
+            <property name="vexpand">True</property>
28bab8
             <property name="shadow_type">out</property>
28bab8
             <child>
28bab8
               <object class="GtkTextView" id="tv_comment">
28bab8
                 <property name="visible">True</property>
28bab8
                 <property name="can_focus">True</property>
28bab8
-                <property name="wrap_mode">word</property>
28bab8
               </object>
28bab8
             </child>
28bab8
           </object>
28bab8
@@ -138,15 +140,92 @@
28bab8
           </packing>
28bab8
         </child>
28bab8
         <child>
28bab8
-          <object class="GtkEventBox" id="eb_comment">
28bab8
+          <object class="GtkBox" id="vb_complex_details">
28bab8
+            <property name="visible">True</property>
28bab8
             <property name="can_focus">False</property>
28bab8
+            <property name="no_show_all">True</property>
28bab8
+            <property name="orientation">vertical</property>
28bab8
+            <child>
28bab8
+              <object class="GtkLabel" id="lbl_reproducible">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">False</property>
28bab8
+                <property name="label" translatable="yes">How reproducible is this problem?</property>
28bab8
+                <property name="angle">0.02</property>
28bab8
+                <property name="xalign">0</property>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">0</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
             <child>
28bab8
-              <object class="GtkLabel" id="label5">
28bab8
+              <object class="GtkComboBoxText" id="cmb_reproducible">
28bab8
                 <property name="visible">True</property>
28bab8
                 <property name="can_focus">False</property>
28bab8
-                <property name="label" translatable="yes">You need to fill the how to before you can proceed...</property>
28bab8
-                <property name="single_line_mode">True</property>
28bab8
               </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">1</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
+            <child>
28bab8
+              <object class="GtkLabel" id="lbl_steps">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">False</property>
28bab8
+                <property name="label" translatable="yes">How it can be reproduced (one step per line)?</property>
28bab8
+                <property name="xalign">0</property>
28bab8
+                <property name="margin_top">5</property>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">2</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
+            <child>
28bab8
+              <object class="GtkScrolledWindow" id="sw_steps">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">True</property>
28bab8
+                <property name="hexpand">True</property>
28bab8
+                <property name="vexpand">True</property>
28bab8
+                <property name="shadow_type">out</property>
28bab8
+                <child>
28bab8
+                  <object class="GtkTextView" id="tv_steps">
28bab8
+                    <property name="visible">True</property>
28bab8
+                    <property name="can_focus">True</property>
28bab8
+                  </object>
28bab8
+                </child>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">True</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">3</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
+            <child>
28bab8
+              <object class="GtkEventBox" id="eb_complex_details">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">False</property>
28bab8
+            <child>
28bab8
+                  <object class="GtkLabel" id="lbl_complex_details_hint">
28bab8
+                    <property name="visible">True</property>
28bab8
+                    <property name="can_focus">False</property>
28bab8
+                    <property name="label" translatable="yes">Please add a comprehensive description of the problem you have. This is a very long place holder.</property>
28bab8
+                    <property name="wrap">True</property>
28bab8
+                    <property name="xalign">0</property>
28bab8
+                    <attributes>
28bab8
+                      <attribute name="weight" value="bold"/>
28bab8
+                    </attributes>
28bab8
+                  </object>
28bab8
+                </child>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">True</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">4</property>
28bab8
+              </packing>
28bab8
             </child>
28bab8
           </object>
28bab8
           <packing>
28bab8
@@ -156,19 +235,67 @@
28bab8
           </packing>
28bab8
         </child>
28bab8
         <child>
28bab8
-          <object class="GtkLabel" id="label3">
28bab8
+          <object class="GtkBox" id="vb_simple_details">
28bab8
             <property name="visible">True</property>
28bab8
             <property name="can_focus">False</property>
28bab8
-            <property name="xalign">0</property>
28bab8
-            <property name="yalign">0</property>
28bab8
-            <property name="label" translatable="yes"><b>Your comments are not private.</b> They may be included into publicly visible problem reports.</property>
28bab8
-            <property name="use_markup">True</property>
28bab8
-            <property name="wrap">True</property>
28bab8
+            <property name="no_show_all">True</property>
28bab8
+            <property name="orientation">vertical</property>
28bab8
+            <child>
28bab8
+              <object class="GtkEventBox" id="eb_comment">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">False</property>
28bab8
+                <child>
28bab8
+                  <object class="GtkLabel" id="label5">
28bab8
+                    <property name="visible">True</property>
28bab8
+                    <property name="can_focus">False</property>
28bab8
+                    <property name="label" translatable="yes">You need to fill the how to before you can proceed...</property>
28bab8
+                    <property name="single_line_mode">True</property>
28bab8
+                  </object>
28bab8
+                </child>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">0</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
+            <child>
28bab8
+              <object class="GtkLabel" id="label3">
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">False</property>
28bab8
+                <property name="halign">start</property>
28bab8
+                <property name="valign">start</property>
28bab8
+                <property name="label" translatable="yes"><b>Your comments are not private.</b> They may be included into publicly visible problem reports.</property>
28bab8
+                <property name="use_markup">True</property>
28bab8
+                <property name="wrap">True</property>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">1</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
+            <child>
28bab8
+              <object class="GtkCheckButton" id="cb_no_comment">
28bab8
+                <property name="label" translatable="yes">I don't know what caused this problem</property>
28bab8
+                <property name="visible">True</property>
28bab8
+                <property name="can_focus">True</property>
28bab8
+                <property name="receives_default">False</property>
28bab8
+                <property name="halign">start</property>
28bab8
+                <property name="xalign">0</property>
28bab8
+                <property name="draw_indicator">True</property>
28bab8
+              </object>
28bab8
+              <packing>
28bab8
+                <property name="expand">False</property>
28bab8
+                <property name="fill">True</property>
28bab8
+                <property name="position">2</property>
28bab8
+              </packing>
28bab8
+            </child>
28bab8
           </object>
28bab8
           <packing>
28bab8
             <property name="expand">False</property>
28bab8
             <property name="fill">True</property>
28bab8
-            <property name="position">3</property>
28bab8
+            <property name="position">4</property>
28bab8
           </packing>
28bab8
         </child>
28bab8
         <child>
28bab8
@@ -208,21 +335,6 @@
28bab8
           <packing>
28bab8
             <property name="expand">False</property>
28bab8
             <property name="fill">True</property>
28bab8
-            <property name="position">4</property>
28bab8
-          </packing>
28bab8
-        </child>
28bab8
-        <child>
28bab8
-          <object class="GtkCheckButton" id="cb_no_comment">
28bab8
-            <property name="label" translatable="yes">I don't know what caused this problem</property>
28bab8
-            <property name="visible">True</property>
28bab8
-            <property name="can_focus">True</property>
28bab8
-            <property name="receives_default">False</property>
28bab8
-            <property name="xalign">0</property>
28bab8
-            <property name="draw_indicator">True</property>
28bab8
-          </object>
28bab8
-          <packing>
28bab8
-            <property name="expand">False</property>
28bab8
-            <property name="fill">True</property>
28bab8
             <property name="position">5</property>
28bab8
           </packing>
28bab8
         </child>
28bab8
diff --git a/src/include/event_config.h b/src/include/event_config.h
28bab8
index 7d137c1..fdcb3b4 100644
28bab8
--- a/src/include/event_config.h
28bab8
+++ b/src/include/event_config.h
28bab8
@@ -82,6 +82,7 @@ typedef struct
28bab8
     bool  ec_sending_sensitive_data;
28bab8
     bool  ec_supports_restricted_access;
28bab8
     char *ec_restricted_access_option;
28bab8
+    bool  ec_requires_details;
28bab8
 
28bab8
     GList *ec_imported_event_names;
28bab8
     GList *options;
28bab8
diff --git a/src/include/internal_libreport.h b/src/include/internal_libreport.h
28bab8
index 651e339..c5f899c 100644
28bab8
--- a/src/include/internal_libreport.h
28bab8
+++ b/src/include/internal_libreport.h
28bab8
@@ -952,6 +952,10 @@ struct dump_dir *open_directory_for_writing(
28bab8
 #define FILENAME_ABRT_VERSION  "abrt_version"
28bab8
 #define FILENAME_EXPLOITABLE   "exploitable"
28bab8
 
28bab8
+/* reproducible element is used by functions from problem_data.h */
28bab8
+#define FILENAME_REPRODUCIBLE  "reproducible"
28bab8
+#define FILENAME_REPRODUCER    "reproducer"
28bab8
+
28bab8
 // Not stored as files, added "on the fly":
28bab8
 #define CD_DUMPDIR            "Directory"
28bab8
 
28bab8
diff --git a/src/include/problem_data.h b/src/include/problem_data.h
28bab8
index 0fc8b78..d75a986 100644
28bab8
--- a/src/include/problem_data.h
28bab8
+++ b/src/include/problem_data.h
28bab8
@@ -142,6 +142,17 @@ problem_data_t *create_problem_data_for_reporting(const char *dump_dir_name);
28bab8
 struct dump_dir *create_dump_dir_from_problem_data(problem_data_t *problem_data, const char *base_dir_name);
28bab8
 struct dump_dir *create_dump_dir_from_problem_data_ext(problem_data_t *problem_data, const char *base_dir_name, uid_t uid);
28bab8
 
28bab8
+enum {
28bab8
+    PROBLEM_REPRODUCIBLE_UNKNOWN,
28bab8
+    PROBLEM_REPRODUCIBLE_YES,
28bab8
+    PROBLEM_REPRODUCIBLE_RECURRENT,
28bab8
+
28bab8
+    _PROBLEM_REPRODUCIBLE_MAX_,
28bab8
+};
28bab8
+
28bab8
+int get_problem_data_reproducible(problem_data_t *problem_data);
28bab8
+const char *get_problem_data_reproducible_name(int reproducible);
28bab8
+
28bab8
 #ifdef __cplusplus
28bab8
 }
28bab8
 #endif
28bab8
diff --git a/src/lib/event_xml_parser.c b/src/lib/event_xml_parser.c
28bab8
index a5e3d3e..aec2ba4 100644
28bab8
--- a/src/lib/event_xml_parser.c
28bab8
+++ b/src/lib/event_xml_parser.c
28bab8
@@ -35,6 +35,7 @@
28bab8
 #define SENDING_SENSITIVE_DATA_ELEMENT  "sending-sensitive-data"
28bab8
 #define SUPPORTS_RESTRICTED_ACCESS_ELEMENT "support-restricted-access"
28bab8
 #define RESTRICTED_ACCESS_OPTION_ATTR "optionname"
28bab8
+#define REQUIRES_DETAILS        "requires-details"
28bab8
 
28bab8
 #define REQUIRES_ELEMENT        "requires-items"
28bab8
 #define EXCL_BY_DEFAULT_ELEMENT "exclude-items-by-default"
28bab8
@@ -509,6 +510,10 @@ static void text(GMarkupParseContext *context,
28bab8
         {
28bab8
             ui->ec_supports_restricted_access = string_to_bool(text_copy);
28bab8
         }
28bab8
+        else if (strcmp(inner_element, REQUIRES_DETAILS) == 0)
28bab8
+        {
28bab8
+            ui->ec_requires_details = string_to_bool(text_copy);
28bab8
+        }
28bab8
     }
28bab8
     free(text_copy);
28bab8
 }
28bab8
diff --git a/src/lib/problem_data.c b/src/lib/problem_data.c
28bab8
index 9e625bd..2f66fb3 100644
28bab8
--- a/src/lib/problem_data.c
28bab8
+++ b/src/lib/problem_data.c
28bab8
@@ -637,3 +637,38 @@ void problem_data_get_osinfo(problem_data_t *problem_data, map_string_t *osinfo)
28bab8
     problem_data_get_osinfo_from_items(problem_data, osinfo,
28bab8
                 FILENAME_OS_INFO, FILENAME_OS_RELEASE);
28bab8
 }
28bab8
+
28bab8
+static const gchar const* reproducible_names[_PROBLEM_REPRODUCIBLE_MAX_] =
28bab8
+{
28bab8
+    "Not sure how to reproduce the problem",
28bab8
+    "The problem is reproducible",
28bab8
+    "The problem occurs regularly",
28bab8
+};
28bab8
+
28bab8
+int get_problem_data_reproducible(problem_data_t *problem_data)
28bab8
+{
28bab8
+    const char *reproducible_str = problem_data_get_content_or_NULL(problem_data, FILENAME_REPRODUCIBLE);
28bab8
+    if (reproducible_str == NULL)
28bab8
+    {
28bab8
+        log_info("Cannot return Reproducible type: missing "FILENAME_REPRODUCIBLE);
28bab8
+        return -1;
28bab8
+    }
28bab8
+
28bab8
+    for (int i = 0; i < _PROBLEM_REPRODUCIBLE_MAX_; ++i)
28bab8
+        if (strcmp(reproducible_str, reproducible_names[i]) == 0)
28bab8
+            return i;
28bab8
+
28bab8
+    error_msg("Cannot return Reproducible type: invalid format of '%s'", FILENAME_REPRODUCIBLE);
28bab8
+    return -1;
28bab8
+}
28bab8
+
28bab8
+const char *get_problem_data_reproducible_name(int reproducible)
28bab8
+{
28bab8
+    if (reproducible < 0 || reproducible >= _PROBLEM_REPRODUCIBLE_MAX_)
28bab8
+    {
28bab8
+        error_msg("Cannot return Reproducible name: invalid code: %d", reproducible);
28bab8
+        return NULL;
28bab8
+    }
28bab8
+
28bab8
+    return reproducible_names[reproducible];
28bab8
+}
28bab8
-- 
28bab8
1.8.3.1
28bab8