Register a new signal session-cancelled

This commit is contained in:
Guannan Ren 2012-01-31 14:35:17 +00:00 committed by Daniel P. Berrange
parent c61981540d
commit 8a6cb8c012
3 changed files with 11 additions and 2 deletions

View File

@ -292,8 +292,7 @@ virt_viewer_session_spice_main_channel_event(SpiceChannel *channel G_GNUC_UNUSED
NULL,
NULL, &password);
if (ret < 0) {
g_signal_emit_by_name(session, "session-auth-refused",
_("Unable to collect credentials"));
g_signal_emit_by_name(session, "session-cancelled");
} else {
g_object_set(self->priv->session, "password", password, NULL);
spice_session_connect(self->priv->session);

View File

@ -230,6 +230,15 @@ virt_viewer_session_class_init(VirtViewerSessionClass *class)
G_TYPE_NONE,
0);
g_signal_new("session-cancelled",
G_OBJECT_CLASS_TYPE(object_class),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET(VirtViewerSessionClass, session_cancelled),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
0);
g_type_class_add_private(class, sizeof(VirtViewerSessionPrivate));
}

View File

@ -88,6 +88,7 @@ struct _VirtViewerSessionClass {
void (*session_cut_text)(VirtViewerSession *session, const char *str);
void (*session_bell)(VirtViewerSession *session);
void (*session_cancelled)(VirtViewerSession *session);
};
GType virt_viewer_session_get_type(void);