62
62
#include "empathy-theme-manager.h"
63
63
#include "empathy-ui-utils.h"
64
64
#include "empathy-webkit-utils.h"
65
#include "empathy-geometry.h"
66
67
#define DEBUG_FLAG EMPATHY_DEBUG_OTHER
67
68
#include <libempathy/empathy-debug.h>
2076
do_update_buttons_sensitivity (EmpathyLogWindow *self)
2078
EmpathyCapabilities capabilities;
2079
gboolean profile, chat, call, video;
2081
tp_clear_object (&self->priv->button_video_binding);
2083
if (self->priv->selected_contact != NULL)
2085
capabilities = empathy_contact_get_capabilities (
2086
self->priv->selected_contact);
2088
profile = chat = TRUE;
2089
call = capabilities & EMPATHY_CAPABILITIES_AUDIO;
2090
video = capabilities & EMPATHY_CAPABILITIES_VIDEO;
2094
profile = chat = call = video = FALSE;
2097
gtk_widget_set_sensitive (self->priv->button_profile, profile);
2098
gtk_widget_set_sensitive (self->priv->button_chat, chat);
2099
gtk_widget_set_sensitive (self->priv->button_call, call);
2103
self->priv->button_video_binding = g_object_bind_property (
2104
self->priv->camera_monitor, "available",
2105
self->priv->button_video, "sensitive",
2106
G_BINDING_SYNC_CREATE);
2110
/* Don't override the binding */
2111
gtk_widget_set_sensitive (self->priv->button_video, video);
2116
contact_capabilities_changed_cb (EmpathyContact *contact,
2118
EmpathyLogWindow *self)
2120
do_update_buttons_sensitivity (self);
2073
2124
log_window_update_buttons_sensitivity (EmpathyLogWindow *self)
2075
2126
GtkTreeView *view;
2076
2127
GtkTreeModel *model;
2077
2128
GtkTreeSelection *selection;
2078
EmpathyCapabilities capabilities;
2079
2129
TpAccount *account;
2080
2130
TplEntity *target;
2081
2131
GtkTreeIter iter;
2083
2133
GtkTreePath *path;
2084
gboolean profile, chat, call, video;
2086
profile = chat = call = video = FALSE;
2088
tp_clear_object (&self->priv->button_video_binding);
2089
tp_clear_object (&self->priv->selected_contact);
2135
if (self->priv->selected_contact != NULL)
2137
g_signal_handlers_disconnect_by_func (self->priv->selected_contact,
2138
contact_capabilities_changed_cb, self);
2140
tp_clear_object (&self->priv->selected_contact);
2091
2143
view = GTK_TREE_VIEW (self->priv->treeview_who);
2092
2144
model = gtk_tree_view_get_model (view);
2093
2145
selection = gtk_tree_view_get_selection (view);
2095
profile = chat = call = video = FALSE;
2097
2147
if (!gtk_tree_model_get_iter_first (model, &iter))
2137
2181
if (self->priv->events_contact != NULL)
2138
2182
self->priv->selected_contact = g_object_ref (self->priv->events_contact);
2142
capabilities = empathy_contact_get_capabilities (self->priv->selected_contact);
2144
profile = chat = TRUE;
2145
call = capabilities & EMPATHY_CAPABILITIES_AUDIO;
2146
video = capabilities & EMPATHY_CAPABILITIES_VIDEO;
2149
self->priv->button_video_binding = g_object_bind_property (
2150
self->priv->camera_monitor, "available",
2151
self->priv->button_video, "sensitive",
2152
G_BINDING_SYNC_CREATE);
2155
gtk_widget_set_sensitive (self->priv->button_profile, profile);
2156
gtk_widget_set_sensitive (self->priv->button_chat, chat);
2157
gtk_widget_set_sensitive (self->priv->button_call, call);
2185
if (self->priv->selected_contact != NULL)
2187
tp_g_signal_connect_object (self->priv->selected_contact,
2188
"notify::capabilities", G_CALLBACK (contact_capabilities_changed_cb),
2159
/* Don't override the binding */
2161
gtk_widget_set_sensitive (self->priv->button_video, video);
2192
do_update_buttons_sensitivity (self);