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

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