Added basic support for displaying status messages in the userlist
This commit is contained in:
parent
3d1ab9f28d
commit
b8d42587e1
|
@ -1,3 +1,10 @@
|
|||
2006-01-04 Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
* gnoemoe/mcp/gm-mcp-userlist-view.c:
|
||||
* gnoemoe/mcp/gm-mcp-iuserlist.[ch]:
|
||||
* gnoemoe/mcp/gm-mcp-vmoo-userlist.[ch]:
|
||||
* gnoemoe/mcp/gm-mcp-icecrew-userlist.[ch]:
|
||||
added basic support for displaying status messages in the userlist
|
||||
|
||||
2006-01-04 Jesse van den Kieboom <jesse@icecrew.nl>
|
||||
* gnoemoe/widgets/gm-log-view.c:
|
||||
* gnoemoe/widgets/gm-source-style-scheme.[ch]:
|
||||
|
|
|
@ -28,7 +28,7 @@ GList *
|
|||
gm_iuserlist_get_menu(GmIUserlist *self, gint id) {
|
||||
GmIUserlistInterface *iface;
|
||||
|
||||
g_return_val_if_fail(GM_IS_IUSERLIST(self), FALSE);
|
||||
g_return_val_if_fail(GM_IS_IUSERLIST(self), NULL);
|
||||
|
||||
iface = GM_IUSERLIST_GET_INTERFACE(self);
|
||||
|
||||
|
@ -38,3 +38,48 @@ gm_iuserlist_get_menu(GmIUserlist *self, gint id) {
|
|||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gm_iuserlist_supports_status(GmIUserlist *self) {
|
||||
GmIUserlistInterface *iface;
|
||||
|
||||
g_return_val_if_fail(GM_IS_IUSERLIST(self), FALSE);
|
||||
|
||||
iface = GM_IUSERLIST_GET_INTERFACE(self);
|
||||
|
||||
if (iface->supports_status) {
|
||||
return (* iface->supports_status) (self);
|
||||
} else {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gchar *
|
||||
gm_iuserlist_get_status(GmIUserlist *self, gint id) {
|
||||
GmIUserlistInterface *iface;
|
||||
|
||||
g_return_val_if_fail(GM_IS_IUSERLIST(self), NULL);
|
||||
|
||||
iface = GM_IUSERLIST_GET_INTERFACE(self);
|
||||
|
||||
if (iface->get_status) {
|
||||
return (* iface->get_status) (self, id);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gchar const *
|
||||
gm_iuserlist_get_name(GmIUserlist *self, gint id) {
|
||||
GmIUserlistInterface *iface;
|
||||
|
||||
g_return_val_if_fail(GM_IS_IUSERLIST(self), NULL);
|
||||
|
||||
iface = GM_IUSERLIST_GET_INTERFACE(self);
|
||||
|
||||
if (iface->get_name) {
|
||||
return (* iface->get_name) (self, id);
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,16 @@ struct _GmIUserlistInterface {
|
|||
GTypeInterface parent;
|
||||
|
||||
GList *(* get_menu) (GmIUserlist *self, gint id);
|
||||
gboolean (* supports_status) (GmIUserlist *self);
|
||||
gchar *(* get_status) (GmIUserlist *self, gint id);
|
||||
gchar const *(* get_name) (GmIUserlist *self, gint id);
|
||||
};
|
||||
|
||||
GType gm_iuserlist_get_type();
|
||||
|
||||
GList *gm_iuserlist_get_menu(GmIUserlist *self, gint id);
|
||||
gboolean gm_iuserlist_supports_status(GmIUserlist *self);
|
||||
gchar *gm_iuserlist_get_status(GmIUserlist *self, gint id);
|
||||
gchar const *gm_iuserlist_get_name(GmIUserlist *self, gint id);
|
||||
|
||||
#endif /* __GM_IUSERLIST_H__ */
|
||||
|
|
|
@ -107,11 +107,17 @@ void gm_mcp_icecrew_userlist_fetch_progress(GmFetchHandle *g,
|
|||
GmMcpIcecrewUserlist *package);
|
||||
|
||||
GList *gm_mcp_icecrew_userlist_get_menu(GmIUserlist *userlist, gint id);
|
||||
gboolean gm_mcp_icecrew_userlist_supports_status(GmIUserlist *userlist);
|
||||
gchar *gm_mcp_icecrew_userlist_get_status(GmIUserlist *userlist, gint id);
|
||||
gchar const *gm_mcp_icecrew_userlist_get_name(GmIUserlist *userlist, gint id);
|
||||
|
||||
static void
|
||||
gm_mcp_icecrew_userlist_iface_init(
|
||||
GmIUserlistInterface *iface) {
|
||||
iface->get_menu = gm_mcp_icecrew_userlist_get_menu;
|
||||
iface->supports_status = gm_mcp_icecrew_userlist_supports_status;
|
||||
iface->get_status = gm_mcp_icecrew_userlist_get_status;
|
||||
iface->get_name = gm_mcp_icecrew_userlist_get_name;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -187,12 +193,11 @@ gm_mcp_icecrew_userlist_class_init(GmMcpIcecrewUserlistClass *klass) {
|
|||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET(GmMcpIcecrewUserlistClass, player_added),
|
||||
NULL, NULL,
|
||||
gm_marshal_VOID__INT_STRING_STRING_STRING,
|
||||
gm_marshal_VOID__INT_STRING_STRING,
|
||||
G_TYPE_NONE,
|
||||
4,
|
||||
3,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
gm_mcp_icecrew_userlist_signals[PLAYER_REMOVED] =
|
||||
g_signal_new("player_removed",
|
||||
|
@ -210,11 +215,10 @@ gm_mcp_icecrew_userlist_class_init(GmMcpIcecrewUserlistClass *klass) {
|
|||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET(GmMcpIcecrewUserlistClass, name_changed),
|
||||
NULL, NULL,
|
||||
gm_marshal_VOID__INT_STRING_STRING,
|
||||
gm_marshal_VOID__INT_STRING,
|
||||
G_TYPE_NONE,
|
||||
3,
|
||||
2,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
gm_mcp_icecrew_userlist_signals[STATE_CHANGED] =
|
||||
g_signal_new("state_changed",
|
||||
|
@ -913,6 +917,50 @@ gm_mcp_icecrew_userlist_get_menu(GmIUserlist *userlist, gint id) {
|
|||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gm_mcp_icecrew_userlist_supports_status(GmIUserlist *userlist) {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
gchar const *
|
||||
gm_mcp_icecrew_userlist_get_name(GmIUserlist *userlist, gint id) {
|
||||
GmMcpIcecrewPlayerdb *playerdb = GM_MCP_ICECREW_PLAYERDB(
|
||||
gm_mcp_session_find_package(GM_MCP_PACKAGE_SESSION(userlist),
|
||||
"dns-nl-icecrew-playerdb"));
|
||||
GmPlayerdbPlayerInfo *info = gm_mcp_icecrew_playerdb_find(playerdb, id);
|
||||
|
||||
return gm_playerdb_player_info_get_prop(info, "P_NAME");
|
||||
}
|
||||
|
||||
gchar *
|
||||
gm_mcp_icecrew_userlist_get_status(GmIUserlist *userlist, gint id) {
|
||||
GmMcpIcecrewPlayerdb *playerdb = GM_MCP_ICECREW_PLAYERDB(
|
||||
gm_mcp_session_find_package(GM_MCP_PACKAGE_SESSION(userlist),
|
||||
"dns-nl-icecrew-playerdb"));
|
||||
GmPlayerdbPlayerInfo *info = gm_mcp_icecrew_playerdb_find(playerdb, id);
|
||||
gchar const *state = gm_playerdb_player_info_get_prop(info, "P_STATE");
|
||||
gchar const *msg = gm_playerdb_player_info_get_prop(info, "P_STATE_MSG");
|
||||
gchar const *caption;
|
||||
|
||||
if (state == NULL || strcmp(state, "avail") == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (strstr(state, "away") != 0) {
|
||||
caption = _("Away");
|
||||
} else if (strstr(state, "busy") != 0) {
|
||||
caption = _("Busy");
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (msg == NULL) {
|
||||
return strdup(caption);
|
||||
} else {
|
||||
return g_strconcat(caption, ": ", msg, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gm_mcp_icecrew_userlist_handle_menu(GmMcpIcecrewUserlist *package,
|
||||
GList *values) {
|
||||
|
@ -1166,8 +1214,10 @@ on_gm_mcp_icecrew_userlist_add(GmMcpIcecrewPlayerdb *playerdb,
|
|||
gchar const *icon_path = gm_mcp_icecrew_userlist_icon_path(userlist, ppi);
|
||||
|
||||
g_signal_emit(userlist, gm_mcp_icecrew_userlist_signals[PLAYER_ADDED],
|
||||
0, ppi->id, name, icon_path, sort);
|
||||
0, ppi->id, icon_path, sort);
|
||||
gm_mcp_icecrew_userlist_process_triggers(userlist, name, TCT_USER_ONLINE);
|
||||
|
||||
g_free(sort);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1194,8 +1244,14 @@ on_gm_mcp_icecrew_userlist_set(GmMcpIcecrewPlayerdb *playerdb,
|
|||
sort = gm_mcp_icecrew_userlist_sort_string(userlist, ppi);
|
||||
|
||||
g_signal_emit(userlist, gm_mcp_icecrew_userlist_signals[NAME_CHANGED],
|
||||
0, ppi->id, value, sort);
|
||||
0, ppi->id, sort);
|
||||
} else if (strcmp(key, "P_STATE_MSG") == 0) {
|
||||
sort = gm_mcp_icecrew_userlist_sort_string(userlist, ppi);
|
||||
g_signal_emit(userlist, gm_mcp_icecrew_userlist_signals[NAME_CHANGED],
|
||||
0, ppi->id, sort);
|
||||
}
|
||||
|
||||
g_free(sort);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -54,10 +54,10 @@ struct _GmMcpIcecrewUserlistClass {
|
|||
|
||||
/* Signals */
|
||||
void (* player_added) (GmMcpIcecrewUserlist *obj, gint id,
|
||||
gchar const *name, gchar const *icon, gchar const *sort);
|
||||
gchar const *icon, gchar const *sort);
|
||||
void (* player_removed) (GmMcpIcecrewUserlist *obj, gint id);
|
||||
void (* name_changed) (GmMcpIcecrewUserlist *obj, gint id,
|
||||
gchar const *name, gchar const *sort);
|
||||
gchar const *sort);
|
||||
void (* state_changed) (GmMcpIcecrewUserlist *obj, gint id,
|
||||
gchar const *icon, gchar const *sort);
|
||||
void (* rank_changed) (GmMcpIcecrewUserlist *obj, gint id,
|
||||
|
|
|
@ -25,19 +25,18 @@ typedef struct _GmMcpUserlistView {
|
|||
GtkTreeView *tree_view;
|
||||
GtkScrolledWindow *scrolled_window;
|
||||
GtkWidget *popup_menu;
|
||||
|
||||
gboolean initializing;
|
||||
} GmMcpUserlistView;
|
||||
|
||||
static void on_gm_mcp_userlist_view_weak_notify(gpointer data, GObject *obj);
|
||||
|
||||
static void on_gm_mcp_userlist_view_player_added(GmMcpPackage *package, gint id,
|
||||
gchar const *name, gchar const *icon, gchar const *sort,
|
||||
gchar const *icon, gchar const *sort,
|
||||
GmMcpUserlistView *view);
|
||||
static void on_gm_mcp_userlist_view_player_removed(GmMcpPackage *package, gint id,
|
||||
GmMcpUserlistView *view);
|
||||
static void on_gm_mcp_userlist_view_name_changed(GmMcpPackage *package, gint id,
|
||||
gchar const *name, gchar const *sort, GmMcpUserlistView *view);
|
||||
gchar const *sort, GmMcpUserlistView *view);
|
||||
static void on_gm_mcp_userlist_view_rank_changed(GmMcpPackage *package, gint id,
|
||||
gchar const *icon, gchar const *sort, GmMcpUserlistView *view);
|
||||
static void on_gm_mcp_userlist_view_state_changed(GmMcpPackage *package, gint id,
|
||||
|
@ -60,6 +59,12 @@ gm_mcp_userlist_view_model_create(GmMcpUserlistView *view) {
|
|||
return model;
|
||||
}
|
||||
|
||||
void
|
||||
on_gm_mcp_userlist_view_style_set(GtkWidget *widget, GtkStyle *prev,
|
||||
GmMcpUserlistView *view) {
|
||||
pango_font_description_set_size(widget->style->font_desc, 8 * PANGO_SCALE);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
gm_mcp_userlist_view_create_userlist(GmMcpUserlistView *view) {
|
||||
GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
|
||||
|
@ -68,8 +73,13 @@ gm_mcp_userlist_view_create_userlist(GmMcpUserlistView *view) {
|
|||
GtkCellRenderer *renderer;
|
||||
GtkTreeViewColumn *column;
|
||||
|
||||
on_gm_mcp_userlist_view_style_set(tree_view, NULL, view);
|
||||
|
||||
g_signal_connect(tree_view, "style-set",
|
||||
G_CALLBACK(on_gm_mcp_userlist_view_style_set), view);
|
||||
|
||||
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolled_window),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
|
||||
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_window),
|
||||
GTK_SHADOW_IN);
|
||||
|
||||
|
@ -86,7 +96,7 @@ gm_mcp_userlist_view_create_userlist(GmMcpUserlistView *view) {
|
|||
|
||||
renderer = gtk_cell_renderer_text_new();
|
||||
column = gtk_tree_view_column_new_with_attributes(_("Name"), renderer,
|
||||
"text", GM_USERLIST_NAME, NULL);
|
||||
"markup", GM_USERLIST_NAME, NULL);
|
||||
gtk_tree_view_append_column(GTK_TREE_VIEW(tree_view), column);
|
||||
|
||||
gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(model),
|
||||
|
@ -199,11 +209,49 @@ gm_mcp_userlist_view_find(GmMcpUserlistView *view, gint id, GtkTreeIter *iter) {
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gchar *
|
||||
gm_mcp_userlist_view_get_name(GmMcpUserlistView *view, GmMcpPackage *package,
|
||||
gint id) {
|
||||
gchar const *name;
|
||||
gchar *status;
|
||||
gchar *escape;
|
||||
gchar *result;
|
||||
gchar *color;
|
||||
GdkColor col;
|
||||
|
||||
name = gm_iuserlist_get_name(GM_IUSERLIST(package), id);
|
||||
|
||||
if (!gm_iuserlist_supports_status(GM_IUSERLIST(package))) {
|
||||
return g_strdup(name);
|
||||
} else {
|
||||
status = gm_iuserlist_get_status(GM_IUSERLIST(package), id);
|
||||
|
||||
if (status) {
|
||||
col = GTK_WIDGET(view->tree_view)->style->text[GTK_STATE_INSENSITIVE];
|
||||
color = g_strdup_printf("#%04X%04X%04X", col.red, col.green,
|
||||
col.blue);
|
||||
|
||||
escape = g_markup_escape_text(status, -1);
|
||||
result = g_strconcat(name, "\n<small><span color=\"", color, "\">",
|
||||
escape, "</span></small>", NULL);
|
||||
|
||||
g_free(color);
|
||||
g_free(status);
|
||||
g_free(escape);
|
||||
} else {
|
||||
result = g_strdup(name);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
on_gm_mcp_userlist_view_player_added(GmMcpPackage *package, gint id,
|
||||
gchar const *name, gchar const *icon, gchar const *sort,
|
||||
gchar const *icon, gchar const *sort,
|
||||
GmMcpUserlistView *view) {
|
||||
GtkTreeIter iter;
|
||||
gchar *name;
|
||||
|
||||
if (gm_mcp_userlist_view_find(view, id, &iter)) {
|
||||
gm_debug_msg(DEBUG_MCP, "GmMcpUserlistView.OnPlayerAdded: player %d "
|
||||
|
@ -211,11 +259,15 @@ on_gm_mcp_userlist_view_player_added(GmMcpPackage *package, gint id,
|
|||
return;
|
||||
}
|
||||
|
||||
name = gm_mcp_userlist_view_get_name(view, package, id);
|
||||
|
||||
gtk_list_store_append(view->store, &iter);
|
||||
gtk_list_store_set(view->store, &iter, GM_USERLIST_ID, id, GM_USERLIST_ICON,
|
||||
gm_pixbuf_get_at_size(icon, GM_USERLIST_ICON_SIZE,
|
||||
GM_USERLIST_ICON_SIZE), GM_USERLIST_NAME, name, GM_USERLIST_SORT,
|
||||
sort, -1);
|
||||
|
||||
g_free(name);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -234,8 +286,9 @@ on_gm_mcp_userlist_view_player_removed(GmMcpPackage *package, gint id,
|
|||
|
||||
static void
|
||||
on_gm_mcp_userlist_view_name_changed(GmMcpPackage *package, gint id,
|
||||
gchar const *name, gchar const *sort, GmMcpUserlistView *view) {
|
||||
gchar const *sort, GmMcpUserlistView *view) {
|
||||
GtkTreeIter iter;
|
||||
gchar *name;
|
||||
|
||||
if (!gm_mcp_userlist_view_find(view, id, &iter)) {
|
||||
gm_debug_msg(DEBUG_MCP, "GmMcpUserlistView.OnNameChanged: player %d "
|
||||
|
@ -243,7 +296,9 @@ on_gm_mcp_userlist_view_name_changed(GmMcpPackage *package, gint id,
|
|||
return;
|
||||
}
|
||||
|
||||
name = gm_mcp_userlist_view_get_name(view, package, id);
|
||||
gtk_list_store_set(view->store, &iter, GM_USERLIST_NAME, name, -1);
|
||||
g_free(name);
|
||||
|
||||
if (sort) {
|
||||
gtk_list_store_set(view->store, &iter, GM_USERLIST_SORT, sort, -1);
|
||||
|
@ -274,6 +329,7 @@ static void
|
|||
on_gm_mcp_userlist_view_state_changed(GmMcpPackage *package, gint id,
|
||||
gchar const *icon, gchar const *sort, GmMcpUserlistView *view) {
|
||||
GtkTreeIter iter;
|
||||
gchar *name;
|
||||
|
||||
if (!gm_mcp_userlist_view_find(view, id, &iter)) {
|
||||
gm_debug_msg(DEBUG_MCP, "GmMcpUserlistView.OnStateChanged: player %d "
|
||||
|
@ -281,9 +337,13 @@ on_gm_mcp_userlist_view_state_changed(GmMcpPackage *package, gint id,
|
|||
return;
|
||||
}
|
||||
|
||||
name = gm_mcp_userlist_view_get_name(view, package, id);
|
||||
|
||||
gtk_list_store_set(view->store, &iter, GM_USERLIST_ICON,
|
||||
gm_pixbuf_get_at_size(icon, GM_USERLIST_ICON_SIZE,
|
||||
GM_USERLIST_ICON_SIZE), -1);
|
||||
GM_USERLIST_ICON_SIZE), GM_USERLIST_NAME, name, -1);
|
||||
|
||||
g_free(name);
|
||||
|
||||
if (sort) {
|
||||
gtk_list_store_set(view->store, &iter, GM_USERLIST_SORT, sort, -1);
|
||||
|
|
|
@ -75,12 +75,15 @@ gboolean gm_mcp_vmoo_userlist_handle_multi(GmMcpPackage *package,
|
|||
|
||||
void gm_mcp_vmoo_userlist_create_view(GmMcpPackage *package,
|
||||
GObject *parent);
|
||||
|
||||
GList *gm_mcp_vmoo_userlist_get_menu(GmIUserlist *userlist, gint id);
|
||||
gchar const *gm_mcp_vmoo_userlist_get_name(GmIUserlist *userlist, gint id);
|
||||
|
||||
static void
|
||||
gm_mcp_vmoo_userlist_iface_init(
|
||||
GmIUserlistInterface *iface) {
|
||||
iface->get_menu = gm_mcp_vmoo_userlist_get_menu;
|
||||
iface->get_name = gm_mcp_vmoo_userlist_get_name;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -154,12 +157,11 @@ gm_mcp_vmoo_userlist_class_init(GmMcpVmooUserlistClass *klass) {
|
|||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET(GmMcpVmooUserlistClass, player_added),
|
||||
NULL, NULL,
|
||||
gm_marshal_VOID__INT_STRING_STRING_STRING,
|
||||
gm_marshal_VOID__INT_STRING_STRING,
|
||||
G_TYPE_NONE,
|
||||
4,
|
||||
3,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
gm_mcp_vmoo_userlist_signals[PLAYER_REMOVED] =
|
||||
g_signal_new("player_removed",
|
||||
|
@ -177,11 +179,10 @@ gm_mcp_vmoo_userlist_class_init(GmMcpVmooUserlistClass *klass) {
|
|||
G_SIGNAL_RUN_LAST,
|
||||
G_STRUCT_OFFSET(GmMcpVmooUserlistClass, name_changed),
|
||||
NULL, NULL,
|
||||
gm_marshal_VOID__INT_STRING_STRING,
|
||||
gm_marshal_VOID__INT_STRING,
|
||||
G_TYPE_NONE,
|
||||
3,
|
||||
2,
|
||||
G_TYPE_INT,
|
||||
G_TYPE_STRING,
|
||||
G_TYPE_STRING);
|
||||
gm_mcp_vmoo_userlist_signals[STATE_CHANGED] =
|
||||
g_signal_new("state_changed",
|
||||
|
@ -522,6 +523,14 @@ gm_mcp_vmoo_userlist_get_menu(GmIUserlist *userlist, gint id) {
|
|||
return menu;
|
||||
}
|
||||
|
||||
gchar const *
|
||||
gm_mcp_vmoo_userlist_get_name(GmIUserlist *userlist, gint id) {
|
||||
GmMcpVmooUserlist *package = (GmMcpVmooUserlist *)(userlist);
|
||||
UserInfo *info = gm_mcp_vmoo_userlist_find_user(package, id);
|
||||
|
||||
return info->name;
|
||||
}
|
||||
|
||||
void
|
||||
gm_mcp_vmoo_userlist_remove_user(GmMcpVmooUserlist *package, gint nr) {
|
||||
GList *elem;
|
||||
|
@ -586,7 +595,7 @@ gm_mcp_vmoo_userlist_handle_user_update(GmMcpVmooUserlist *package, MOOVar *v) {
|
|||
package->priv->users = g_list_append(package->priv->users, ui);
|
||||
sort = gm_mcp_vmoo_userlist_sort_string(package, ui);
|
||||
g_signal_emit(package, gm_mcp_vmoo_userlist_signals[PLAYER_ADDED], 0,
|
||||
nr, name, gm_mcp_vmoo_userlist_get_icon(package, ui), sort);
|
||||
nr, gm_mcp_vmoo_userlist_get_icon(package, ui), sort);
|
||||
g_free(sort);
|
||||
|
||||
gm_mcp_vmoo_userlist_process_triggers(package, ui->name,
|
||||
|
@ -598,7 +607,7 @@ gm_mcp_vmoo_userlist_handle_user_update(GmMcpVmooUserlist *package, MOOVar *v) {
|
|||
|
||||
sort = gm_mcp_vmoo_userlist_sort_string(package, ui);
|
||||
g_signal_emit(package, gm_mcp_vmoo_userlist_signals[NAME_CHANGED],
|
||||
0, nr, name, sort);
|
||||
0, nr, sort);
|
||||
g_free(sort);
|
||||
} else {
|
||||
g_free(name);
|
||||
|
|
|
@ -49,10 +49,10 @@ struct _GmMcpVmooUserlistClass {
|
|||
|
||||
/* Signals */
|
||||
void (* player_added) (GmMcpVmooUserlist *obj, gint id,
|
||||
gchar const *name, gchar const *icon, gchar const *sort);
|
||||
gchar const *icon, gchar const *sort);
|
||||
void (* player_removed) (GmMcpVmooUserlist *obj, gint id);
|
||||
void (* name_changed) (GmMcpVmooUserlist *obj, gint id,
|
||||
gchar const *name, gchar const *sort);
|
||||
gchar const *sort);
|
||||
void (* state_changed) (GmMcpVmooUserlist *obj, gint id,
|
||||
gchar const *icon, gchar const *sort);
|
||||
void (* rank_changed) (GmMcpVmooUserlist *obj, gint id,
|
||||
|
|
Reference in New Issue