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

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