Blame SOURCES/0002-Remove-option-to-screencast-problems.patch

91b162
From 602124e481d700e334de20418b94b2fdf015c834 Mon Sep 17 00:00:00 2001
91b162
From: Martin Kutlak <mkutlak@redhat.com>
91b162
Date: Mon, 9 Jul 2018 10:45:37 +0200
91b162
Subject: [PATCH] Remove option to screencast problems
91b162
91b162
The fros package is broken and hasn't been maintained for quite some time.
91b162
91b162
closes #104
91b162
91b162
Signed-off-by: Martin Kutlak <mkutlak@redhat.com>
91b162
---
91b162
 libreport.spec.in               |  1 -
91b162
 src/gui-wizard-gtk/wizard.c     | 75 ---------------------------------
91b162
 src/gui-wizard-gtk/wizard.glade | 40 ------------------
91b162
 3 files changed, 116 deletions(-)
91b162
91b162
diff --git a/src/gui-wizard-gtk/wizard.c b/src/gui-wizard-gtk/wizard.c
91b162
index b02bc7de..ea49a2ea 100644
91b162
--- a/src/gui-wizard-gtk/wizard.c
91b162
+++ b/src/gui-wizard-gtk/wizard.c
91b162
@@ -127,7 +127,6 @@ static gboolean g_warning_issued;
91b162
 static GtkSpinner *g_spinner_event_log;
91b162
 static GtkImage *g_img_process_fail;
91b162
 
91b162
-static GtkButton *g_btn_startcast;
91b162
 static GtkExpander *g_exp_report_log;
91b162
 
91b162
 static GtkWidget *g_top_most_window;
91b162
@@ -3487,7 +3486,6 @@ static void add_pages(void)
91b162
     g_exp_search           = GTK_EXPANDER(     gtk_builder_get_object(g_builder, "expander_search"));
91b162
     g_spinner_event_log    = GTK_SPINNER(      gtk_builder_get_object(g_builder, "spinner_event_log"));
91b162
     g_img_process_fail     = GTK_IMAGE(        gtk_builder_get_object(g_builder, "img_process_fail"));
91b162
-    g_btn_startcast        = GTK_BUTTON(       gtk_builder_get_object(g_builder, "btn_startcast"));
91b162
     g_exp_report_log       = GTK_EXPANDER(     gtk_builder_get_object(g_builder, "expand_report"));
91b162
     g_vb_simple_details    = GTK_BOX(          gtk_builder_get_object(g_builder, "vb_simple_details"));
91b162
     g_cmb_reproducible     = GTK_COMBO_BOX_TEXT(gtk_builder_get_object(g_builder, "cmb_reproducible"));
91b162
@@ -3618,59 +3616,6 @@ static void assistant_quit_cb(void *obj, void *data)
91b162
     g_wnd_assistant = (void *)0xdeadbeaf;
91b162
 }
91b162
 
91b162
-static void on_btn_startcast(GtkWidget *btn, gpointer user_data)
91b162
-{
91b162
-    const char *args[15];
91b162
-    args[0] = (char *) "fros";
91b162
-    args[1] = NULL;
91b162
-
91b162
-    pid_t castapp = 0;
91b162
-    castapp = fork_execv_on_steroids(
91b162
-                EXECFLG_QUIET,
91b162
-                (char **)args,
91b162
-                NULL,
91b162
-                /*env_vec:*/ NULL,
91b162
-                g_dump_dir_name,
91b162
-                /*uid (ignored):*/ 0
91b162
-    );
91b162
-    gtk_widget_hide(GTK_WIDGET(g_wnd_assistant));
91b162
-    /*flush all gui events before we start waitpid
91b162
-     * otherwise the main window wouldn't hide
91b162
-     */
91b162
-    while (gtk_events_pending())
91b162
-        gtk_main_iteration_do(false);
91b162
-
91b162
-    int status;
91b162
-    safe_waitpid(castapp, &status, 0);
91b162
-    problem_data_reload_from_dump_dir();
91b162
-    update_gui_state_from_problem_data(0 /* don't update the selected event */);
91b162
-    gtk_widget_show(GTK_WIDGET(g_wnd_assistant));
91b162
-}
91b162
-
91b162
-static bool is_screencast_available()
91b162
-{
91b162
-    const char *args[3];
91b162
-    args[0] = (char *) "fros";
91b162
-    args[1] = "--is-available";
91b162
-    args[2] = NULL;
91b162
-
91b162
-    pid_t castapp = 0;
91b162
-    castapp = fork_execv_on_steroids(
91b162
-                EXECFLG_QUIET,
91b162
-                (char **)args,
91b162
-                NULL,
91b162
-                /*env_vec:*/ NULL,
91b162
-                g_dump_dir_name,
91b162
-                /*uid (ignored):*/ 0
91b162
-    );
91b162
-
91b162
-    int status;
91b162
-    safe_waitpid(castapp, &status, 0);
91b162
-
91b162
-    /* 0 means that it's available */
91b162
-    return status == 0;
91b162
-}
91b162
-
91b162
 void create_assistant(GtkApplication *app, bool expert_mode)
91b162
 {
91b162
     g_loaded_texts = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
91b162
@@ -3805,26 +3750,6 @@ void create_assistant(GtkApplication *app, bool expert_mode)
91b162
     g_signal_connect(g_btn_add_file, "clicked", G_CALLBACK(on_btn_add_file), NULL);
91b162
     g_signal_connect(g_btn_detail, "clicked", G_CALLBACK(on_btn_detail), NULL);
91b162
 
91b162
-    if (is_screencast_available()) {
91b162
-        /* we need to override the activate-link handler, because we use
91b162
-         * the link button instead of normal button and if we wouldn't override it
91b162
-         * gtk would try to run it's defualt action and open the associated URI
91b162
-         * but since the URI is empty it would complain about it...
91b162
-         */
91b162
-        g_signal_connect(g_btn_startcast, "activate-link", G_CALLBACK(on_btn_startcast), NULL);
91b162
-    }
91b162
-    else {
91b162
-        gtk_widget_set_sensitive(GTK_WIDGET(g_btn_startcast), false);
91b162
-        gtk_widget_set_tooltip_markup(GTK_WIDGET(g_btn_startcast),
91b162
-          _("In order to enable the built-in screencasting "
91b162
-            "functionality the package fros-recordmydesktop has to be installed. "
91b162
-            "Please run the following command if you want to install it."
91b162
-            "\n\n"
91b162
-            "su -c \"dnf install fros-recordmydesktop\""
91b162
-            ));
91b162
-    }
91b162
-
91b162
-
91b162
     g_signal_connect(g_search_entry_bt, "changed", G_CALLBACK(search_timeout), NULL);
91b162
 
91b162
     g_signal_connect (g_tv_event_log, "key-press-event", G_CALLBACK (key_press_event), NULL);
91b162
diff --git a/src/gui-wizard-gtk/wizard.glade b/src/gui-wizard-gtk/wizard.glade
91b162
index 47713370..f0bd2a77 100644
91b162
--- a/src/gui-wizard-gtk/wizard.glade
91b162
+++ b/src/gui-wizard-gtk/wizard.glade
91b162
@@ -506,46 +506,6 @@
91b162
             <property name="position">4</property>
91b162
           </packing>
91b162
         </child>
91b162
-        <child>
91b162
-          <object class="GtkBox" id="box3">
91b162
-            <property name="visible">True</property>
91b162
-            <property name="can_focus">False</property>
91b162
-            <child>
91b162
-              <object class="GtkLabel" id="label9">
91b162
-                <property name="visible">True</property>
91b162
-                <property name="can_focus">False</property>
91b162
-                <property name="halign">end</property>
91b162
-                <property name="label" translatable="yes">If you don't know how to describe it, you can</property>
91b162
-              </object>
91b162
-              <packing>
91b162
-                <property name="expand">False</property>
91b162
-                <property name="fill">False</property>
91b162
-                <property name="position">0</property>
91b162
-              </packing>
91b162
-            </child>
91b162
-            <child>
91b162
-              <object class="GtkLinkButton" id="btn_startcast">
91b162
-                <property name="label" translatable="yes">add a screencast</property>
91b162
-                <property name="visible">True</property>
91b162
-                <property name="can_focus">True</property>
91b162
-                <property name="receives_default">True</property>
91b162
-                <property name="has_tooltip">True</property>
91b162
-                <property name="halign">start</property>
91b162
-                <property name="relief">none</property>
91b162
-              </object>
91b162
-              <packing>
91b162
-                <property name="expand">False</property>
91b162
-                <property name="fill">True</property>
91b162
-                <property name="position">1</property>
91b162
-              </packing>
91b162
-            </child>
91b162
-          </object>
91b162
-          <packing>
91b162
-            <property name="expand">False</property>
91b162
-            <property name="fill">True</property>
91b162
-            <property name="position">5</property>
91b162
-          </packing>
91b162
-        </child>
91b162
       </object>
91b162
     </child>
91b162
   </object>
91b162
-- 
91b162
2.17.1
91b162