ayttm-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ayttm-commits] CVS: ayttm/src chat_window.c,1.60,1.61 status.c,1.64,1.


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src chat_window.c,1.60,1.61 status.c,1.64,1.65 status.h,1.8,1.9
Date: Fri, 21 Mar 2003 15:09:02 -0500

Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv22818/src

Modified Files:
        chat_window.c status.c status.h 
Log Message:
nice menu in chatwindow


Index: chat_window.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_window.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -r1.60 -r1.61
--- chat_window.c       20 Mar 2003 10:41:41 -0000      1.60
+++ chat_window.c       21 Mar 2003 20:09:00 -0000      1.61
@@ -839,30 +839,13 @@
                /*Add Plugin Menus*/
                md = GetPref(EB_CHAT_WINDOW_MENU);
                if(md) {
-                       for(list = md->menu_items; list; list  = list->next ) {
-                               ecd=ebmContactData_new();
-                               ecd->contact=cw->contact->nick;
-                               mid=list->data;
-                               if (cw->preferred)
-                                       
ecd->remote_account=cw->preferred->handle;
-                               if (cw->local_user)
-                                       ecd->local_account = 
cw->local_user->handle;
-                               else if (mid->protocol != NULL) {
-                                       eb_local_account *a = 
find_suitable_local_account(NULL, 
-                                                       
get_service_id(mid->protocol));
-                                       ecd->local_account = a ? 
a->handle:NULL;        
-                               }
-                               mid->data=(ebmCallbackData *)ecd;
-                               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);
-                               }
-                       }
+                       int should_sep=0;
+                       eb_menu_button (GTK_MENU(menu), NULL, NULL, NULL);
+                       should_sep=(add_menu_items(menu,-1, should_sep, NULL, 
cw->preferred, cw->local_user)>0);
+                       if (cw->local_user)
+                               add_menu_items(menu,cw->local_user->service_id, 
should_sep, NULL, 
+                                               cw->preferred, cw->local_user);
+                       eb_menu_button (GTK_MENU(menu), NULL, NULL, NULL);
                }
 
                /*Close Selection*/

Index: status.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -r1.64 -r1.65
--- status.c    21 Mar 2003 19:46:36 -0000      1.64
+++ status.c    21 Mar 2003 20:09:00 -0000      1.65
@@ -355,8 +355,8 @@
                        event->button, event->time );
 }
 
-static int add_menu_items(GtkWidget *menu, int cur_service, int should_sep,
-                       struct contact *conn, eb_account *acc)
+int add_menu_items(GtkWidget *menu, int cur_service, int should_sep,
+                       struct contact *conn, eb_account *acc, eb_local_account 
*ela)
 {
        GtkWidget *submenu, *button;
        menu_data *md=NULL;
@@ -378,9 +378,9 @@
                mid=(menu_item_data *)list->data;
                mid->data=(ebmCallbackData *)ecd;
                if (mid->protocol != NULL) {
-                       eb_local_account *a = find_suitable_local_account(NULL, 
+                       eb_local_account *a = 
ela?ela:find_suitable_local_account(NULL, 
                                        get_service_id(mid->protocol));
-                       ecd->local_account = a ? a->handle:NULL;        
+                       ecd->local_account = (a && a->connected) ? 
a->handle:NULL;
                }
 
                if ( (mid->protocol == NULL 
@@ -467,7 +467,7 @@
        if(md) {
                int should_sep=0;
                for (cur_service=-1; cur_service<0 || 
strcmp(get_service_name(cur_service),"unknown"); cur_service++) {
-                       should_sep=(add_menu_items(menu,cur_service, 
should_sep, conn, NULL)>0);
+                       should_sep=(add_menu_items(menu,cur_service, 
should_sep, conn, NULL,NULL)>0);
                }
        }
 
@@ -510,8 +510,8 @@
        if(md) {
                int should_sep=0;
                
-               should_sep=(add_menu_items(menu,-1, should_sep, NULL, acc)>0);
-               add_menu_items(menu,acc->service_id, should_sep, NULL, acc);
+               should_sep=(add_menu_items(menu,-1, should_sep, NULL, acc, 
NULL)>0);
+               add_menu_items(menu,acc->service_id, should_sep, NULL, acc, 
NULL);
        }
 
        gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,

Index: status.h
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/status.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- status.h    29 Jan 2003 19:19:23 -0000      1.8
+++ status.h    21 Mar 2003 20:09:00 -0000      1.9
@@ -71,6 +71,8 @@
 void update_user(eb_account * ea );
 void update_contact_window_length ();
 void focus_statuswindow (void);
+int add_menu_items(GtkWidget *menu, int cur_service, int should_sep,
+                       struct contact *conn, eb_account *acc, eb_local_account 
*ela);
 
 #ifdef __cplusplus
 } /* extern "C" */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]