Commit 60e4a6f9 authored by Michael Catanzaro's avatar Michael Catanzaro

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.
parent 3a7db444
......@@ -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 ());
}
}
......
......@@ -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");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment