mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-14 06:10:21 +00:00
Merge branch 'dialog-fixes' into 'main'
filechooserwidget: Fixes See merge request GNOME/gtk!5311
This commit is contained in:
commit
a07bf1a047
@ -29,6 +29,8 @@
|
|||||||
#include "gopenuriportal.h"
|
#include "gopenuriportal.h"
|
||||||
#include "xdp-dbus.h"
|
#include "xdp-dbus.h"
|
||||||
#include "gtkwindowprivate.h"
|
#include "gtkwindowprivate.h"
|
||||||
|
#include "gtkprivate.h"
|
||||||
|
#include "gtkdialogerror.h"
|
||||||
|
|
||||||
#ifdef G_OS_UNIX
|
#ifdef G_OS_UNIX
|
||||||
#include <gio/gunixfdlist.h>
|
#include <gio/gunixfdlist.h>
|
||||||
@ -56,12 +58,12 @@ init_openuri_portal (void)
|
|||||||
if (connection != NULL)
|
if (connection != NULL)
|
||||||
{
|
{
|
||||||
openuri = gxdp_open_uri_proxy_new_sync (connection, 0,
|
openuri = gxdp_open_uri_proxy_new_sync (connection, 0,
|
||||||
"org.freedesktop.portal.Desktop",
|
PORTAL_BUS_NAME,
|
||||||
"/org/freedesktop/portal/desktop",
|
PORTAL_OBJECT_PATH,
|
||||||
NULL, &error);
|
NULL, &error);
|
||||||
if (openuri == NULL)
|
if (openuri == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("Cannot create document portal proxy: %s", error->message);
|
g_warning ("Cannot create OpenURI portal proxy: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,7 +71,7 @@ init_openuri_portal (void)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_warning ("Cannot connect to session bus when initializing document portal: %s",
|
g_warning ("Cannot connect to session bus when initializing OpenURI portal: %s",
|
||||||
error->message);
|
error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
}
|
}
|
||||||
@ -80,12 +82,55 @@ init_openuri_portal (void)
|
|||||||
return openuri != NULL;
|
return openuri != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gboolean
|
||||||
|
g_openuri_portal_is_available (void)
|
||||||
|
{
|
||||||
|
return init_openuri_portal ();
|
||||||
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
XDG_DESKTOP_PORTAL_SUCCESS = 0,
|
XDG_DESKTOP_PORTAL_SUCCESS = 0,
|
||||||
XDG_DESKTOP_PORTAL_CANCELLED = 1,
|
XDG_DESKTOP_PORTAL_CANCELLED = 1,
|
||||||
XDG_DESKTOP_PORTAL_FAILED = 2
|
XDG_DESKTOP_PORTAL_FAILED = 2
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
OPEN_URI = 0,
|
||||||
|
OPEN_FILE = 1,
|
||||||
|
OPEN_FOLDER = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
GtkWindow *parent;
|
||||||
|
GFile *file;
|
||||||
|
gboolean open_folder;
|
||||||
|
GDBusConnection *connection;
|
||||||
|
GCancellable *cancellable;
|
||||||
|
GTask *task;
|
||||||
|
char *handle;
|
||||||
|
guint signal_id;
|
||||||
|
glong cancel_handler;
|
||||||
|
int call;
|
||||||
|
} OpenUriData;
|
||||||
|
|
||||||
|
static void
|
||||||
|
open_uri_data_free (OpenUriData *data)
|
||||||
|
{
|
||||||
|
if (data->signal_id)
|
||||||
|
g_dbus_connection_signal_unsubscribe (data->connection, data->signal_id);
|
||||||
|
g_clear_object (&data->connection);
|
||||||
|
if (data->cancel_handler)
|
||||||
|
g_signal_handler_disconnect (data->cancellable, data->cancel_handler);
|
||||||
|
if (data->parent)
|
||||||
|
gtk_window_unexport_handle (data->parent);
|
||||||
|
g_clear_object (&data->parent);
|
||||||
|
g_clear_object (&data->file);
|
||||||
|
g_clear_object (&data->cancellable);
|
||||||
|
g_clear_object (&data->task);
|
||||||
|
g_free (data->handle);
|
||||||
|
g_free (data);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
response_received (GDBusConnection *connection,
|
response_received (GDBusConnection *connection,
|
||||||
const char *sender_name,
|
const char *sender_name,
|
||||||
@ -97,10 +142,6 @@ response_received (GDBusConnection *connection,
|
|||||||
{
|
{
|
||||||
GTask *task = user_data;
|
GTask *task = user_data;
|
||||||
guint32 response;
|
guint32 response;
|
||||||
guint signal_id;
|
|
||||||
|
|
||||||
signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "signal-id"));
|
|
||||||
g_dbus_connection_signal_unsubscribe (connection, signal_id);
|
|
||||||
|
|
||||||
g_variant_get (parameters, "(u@a{sv})", &response, NULL);
|
g_variant_get (parameters, "(u@a{sv})", &response, NULL);
|
||||||
|
|
||||||
@ -110,11 +151,11 @@ response_received (GDBusConnection *connection,
|
|||||||
g_task_return_boolean (task, TRUE);
|
g_task_return_boolean (task, TRUE);
|
||||||
break;
|
break;
|
||||||
case XDG_DESKTOP_PORTAL_CANCELLED:
|
case XDG_DESKTOP_PORTAL_CANCELLED:
|
||||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_CANCELLED, "Launch cancelled");
|
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_CANCELLED, "The portal dialog was closed");
|
||||||
break;
|
break;
|
||||||
case XDG_DESKTOP_PORTAL_FAILED:
|
case XDG_DESKTOP_PORTAL_FAILED:
|
||||||
default:
|
default:
|
||||||
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED, "Launch failed");
|
g_task_return_new_error (task, GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED, "The application launch failed");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -127,105 +168,145 @@ open_call_done (GObject *source,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GXdpOpenURI *portal = GXDP_OPEN_URI (source);
|
GXdpOpenURI *portal = GXDP_OPEN_URI (source);
|
||||||
GDBusConnection *connection;
|
|
||||||
GTask *task = user_data;
|
GTask *task = user_data;
|
||||||
|
OpenUriData *data = g_task_get_task_data (task);
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
gboolean open_file;
|
|
||||||
gboolean res;
|
gboolean res;
|
||||||
char *path = NULL;
|
char *path = NULL;
|
||||||
const char *handle;
|
|
||||||
guint signal_id;
|
|
||||||
|
|
||||||
connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (portal));
|
switch (data->call)
|
||||||
open_file = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (task), "open-file"));
|
{
|
||||||
|
case OPEN_FILE:
|
||||||
if (open_file)
|
res = gxdp_open_uri_call_open_file_finish (portal, &path, NULL, result, &error);
|
||||||
res = gxdp_open_uri_call_open_file_finish (portal, &path, NULL, result, &error);
|
break;
|
||||||
else
|
case OPEN_FOLDER:
|
||||||
res = gxdp_open_uri_call_open_uri_finish (portal, &path, result, &error);
|
res = gxdp_open_uri_call_open_directory_finish (portal, &path, NULL, result, &error);
|
||||||
|
break;
|
||||||
|
case OPEN_URI:
|
||||||
|
res = gxdp_open_uri_call_open_uri_finish (portal, &path, result, &error);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
g_assert_not_reached ();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (!res)
|
if (!res)
|
||||||
{
|
{
|
||||||
|
g_free (path);
|
||||||
g_task_return_error (task, error);
|
g_task_return_error (task, error);
|
||||||
g_object_unref (task);
|
g_object_unref (task);
|
||||||
g_free (path);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
handle = (const char *)g_object_get_data (G_OBJECT (task), "handle");
|
if (g_strcmp0 (data->handle, path) != 0)
|
||||||
if (g_strcmp0 (handle, path) != 0)
|
|
||||||
{
|
{
|
||||||
signal_id = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (task), "signal-id"));
|
g_dbus_connection_signal_unsubscribe (data->connection, data->signal_id);
|
||||||
g_dbus_connection_signal_unsubscribe (connection, signal_id);
|
|
||||||
|
|
||||||
signal_id = g_dbus_connection_signal_subscribe (connection,
|
data->signal_id = g_dbus_connection_signal_subscribe (data->connection,
|
||||||
"org.freedesktop.portal.Desktop",
|
PORTAL_BUS_NAME,
|
||||||
"org.freedesktop.portal.Request",
|
PORTAL_REQUEST_INTERFACE,
|
||||||
"Response",
|
"Response",
|
||||||
path,
|
path,
|
||||||
NULL,
|
NULL,
|
||||||
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
|
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
|
||||||
response_received,
|
response_received,
|
||||||
task,
|
task,
|
||||||
NULL);
|
NULL);
|
||||||
g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id));
|
g_free (data->handle);
|
||||||
|
data->handle = g_strdup (path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_free (path);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
send_close (OpenUriData *data)
|
||||||
|
{
|
||||||
|
GDBusMessage *message;
|
||||||
|
GError *error = NULL;
|
||||||
|
|
||||||
|
message = g_dbus_message_new_method_call (PORTAL_BUS_NAME,
|
||||||
|
PORTAL_OBJECT_PATH,
|
||||||
|
PORTAL_REQUEST_INTERFACE,
|
||||||
|
"Close");
|
||||||
|
g_dbus_message_set_body (message, g_variant_new ("(o)", data->handle));
|
||||||
|
|
||||||
|
if (!g_dbus_connection_send_message (data->connection,
|
||||||
|
message,
|
||||||
|
G_DBUS_SEND_MESSAGE_FLAGS_NONE,
|
||||||
|
NULL, &error))
|
||||||
|
{
|
||||||
|
g_warning ("unable to send Close message: %s", error->message);
|
||||||
|
g_error_free (error);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_object_unref (message);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
canceled (GCancellable *cancellable,
|
||||||
|
GTask *task)
|
||||||
|
{
|
||||||
|
OpenUriData *data = g_task_get_task_data (task);
|
||||||
|
|
||||||
|
send_close (data);
|
||||||
|
|
||||||
|
g_task_return_new_error (task,
|
||||||
|
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
|
||||||
|
"The OpenURI portal call was cancelled programmatically");
|
||||||
|
g_object_unref (task);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_uri (GFile *file,
|
open_uri (GFile *file,
|
||||||
|
gboolean open_folder,
|
||||||
const char *parent_window,
|
const char *parent_window,
|
||||||
GCancellable *cancellable,
|
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
|
OpenUriData *data = user_data;
|
||||||
GTask *task;
|
GTask *task;
|
||||||
GVariant *opts = NULL;
|
GVariant *opts = NULL;
|
||||||
int i;
|
int i;
|
||||||
guint signal_id;
|
GDBusConnection *connection;
|
||||||
|
GVariantBuilder opt_builder;
|
||||||
|
char *token;
|
||||||
|
char *sender;
|
||||||
|
|
||||||
if (callback)
|
connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (openuri));
|
||||||
{
|
data->connection = g_object_ref (connection);
|
||||||
GDBusConnection *connection;
|
|
||||||
GVariantBuilder opt_builder;
|
|
||||||
char *token;
|
|
||||||
char *sender;
|
|
||||||
char *handle;
|
|
||||||
|
|
||||||
connection = g_dbus_proxy_get_connection (G_DBUS_PROXY (openuri));
|
task = g_task_new (NULL, NULL, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
|
g_task_set_task_data (task, user_data, NULL);
|
||||||
|
if (data->cancellable)
|
||||||
|
data->cancel_handler = g_signal_connect (data->cancellable, "cancelled", G_CALLBACK (canceled), task);
|
||||||
|
|
||||||
task = g_task_new (NULL, cancellable, callback, user_data);
|
token = g_strdup_printf ("gtk%d", g_random_int_range (0, G_MAXINT));
|
||||||
|
sender = g_strdup (g_dbus_connection_get_unique_name (connection) + 1);
|
||||||
|
for (i = 0; sender[i]; i++)
|
||||||
|
if (sender[i] == '.')
|
||||||
|
sender[i] = '_';
|
||||||
|
|
||||||
token = g_strdup_printf ("gtk%d", g_random_int_range (0, G_MAXINT));
|
data->handle = g_strdup_printf ("/org/freedesktop/portal/desktop/request/%s/%s", sender, token);
|
||||||
sender = g_strdup (g_dbus_connection_get_unique_name (connection) + 1);
|
g_free (sender);
|
||||||
for (i = 0; sender[i]; i++)
|
|
||||||
if (sender[i] == '.')
|
|
||||||
sender[i] = '_';
|
|
||||||
|
|
||||||
handle = g_strdup_printf ("/org/freedesktop/portal/desktop/request/%s/%s", sender, token);
|
data->signal_id = g_dbus_connection_signal_subscribe (connection,
|
||||||
g_object_set_data_full (G_OBJECT (task), "handle", handle, g_free);
|
PORTAL_BUS_NAME,
|
||||||
g_free (sender);
|
PORTAL_REQUEST_INTERFACE,
|
||||||
|
"Response",
|
||||||
|
data->handle,
|
||||||
|
NULL,
|
||||||
|
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
|
||||||
|
response_received,
|
||||||
|
task,
|
||||||
|
NULL);
|
||||||
|
|
||||||
signal_id = g_dbus_connection_signal_subscribe (connection,
|
g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
||||||
"org.freedesktop.portal.Desktop",
|
g_variant_builder_add (&opt_builder, "{sv}", "handle_token", g_variant_new_string (token));
|
||||||
"org.freedesktop.portal.Request",
|
g_free (token);
|
||||||
"Response",
|
|
||||||
handle,
|
|
||||||
NULL,
|
|
||||||
G_DBUS_SIGNAL_FLAGS_NO_MATCH_RULE,
|
|
||||||
response_received,
|
|
||||||
task,
|
|
||||||
NULL);
|
|
||||||
g_object_set_data (G_OBJECT (task), "signal-id", GINT_TO_POINTER (signal_id));
|
|
||||||
|
|
||||||
g_variant_builder_init (&opt_builder, G_VARIANT_TYPE_VARDICT);
|
opts = g_variant_builder_end (&opt_builder);
|
||||||
g_variant_builder_add (&opt_builder, "{sv}", "handle_token", g_variant_new_string (token));
|
|
||||||
g_free (token);
|
|
||||||
|
|
||||||
opts = g_variant_builder_end (&opt_builder);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
task = NULL;
|
|
||||||
|
|
||||||
if (g_file_is_native (file))
|
if (g_file_is_native (file))
|
||||||
{
|
{
|
||||||
@ -233,17 +314,15 @@ open_uri (GFile *file,
|
|||||||
GUnixFDList *fd_list = NULL;
|
GUnixFDList *fd_list = NULL;
|
||||||
int fd, fd_id, errsv;
|
int fd, fd_id, errsv;
|
||||||
|
|
||||||
if (task)
|
|
||||||
g_object_set_data (G_OBJECT (task), "open-file", GINT_TO_POINTER (TRUE));
|
|
||||||
|
|
||||||
path = g_file_peek_path (file);
|
path = g_file_peek_path (file);
|
||||||
fd = g_open (path, O_RDONLY | O_CLOEXEC);
|
fd = g_open (path, O_RDONLY | O_CLOEXEC);
|
||||||
errsv = errno;
|
errsv = errno;
|
||||||
if (fd == -1)
|
if (fd == -1)
|
||||||
{
|
{
|
||||||
g_task_report_new_error (NULL, callback, user_data, NULL,
|
g_task_return_new_error (task,
|
||||||
G_IO_ERROR, g_io_error_from_errno (errsv),
|
G_IO_ERROR, g_io_error_from_errno (errsv),
|
||||||
"OpenURI portal is not available");
|
"Failed to open file");
|
||||||
|
g_object_unref (task);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -254,49 +333,49 @@ open_uri (GFile *file,
|
|||||||
fd = -1;
|
fd = -1;
|
||||||
fd_id = 0;
|
fd_id = 0;
|
||||||
|
|
||||||
gxdp_open_uri_call_open_file (openuri,
|
if (open_folder)
|
||||||
parent_window ? parent_window : "",
|
{
|
||||||
g_variant_new ("h", fd_id),
|
data->call = OPEN_FOLDER;
|
||||||
opts,
|
gxdp_open_uri_call_open_directory (openuri,
|
||||||
fd_list,
|
parent_window ? parent_window : "",
|
||||||
cancellable,
|
g_variant_new ("h", fd_id),
|
||||||
task ? open_call_done : NULL,
|
opts,
|
||||||
task);
|
fd_list,
|
||||||
|
NULL,
|
||||||
|
open_call_done,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
data->call = OPEN_FILE;
|
||||||
|
gxdp_open_uri_call_open_file (openuri,
|
||||||
|
parent_window ? parent_window : "",
|
||||||
|
g_variant_new ("h", fd_id),
|
||||||
|
opts,
|
||||||
|
fd_list,
|
||||||
|
NULL,
|
||||||
|
open_call_done,
|
||||||
|
task);
|
||||||
|
}
|
||||||
|
|
||||||
g_object_unref (fd_list);
|
g_object_unref (fd_list);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *uri = g_file_get_uri (file);
|
char *uri = g_file_get_uri (file);
|
||||||
|
|
||||||
|
data->call = OPEN_URI;
|
||||||
gxdp_open_uri_call_open_uri (openuri,
|
gxdp_open_uri_call_open_uri (openuri,
|
||||||
parent_window ? parent_window : "",
|
parent_window ? parent_window : "",
|
||||||
uri,
|
uri,
|
||||||
opts,
|
opts,
|
||||||
cancellable,
|
NULL,
|
||||||
task ? open_call_done : NULL,
|
open_call_done,
|
||||||
task);
|
task);
|
||||||
|
|
||||||
g_free (uri);
|
g_free (uri);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
GtkWindow *parent;
|
|
||||||
GFile *file;
|
|
||||||
GTask *task;
|
|
||||||
} OpenUriData;
|
|
||||||
|
|
||||||
static void
|
|
||||||
open_uri_data_free (OpenUriData *data)
|
|
||||||
{
|
|
||||||
if (data->parent)
|
|
||||||
gtk_window_unexport_handle (data->parent);
|
|
||||||
g_clear_object (&data->parent);
|
|
||||||
g_clear_object (&data->file);
|
|
||||||
g_clear_object (&data->task);
|
|
||||||
g_free (data);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
open_uri_done (GObject *source,
|
open_uri_done (GObject *source,
|
||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
@ -306,7 +385,17 @@ open_uri_done (GObject *source,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!g_task_propagate_boolean (G_TASK (result), &error))
|
if (!g_task_propagate_boolean (G_TASK (result), &error))
|
||||||
g_task_return_error (data->task, error);
|
{
|
||||||
|
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
|
||||||
|
{
|
||||||
|
g_error_free (error);
|
||||||
|
g_task_return_new_error (data->task,
|
||||||
|
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_ABORTED,
|
||||||
|
"The operation was aborted programmatically");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
g_task_return_error (data->task, error);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
g_task_return_boolean (data->task, TRUE);
|
g_task_return_boolean (data->task, TRUE);
|
||||||
|
|
||||||
@ -320,11 +409,12 @@ window_handle_exported (GtkWindow *window,
|
|||||||
{
|
{
|
||||||
OpenUriData *data = user_data;
|
OpenUriData *data = user_data;
|
||||||
|
|
||||||
open_uri (data->file, handle, g_task_get_cancellable (data->task), open_uri_done, data);
|
open_uri (data->file, data->open_folder, handle, open_uri_done, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
g_openuri_portal_open_async (GFile *file,
|
g_openuri_portal_open_async (GFile *file,
|
||||||
|
gboolean open_folder,
|
||||||
GtkWindow *parent,
|
GtkWindow *parent,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
@ -335,15 +425,18 @@ g_openuri_portal_open_async (GFile *file,
|
|||||||
if (!init_openuri_portal ())
|
if (!init_openuri_portal ())
|
||||||
{
|
{
|
||||||
g_task_report_new_error (NULL, callback, user_data, NULL,
|
g_task_report_new_error (NULL, callback, user_data, NULL,
|
||||||
G_IO_ERROR, G_IO_ERROR_NOT_INITIALIZED,
|
GTK_DIALOG_ERROR, GTK_DIALOG_ERROR_FAILED,
|
||||||
"OpenURI portal is not available");
|
"The OpenURI portal is not available");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
data = g_new0 (OpenUriData, 1);
|
data = g_new0 (OpenUriData, 1);
|
||||||
data->parent = parent ? g_object_ref (parent) : NULL;
|
data->parent = parent ? g_object_ref (parent) : NULL;
|
||||||
data->file = g_object_ref (file);
|
data->file = g_object_ref (file);
|
||||||
|
data->open_folder = open_folder;
|
||||||
|
data->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
|
||||||
data->task = g_task_new (parent, cancellable, callback, user_data);
|
data->task = g_task_new (parent, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (data->task, FALSE);
|
||||||
g_task_set_source_tag (data->task, g_openuri_portal_open_async);
|
g_task_set_source_tag (data->task, g_openuri_portal_open_async);
|
||||||
|
|
||||||
if (!parent || !gtk_window_export_handle (parent, window_handle_exported, data))
|
if (!parent || !gtk_window_export_handle (parent, window_handle_exported, data))
|
||||||
|
@ -26,14 +26,17 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
void g_openuri_portal_open_async (GFile *file,
|
gboolean g_openuri_portal_is_available (void);
|
||||||
GtkWindow *window,
|
|
||||||
GCancellable *cancellable,
|
|
||||||
GAsyncReadyCallback callback,
|
|
||||||
gpointer user_data);
|
|
||||||
|
|
||||||
gboolean g_openuri_portal_open_finish (GAsyncResult *result,
|
void g_openuri_portal_open_async (GFile *file,
|
||||||
GError **error);
|
gboolean open_folder,
|
||||||
|
GtkWindow *window,
|
||||||
|
GCancellable *cancellable,
|
||||||
|
GAsyncReadyCallback callback,
|
||||||
|
gpointer user_data);
|
||||||
|
|
||||||
|
gboolean g_openuri_portal_open_finish (GAsyncResult *result,
|
||||||
|
GError **error);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
@ -458,6 +458,7 @@ gtk_color_dialog_choose_rgba (GtkColorDialog *self,
|
|||||||
window = create_color_chooser (self, parent, initial_color);
|
window = create_color_chooser (self, parent, initial_color);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_color_dialog_choose_rgba);
|
g_task_set_source_tag (task, gtk_color_dialog_choose_rgba);
|
||||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||||
|
|
||||||
@ -472,7 +473,7 @@ gtk_color_dialog_choose_rgba (GtkColorDialog *self,
|
|||||||
* gtk_color_dialog_choose_rgba_finish:
|
* gtk_color_dialog_choose_rgba_finish:
|
||||||
* @self: a `GtkColorDialog`
|
* @self: a `GtkColorDialog`
|
||||||
* @result: a `GAsyncResult`
|
* @result: a `GAsyncResult`
|
||||||
* @error: return location for an error
|
* @error: return location for a [enum@Gtk.DialogError] error
|
||||||
*
|
*
|
||||||
* Finishes the [method@Gtk.ColorDialog.choose_rgba] call and
|
* Finishes the [method@Gtk.ColorDialog.choose_rgba] call and
|
||||||
* returns the resulting color.
|
* returns the resulting color.
|
||||||
|
@ -338,8 +338,9 @@ drag_prepare (GtkDragSource *source,
|
|||||||
static void
|
static void
|
||||||
update_button_sensitivity (GtkColorDialogButton *self)
|
update_button_sensitivity (GtkColorDialogButton *self)
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive (self->button,
|
if (self->button)
|
||||||
self->dialog != NULL && self->cancellable == NULL);
|
gtk_widget_set_sensitive (self->button,
|
||||||
|
self->dialog != NULL && self->cancellable == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -347,10 +348,11 @@ color_chosen (GObject *source,
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
GtkColorDialog *dialog = GTK_COLOR_DIALOG (source);
|
||||||
GtkColorDialogButton *self = data;
|
GtkColorDialogButton *self = data;
|
||||||
GdkRGBA *color;
|
GdkRGBA *color;
|
||||||
|
|
||||||
color = gtk_color_dialog_choose_rgba_finish (self->dialog, result, NULL);
|
color = gtk_color_dialog_choose_rgba_finish (dialog, result, NULL);
|
||||||
if (color)
|
if (color)
|
||||||
{
|
{
|
||||||
gtk_color_dialog_button_set_rgba (self, color);
|
gtk_color_dialog_button_set_rgba (self, color);
|
||||||
|
@ -1385,12 +1385,12 @@ open_folder_cb (GSimpleAction *action,
|
|||||||
|
|
||||||
if (gdk_should_use_portal ())
|
if (gdk_should_use_portal ())
|
||||||
{
|
{
|
||||||
g_openuri_portal_open_async (file, toplevel, NULL, NULL, NULL);
|
g_openuri_portal_open_async (file, TRUE, toplevel, NULL, NULL, NULL);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
GDBusConnection *bus;
|
GDBusConnection *bus;
|
||||||
GVariantBuilder *uris_builder;
|
GVariantBuilder uris_builder;
|
||||||
GVariant *result;
|
GVariant *result;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
@ -1398,20 +1398,20 @@ open_folder_cb (GSimpleAction *action,
|
|||||||
|
|
||||||
bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
bus = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);
|
||||||
|
|
||||||
uris_builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
|
g_variant_builder_init (&uris_builder, G_VARIANT_TYPE ("as"));
|
||||||
g_variant_builder_add (uris_builder, "s", uri);
|
g_variant_builder_add (&uris_builder, "s", uri);
|
||||||
|
|
||||||
result = g_dbus_connection_call_sync (bus,
|
result = g_dbus_connection_call_sync (bus,
|
||||||
FILE_MANAGER_DBUS_NAME,
|
FILE_MANAGER_DBUS_NAME,
|
||||||
FILE_MANAGER_DBUS_PATH,
|
FILE_MANAGER_DBUS_PATH,
|
||||||
FILE_MANAGER_DBUS_IFACE,
|
FILE_MANAGER_DBUS_IFACE,
|
||||||
"ShowFolders",
|
"ShowFolders",
|
||||||
g_variant_new ("(ass)", uris_builder, ""),
|
g_variant_new ("(ass)", &uris_builder, ""),
|
||||||
NULL, /* ignore returned type */
|
NULL, /* ignore returned type */
|
||||||
G_DBUS_CALL_FLAGS_NONE,
|
G_DBUS_CALL_FLAGS_NONE,
|
||||||
-1,
|
-1,
|
||||||
NULL,
|
NULL,
|
||||||
&error);
|
&error);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER) ||
|
if (g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_NAME_HAS_NO_OWNER) ||
|
||||||
|
@ -778,6 +778,7 @@ gtk_file_dialog_open (GtkFileDialog *self,
|
|||||||
current_file, NULL, FALSE);
|
current_file, NULL, FALSE);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_file_dialog_open);
|
g_task_set_source_tag (task, gtk_file_dialog_open);
|
||||||
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
||||||
|
|
||||||
@ -854,6 +855,7 @@ gtk_file_dialog_select_folder (GtkFileDialog *self,
|
|||||||
current_folder, NULL, FALSE);
|
current_folder, NULL, FALSE);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_file_dialog_select_folder);
|
g_task_set_source_tag (task, gtk_file_dialog_select_folder);
|
||||||
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
||||||
|
|
||||||
@ -935,6 +937,7 @@ gtk_file_dialog_save (GtkFileDialog *self,
|
|||||||
current_file, current_name, FALSE);
|
current_file, current_name, FALSE);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_file_dialog_save);
|
g_task_set_source_tag (task, gtk_file_dialog_save);
|
||||||
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
||||||
|
|
||||||
@ -1008,6 +1011,7 @@ gtk_file_dialog_open_multiple (GtkFileDialog *self,
|
|||||||
NULL, NULL, TRUE);
|
NULL, NULL, TRUE);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_file_dialog_open_multiple);
|
g_task_set_source_tag (task, gtk_file_dialog_open_multiple);
|
||||||
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
||||||
|
|
||||||
@ -1082,6 +1086,7 @@ gtk_file_dialog_select_multiple_folders (GtkFileDialog *self,
|
|||||||
NULL, NULL, TRUE);
|
NULL, NULL, TRUE);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_file_dialog_select_multiple_folders);
|
g_task_set_source_tag (task, gtk_file_dialog_select_multiple_folders);
|
||||||
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
g_task_set_task_data (task, chooser, (GDestroyNotify) gtk_native_dialog_destroy);
|
||||||
|
|
||||||
|
@ -596,6 +596,7 @@ create_font_chooser (GtkFontDialog *self,
|
|||||||
|
|
||||||
window = gtk_font_chooser_dialog_new (title, parent);
|
window = gtk_font_chooser_dialog_new (title, parent);
|
||||||
gtk_font_chooser_set_level (GTK_FONT_CHOOSER (window), level);
|
gtk_font_chooser_set_level (GTK_FONT_CHOOSER (window), level);
|
||||||
|
gtk_window_set_modal (GTK_WINDOW (window), TRUE);
|
||||||
if (self->language)
|
if (self->language)
|
||||||
gtk_font_chooser_set_language (GTK_FONT_CHOOSER (window),
|
gtk_font_chooser_set_language (GTK_FONT_CHOOSER (window),
|
||||||
pango_language_to_string (self->language));
|
pango_language_to_string (self->language));
|
||||||
@ -657,6 +658,7 @@ gtk_font_dialog_choose_family (GtkFontDialog *self,
|
|||||||
g_clear_pointer (&desc, pango_font_description_free);
|
g_clear_pointer (&desc, pango_font_description_free);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_font_dialog_choose_family);
|
g_task_set_source_tag (task, gtk_font_dialog_choose_family);
|
||||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||||
|
|
||||||
@ -672,7 +674,7 @@ gtk_font_dialog_choose_family (GtkFontDialog *self,
|
|||||||
* gtk_font_dialog_choose_family_finish:
|
* gtk_font_dialog_choose_family_finish:
|
||||||
* @self: a `GtkFontDialog`
|
* @self: a `GtkFontDialog`
|
||||||
* @result: a `GAsyncResult`
|
* @result: a `GAsyncResult`
|
||||||
* @error: return location for an error
|
* @error: return location for a [enum@Gtk.DialogError] error
|
||||||
*
|
*
|
||||||
* Finishes the [method@Gtk.FontDialog.choose_family] call
|
* Finishes the [method@Gtk.FontDialog.choose_family] call
|
||||||
* and returns the resulting family.
|
* and returns the resulting family.
|
||||||
@ -740,6 +742,7 @@ gtk_font_dialog_choose_face (GtkFontDialog *self,
|
|||||||
g_clear_pointer (&desc, pango_font_description_free);
|
g_clear_pointer (&desc, pango_font_description_free);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_font_dialog_choose_face);
|
g_task_set_source_tag (task, gtk_font_dialog_choose_face);
|
||||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||||
|
|
||||||
@ -755,7 +758,7 @@ gtk_font_dialog_choose_face (GtkFontDialog *self,
|
|||||||
* gtk_font_dialog_choose_face_finish:
|
* gtk_font_dialog_choose_face_finish:
|
||||||
* @self: a `GtkFontDialog`
|
* @self: a `GtkFontDialog`
|
||||||
* @result: a `GAsyncResult`
|
* @result: a `GAsyncResult`
|
||||||
* @error: return location for an error
|
* @error: return location for a [enum@Gtk.DialogError] error
|
||||||
*
|
*
|
||||||
* Finishes the [method@Gtk.FontDialog.choose_face] call
|
* Finishes the [method@Gtk.FontDialog.choose_face] call
|
||||||
* and returns the resulting font face.
|
* and returns the resulting font face.
|
||||||
@ -773,7 +776,7 @@ gtk_font_dialog_choose_face_finish (GtkFontDialog *self,
|
|||||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_face, NULL);
|
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_face, NULL);
|
||||||
|
|
||||||
return g_task_propagate_pointer (G_TASK (result), NULL);
|
return g_task_propagate_pointer (G_TASK (result), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -817,6 +820,7 @@ gtk_font_dialog_choose_font (GtkFontDialog *self,
|
|||||||
GTK_FONT_CHOOSER_LEVEL_VARIATIONS);
|
GTK_FONT_CHOOSER_LEVEL_VARIATIONS);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_font_dialog_choose_font);
|
g_task_set_source_tag (task, gtk_font_dialog_choose_font);
|
||||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||||
|
|
||||||
@ -832,7 +836,7 @@ gtk_font_dialog_choose_font (GtkFontDialog *self,
|
|||||||
* gtk_font_dialog_choose_font_finish:
|
* gtk_font_dialog_choose_font_finish:
|
||||||
* @self: a `GtkFontDialog`
|
* @self: a `GtkFontDialog`
|
||||||
* @result: a `GAsyncResult`
|
* @result: a `GAsyncResult`
|
||||||
* @error: return location for an error
|
* @error: return location for a [enum@Gtk.DialogError] error
|
||||||
*
|
*
|
||||||
* Finishes the [method@Gtk.FontDialog.choose_font] call
|
* Finishes the [method@Gtk.FontDialog.choose_font] call
|
||||||
* and returns the resulting font description.
|
* and returns the resulting font description.
|
||||||
@ -850,7 +854,7 @@ gtk_font_dialog_choose_font_finish (GtkFontDialog *self,
|
|||||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||||
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font, NULL);
|
g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gtk_font_dialog_choose_font, NULL);
|
||||||
|
|
||||||
return g_task_propagate_pointer (G_TASK (result), NULL);
|
return g_task_propagate_pointer (G_TASK (result), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -896,6 +900,7 @@ gtk_font_dialog_choose_font_and_features (GtkFontDialog *self,
|
|||||||
GTK_FONT_CHOOSER_LEVEL_FEATURES);
|
GTK_FONT_CHOOSER_LEVEL_FEATURES);
|
||||||
|
|
||||||
task = g_task_new (self, cancellable, callback, user_data);
|
task = g_task_new (self, cancellable, callback, user_data);
|
||||||
|
g_task_set_check_cancellable (task, FALSE);
|
||||||
g_task_set_source_tag (task, gtk_font_dialog_choose_font_and_features);
|
g_task_set_source_tag (task, gtk_font_dialog_choose_font_and_features);
|
||||||
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
g_task_set_task_data (task, window, (GDestroyNotify) gtk_window_destroy);
|
||||||
|
|
||||||
@ -914,7 +919,7 @@ gtk_font_dialog_choose_font_and_features (GtkFontDialog *self,
|
|||||||
* @font_desc: (out caller-allocates): return location for font description
|
* @font_desc: (out caller-allocates): return location for font description
|
||||||
* @font_features: (out caller-allocates): return location for font features
|
* @font_features: (out caller-allocates): return location for font features
|
||||||
* @language: (out caller-allocates): return location for the language
|
* @language: (out caller-allocates): return location for the language
|
||||||
* @error: return location for an error
|
* @error: return location for a [enum@Gtk.DialogError] error
|
||||||
*
|
*
|
||||||
* Finishes the [method@Gtk.FontDialog.choose_font_and_features]
|
* Finishes the [method@Gtk.FontDialog.choose_font_and_features]
|
||||||
* call and returns the resulting font description and font features.
|
* call and returns the resulting font description and font features.
|
||||||
|
@ -393,8 +393,9 @@ gtk_font_dialog_button_class_init (GtkFontDialogButtonClass *class)
|
|||||||
static void
|
static void
|
||||||
update_button_sensitivity (GtkFontDialogButton *self)
|
update_button_sensitivity (GtkFontDialogButton *self)
|
||||||
{
|
{
|
||||||
gtk_widget_set_sensitive (self->button,
|
if (self->button)
|
||||||
self->dialog != NULL && self->cancellable == NULL);
|
gtk_widget_set_sensitive (self->button,
|
||||||
|
self->dialog != NULL && self->cancellable == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -402,10 +403,11 @@ family_chosen (GObject *source,
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
GtkFontDialog *dialog = GTK_FONT_DIALOG (source);
|
||||||
GtkFontDialogButton *self = data;
|
GtkFontDialogButton *self = data;
|
||||||
PangoFontFamily *family;
|
PangoFontFamily *family;
|
||||||
|
|
||||||
family = gtk_font_dialog_choose_family_finish (self->dialog, result, NULL);
|
family = gtk_font_dialog_choose_family_finish (dialog, result, NULL);
|
||||||
if (family)
|
if (family)
|
||||||
{
|
{
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
@ -428,10 +430,11 @@ face_chosen (GObject *source,
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
GtkFontDialog *dialog = GTK_FONT_DIALOG (source);
|
||||||
GtkFontDialogButton *self = data;
|
GtkFontDialogButton *self = data;
|
||||||
PangoFontFace *face;
|
PangoFontFace *face;
|
||||||
|
|
||||||
face = gtk_font_dialog_choose_face_finish (self->dialog, result, NULL);
|
face = gtk_font_dialog_choose_face_finish (dialog, result, NULL);
|
||||||
if (face)
|
if (face)
|
||||||
{
|
{
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
@ -453,10 +456,11 @@ font_chosen (GObject *source,
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
GtkFontDialog *dialog = GTK_FONT_DIALOG (source);
|
||||||
GtkFontDialogButton *self = data;
|
GtkFontDialogButton *self = data;
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
|
|
||||||
desc = gtk_font_dialog_choose_font_finish (self->dialog, result, NULL);
|
desc = gtk_font_dialog_choose_font_finish (dialog, result, NULL);
|
||||||
if (desc)
|
if (desc)
|
||||||
{
|
{
|
||||||
gtk_font_dialog_button_set_font_desc (self, desc);
|
gtk_font_dialog_button_set_font_desc (self, desc);
|
||||||
@ -472,12 +476,13 @@ font_and_features_chosen (GObject *source,
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
gpointer data)
|
gpointer data)
|
||||||
{
|
{
|
||||||
|
GtkFontDialog *dialog = GTK_FONT_DIALOG (source);
|
||||||
GtkFontDialogButton *self = data;
|
GtkFontDialogButton *self = data;
|
||||||
PangoFontDescription *desc;
|
PangoFontDescription *desc;
|
||||||
char *features;
|
char *features;
|
||||||
PangoLanguage *language;
|
PangoLanguage *language;
|
||||||
|
|
||||||
if (gtk_font_dialog_choose_font_and_features_finish (self->dialog, result,
|
if (gtk_font_dialog_choose_font_and_features_finish (dialog, result,
|
||||||
&desc, &features, &language,
|
&desc, &features, &language,
|
||||||
NULL))
|
NULL))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user