aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2021-11-26 23:00:17 +0100
committerPřemysl Eric Janouch <p@janouch.name>2021-11-26 23:02:00 +0100
commitb97ac26cfb97377a2416f854fb07b12441d39c0b (patch)
tree85f81d6c477f61d1dedfba770093db38577d0868
parentbae65a61f70436d711badd7326de768aef80e6e9 (diff)
downloadfiv-b97ac26cfb97377a2416f854fb07b12441d39c0b.tar.gz
fiv-b97ac26cfb97377a2416f854fb07b12441d39c0b.tar.xz
fiv-b97ac26cfb97377a2416f854fb07b12441d39c0b.zip
Allow opening in a new window from the sidebar
-rw-r--r--fastiv-sidebar.c13
-rw-r--r--fastiv.c2
2 files changed, 9 insertions, 6 deletions
diff --git a/fastiv-sidebar.c b/fastiv-sidebar.c
index 3f1eaed..ecfec3e 100644
--- a/fastiv-sidebar.c
+++ b/fastiv-sidebar.c
@@ -64,7 +64,8 @@ fastiv_sidebar_class_init(FastivSidebarClass *klass)
// TODO(p): Consider a return value, and using it.
sidebar_signals[OPEN_LOCATION] =
g_signal_new("open_location", G_TYPE_FROM_CLASS(klass), 0, 0,
- NULL, NULL, NULL, G_TYPE_NONE, 1, G_TYPE_FILE);
+ NULL, NULL, NULL, G_TYPE_NONE,
+ 2, G_TYPE_FILE, GTK_TYPE_PLACES_OPEN_FLAGS);
}
static gboolean
@@ -194,15 +195,16 @@ on_open_breadcrumb(
FastivSidebar *self = FASTIV_SIDEBAR(user_data);
GFile *location =
g_object_get_qdata(G_OBJECT(row), fastiv_sidebar_location_quark());
- g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0, location);
+ g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0,
+ location, GTK_PLACES_OPEN_NORMAL);
}
static void
on_open_location(G_GNUC_UNUSED GtkPlacesSidebar *sidebar, GFile *location,
- G_GNUC_UNUSED GtkPlacesOpenFlags flags, gpointer user_data)
+ GtkPlacesOpenFlags flags, gpointer user_data)
{
FastivSidebar *self = FASTIV_SIDEBAR(user_data);
- g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0, location);
+ g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0, location, flags);
// Deselect the item in GtkPlacesSidebar, if unsuccessful.
update_location(self, NULL);
@@ -339,7 +341,8 @@ on_show_enter_location(G_GNUC_UNUSED GtkPlacesSidebar *sidebar,
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
const char *text = gtk_entry_get_text(GTK_ENTRY(entry));
GFile *location = resolve_location(self, text);
- g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0, location);
+ g_signal_emit(self, sidebar_signals[OPEN_LOCATION], 0,
+ location, GTK_PLACES_OPEN_NORMAL);
g_object_unref(location);
}
gtk_widget_destroy(dialog);
diff --git a/fastiv.c b/fastiv.c
index 98dd0cb..18a3277 100644
--- a/fastiv.c
+++ b/fastiv.c
@@ -346,7 +346,7 @@ open_any_path(const char *path, gboolean force_browser)
static void
on_open_location(G_GNUC_UNUSED GtkPlacesSidebar *sidebar, GFile *location,
- G_GNUC_UNUSED GtkPlacesOpenFlags flags, G_GNUC_UNUSED gpointer user_data)
+ GtkPlacesOpenFlags flags, G_GNUC_UNUSED gpointer user_data)
{
gchar *path = g_file_get_path(location);
if (path) {