[epiphany/gnome-3-26] flatpak: Make the downloads popover work



commit 60e4a6f9e27fa356658831a989ac54c90112daef
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Sun Nov 19 14:01:07 2017 -0600

    flatpak: Make the downloads popover work
    
    There's no way to open nautilus now, let alone browse to the file, so
    give up on that. We'll fall back to Allan's original design when running
    inside flatpak: nothing happens when clicking on a row, unless you click
    the open button. Open button opens the file.
    
    My inclination is to change this to be the normal behavior outside of
    flatpak too, but Carlos Garcia likes the browse to file functionality,
    so let's be conservative for now and change it only when running under
    flatpak.

 lib/widgets/ephy-download-widget.c   |    7 ++++---
 lib/widgets/ephy-downloads-popover.c |   11 +++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c
index 3631273..4c23839 100644
--- a/lib/widgets/ephy-download-widget.c
+++ b/lib/widgets/ephy-download-widget.c
@@ -22,9 +22,10 @@
 #include "ephy-download-widget.h"
 
 #include "ephy-debug.h"
-#include "ephy-uri-helpers.h"
-#include "ephy-embed-shell.h"
 #include "ephy-downloads-manager.h"
+#include "ephy-embed-shell.h"
+#include "ephy-flatpak-utils.h"
+#include "ephy-uri-helpers.h"
 
 #include <glib/gi18n.h>
 #include <webkit2/webkit2.h>
@@ -274,7 +275,7 @@ widget_action_button_clicked_cb (EphyDownloadWidget *widget)
     ephy_downloads_manager_remove_download (manager, widget->download);
   } else {
     ephy_download_do_download_action (widget->download,
-                                      EPHY_DOWNLOAD_ACTION_BROWSE_TO,
+                                      ephy_is_running_inside_flatpak () ? EPHY_DOWNLOAD_ACTION_OPEN : 
EPHY_DOWNLOAD_ACTION_BROWSE_TO,
                                       gtk_get_current_event_time ());
   }
 }
diff --git a/lib/widgets/ephy-downloads-popover.c b/lib/widgets/ephy-downloads-popover.c
index 29ca1c9..f5d90ae 100644
--- a/lib/widgets/ephy-downloads-popover.c
+++ b/lib/widgets/ephy-downloads-popover.c
@@ -24,6 +24,7 @@
 #include "ephy-downloads-manager.h"
 #include "ephy-download-widget.h"
 #include "ephy-embed-shell.h"
+#include "ephy-flatpak-utils.h"
 
 #include <glib/gi18n.h>
 
@@ -178,10 +179,12 @@ ephy_downloads_popover_init (EphyDownloadsPopover *popover)
                                               DOWNLOADS_BOX_MIN_SIZE);
 
   popover->downloads_box = gtk_list_box_new ();
-  g_signal_connect_swapped (popover->downloads_box, "row-activated",
-                            G_CALLBACK (download_box_row_activated_cb),
-                            popover);
-  gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (popover->downloads_box), TRUE);
+  if (!ephy_is_running_inside_flatpak ()) {
+    g_signal_connect_swapped (popover->downloads_box, "row-activated",
+                              G_CALLBACK (download_box_row_activated_cb),
+                              popover);
+    gtk_list_box_set_activate_on_single_click (GTK_LIST_BOX (popover->downloads_box), TRUE);
+  }
   gtk_list_box_set_selection_mode (GTK_LIST_BOX (popover->downloads_box), GTK_SELECTION_NONE);
   gtk_style_context_add_class (gtk_widget_get_style_context (popover->downloads_box),
                                "background");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]