[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src chat_window.c,1.57,1.58 plugin.h,1.6,1.7
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src chat_window.c,1.57,1.58 plugin.h,1.6,1.7 plugin_api.c,1.12,1.13 plugin_api.h,1.5,1.6 status.c,1.58,1.59 util.c,1.55,1.56 util.h,1.26,1.27 |
Date: |
Thu, 20 Mar 2003 05:06:43 -0500 |
Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv3595/src
Modified Files:
chat_window.c plugin.h plugin_api.c plugin_api.h status.c
util.c util.h
Log Message:
protocol specific context-menu items
Index: chat_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_window.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -r1.57 -r1.58
--- chat_window.c 16 Mar 2003 15:05:01 -0000 1.57
+++ chat_window.c 20 Mar 2003 10:06:40 -0000 1.58
@@ -844,12 +844,15 @@
ecd->contact=cw->contact->nick;
mid=list->data;
mid->data=(ebmCallbackData *)ecd;
- eb_debug(DBG_CORE, "adding chat window item:
%s\n", mid->label);
- button =
gtk_menu_item_new_with_label(mid->label);
- gtk_menu_append(GTK_MENU(menu), button);
- gtk_signal_connect(GTK_OBJECT(button),
"activate",
- eb_generic_menu_function, mid);
- gtk_widget_show(button);
+ if (mid->protocol == NULL
+ || find_account_for_protocol(cw->contact,
get_service_id(mid->protocol))) {
+ eb_debug(DBG_CORE, "adding chat window
item: %s (%d)\n", mid->label, mid->protocol);
+ button =
gtk_menu_item_new_with_label(mid->label);
+ gtk_menu_append(GTK_MENU(menu), button);
+ gtk_signal_connect(GTK_OBJECT(button),
"activate",
+
eb_generic_menu_function, mid);
+ gtk_widget_show(button);
+ }
}
}
Index: plugin.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/plugin.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- plugin.h 29 Jan 2003 19:19:23 -0000 1.6
+++ plugin.h 20 Mar 2003 10:06:40 -0000 1.7
@@ -62,6 +62,7 @@
/*FIXME: Should have some sort of conditional callback to see if menu
item should be displayed */
ebmCallbackData *data;
void *user_data;
+ char * protocol;
} menu_item_data;
typedef void (*menu_func)();
Index: plugin_api.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/plugin_api.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- plugin_api.c 16 Mar 2003 12:57:27 -0000 1.12
+++ plugin_api.c 20 Mar 2003 10:06:40 -0000 1.13
@@ -67,6 +67,13 @@
return(ecd);
}
+void *eb_menu_item_set_protocol(void *item, char * protocol)
+{
+ menu_item_data *mid = (menu_item_data *)item;
+ eb_debug(DBG_CORE, "set prtocol:%s\n",protocol);
+ mid->protocol = protocol;
+}
+
void *eb_add_menu_item(char *label, char *menu_name, eb_menu_callback
callback, ebmType type, void *data)
{
menu_item_data *mid=NULL;
@@ -95,6 +102,7 @@
mid->user_data=data;
mid->label=label;
mid->callback=callback;
+ mid->protocol=NULL;
md->menu_items = l_list_append(md->menu_items, mid);
if(md->redraw_menu) {
eb_debug(DBG_CORE, "Calling redraw_menu for %s\n", menu_name);
Index: plugin_api.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/plugin_api.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- plugin_api.h 29 Jan 2003 19:19:23 -0000 1.5
+++ plugin_api.h 20 Mar 2003 10:06:40 -0000 1.6
@@ -114,6 +114,7 @@
/* FIXME: Want an eb_add_menu_item_condition function */
/* tag comes from a call to eb_add_menu_item, returns 0 on success */
int eb_remove_menu_item(char *menu_name, void *tag);
+void *eb_menu_item_set_protocol(void *item, char * protocol);
/* File */
typedef enum {
Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- status.c 18 Mar 2003 10:53:05 -0000 1.58
+++ status.c 20 Mar 2003 10:06:40 -0000 1.59
@@ -404,12 +404,16 @@
ecd->contact=conn->nick;
mid=(menu_item_data *)list->data;
mid->data=(ebmCallbackData *)ecd;
- eb_debug(DBG_CORE, "adding chat window item: %s\n",
mid->label);
- button = gtk_menu_item_new_with_label(mid->label);
- gtk_menu_append(GTK_MENU(menu), button);
- gtk_signal_connect(GTK_OBJECT(button), "activate",
- eb_generic_menu_function, mid);
- gtk_widget_show(button);
+
+ if (mid->protocol == NULL
+ || find_account_for_protocol(conn,
get_service_id(mid->protocol))) {
+ eb_debug(DBG_CORE, "adding chat window item: %s
(%d)\n", mid->label, mid->protocol);
+ button =
gtk_menu_item_new_with_label(mid->label);
+ gtk_menu_append(GTK_MENU(menu), button);
+ gtk_signal_connect(GTK_OBJECT(button),
"activate",
+ eb_generic_menu_function, mid);
+ gtk_widget_show(button);
+ }
}
}
Index: util.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- util.c 17 Mar 2003 18:17:08 -0000 1.55
+++ util.c 20 Mar 2003 10:06:40 -0000 1.56
@@ -1516,6 +1516,18 @@
}
}
+eb_account *find_account_for_protocol(struct contact *c, int service)
+{
+ LList *l = c->accounts;
+ while (l && l->data) {
+ eb_account *a = (eb_account *)l->data;
+ if (a->service_id == service)
+ return a;
+ l=l->next;
+ }
+ return NULL;
+}
+
GList * llist_to_glist(LList * ll, int free_old)
{
GList * g = NULL;
Index: util.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/util.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- util.h 17 Mar 2003 08:03:22 -0000 1.26
+++ util.h 20 Mar 2003 10:06:40 -0000 1.27
@@ -128,6 +128,7 @@
LList * get_groups();
void rename_nick_log(char *oldgroup, char *oldnick, char *newgroup, char
*newnick);
+eb_account *find_account_for_protocol(struct contact *c, int service);
GList * llist_to_glist(LList * l, int free_old);
/* free_old will free the old list after converting */
LList * glist_to_llist(GList * g, int free_old);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src chat_window.c,1.57,1.58 plugin.h,1.6,1.7 plugin_api.c,1.12,1.13 plugin_api.h,1.5,1.6 status.c,1.58,1.59 util.c,1.55,1.56 util.h,1.26,1.27,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm configure.in,1.350,1.351 ChangeLog,1.355,1.356
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.356,1.357 configure.in,1.351,1.352
- Previous by thread:
[Ayttm-commits] CVS: ayttm configure.in,1.350,1.351 ChangeLog,1.355,1.356
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.356,1.357 configure.in,1.351,1.352
- Index(es):