ayttm-commits
[Top][All Lists]
Advanced

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

[Ayttm-commits] CVS: ayttm/src chat_room.c,1.22,1.23


From: Colin Leroy <address@hidden>
Subject: [Ayttm-commits] CVS: ayttm/src chat_room.c,1.22,1.23
Date: Mon, 13 Jan 2003 04:52:44 -0500

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

Modified Files:
        chat_room.c 
Log Message:
update chat_room window title
antoher fix to workwizu


Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- chat_room.c 13 Jan 2003 07:23:27 -0000      1.22
+++ chat_room.c 13 Jan 2003 09:52:41 -0000      1.23
@@ -47,6 +47,8 @@
 GList * chat_rooms = NULL;
 
 static GList * get_contacts( eb_chat_room * room );
+static void handle_focus(GtkWidget *widget, GdkEventFocus * event, gpointer 
userdata);
+static void eb_chat_room_update_window_title(eb_chat_room *ecb, gboolean 
new_message);
 
 static void send_cr_message( GtkWidget * widget, gpointer data )
 {
@@ -100,6 +102,11 @@
   eb_chat_room *cr = (eb_chat_room *)data;
   GdkModifierType modifiers = event->state & (GDK_SHIFT_MASK | 
GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_MOD4_MASK);
 
+  eb_chat_room_update_window_title(cr, FALSE);
+
+  if (!iGetLocalPref("do_multi_line"))
+         return;
+  
   if (event->keyval == GDK_Return)
     {
       /* Just print a newline on Shift-Return */
@@ -575,7 +582,23 @@
        eb_chat_room_refresh_list(room);
 }
 
+static void handle_focus(GtkWidget *widget, GdkEventFocus * event, gpointer 
userdata)
+{
+       eb_chat_room * cr = (eb_chat_room *)userdata;
+       eb_chat_room_update_window_title(cr, FALSE);
+
+}
 
+static void eb_chat_room_update_window_title(eb_chat_room *ecb, gboolean 
new_message)
+{
+       char *room_title;
+       room_title = g_strdup_printf("%s%s [%s]", 
+                       new_message?"* ":"",
+                       ecb->room_name, 
+                       get_service_name(ecb->service_id));
+       gtk_window_set_title(GTK_WINDOW(ecb->window), room_title);
+       g_free(room_title);
+}
 
 void eb_start_chat_room( gint service, gchar * name )
 {
@@ -588,15 +611,15 @@
                return;
 
        ecb = RUN_SERVICE(ela)->make_chat_room(name, ela);
-       ecb->service_id = service;
 
        if( ecb )
        {
+               ecb->service_id = service;
                chat_rooms = g_list_append(chat_rooms, ecb);
+               eb_chat_room_update_window_title(ecb, FALSE);
        }
 }
 
-
 void eb_chat_room_show_3rdperson( eb_chat_room * chat_room, gchar * message)
 {
        gtk_eb_html_add(EXT_GTK_TEXT(chat_room->conversation), message,0,0,0 );
@@ -631,7 +654,7 @@
                        chat_room->typing_fellows = 
g_list_remove(chat_room->typing_fellows,acc);
                        eb_chat_room_display_status (acc, NULL);
                }
-                       
+               eb_chat_room_update_window_title(chat_room, TRUE);      
                 
        }
        temp_message = eb_smilify(g_strdup(message), 
RUN_SERVICE(chat_room->chat_room_account)->get_smileys());
@@ -663,7 +686,7 @@
                else if (chat_room->receive_enabled)
                        play_sound(RECEIVE);
        }
-
+       
 }
 
 static void invite_button_callback( GtkWidget * widget, gpointer data )
@@ -759,10 +782,6 @@
                }
                #endif
 
-               gtk_signal_connect(GTK_OBJECT(chat_room->entry), 
"key_press_event",
-                                GTK_SIGNAL_FUNC(cr_key_press),
-                                chat_room);
-
                
gtk_container_add(GTK_CONTAINER(scrollwindow2),chat_room->entry);
                gtk_widget_show(scrollwindow2);
                gtk_box_pack_start(GTK_BOX(entry_box), scrollwindow2, TRUE, 
TRUE, 3);
@@ -774,8 +793,10 @@
                gtk_box_pack_start(GTK_BOX(entry_box), chat_room->entry, TRUE, 
TRUE, 3);
        }
        
+       gtk_signal_connect(GTK_OBJECT(chat_room->entry), "key_press_event",
+                        GTK_SIGNAL_FUNC(cr_key_press),
+                        chat_room);
        
-
        gtk_paned_add1(GTK_PANED(hbox), scrollwindow);
        gtk_widget_show(scrollwindow);
 
@@ -820,6 +841,8 @@
        eb_icon(chat_room->window->window);
        gtk_signal_connect(GTK_OBJECT(chat_room->window), "destroy",
                                           GTK_SIGNAL_FUNC(destroy), chat_room 
);
+       gtk_signal_connect(GTK_OBJECT(chat_room->window), "focus_in_event",
+                                          GTK_SIGNAL_FUNC(handle_focus), 
chat_room);
 
        
        /* start a toolbar here */





reply via email to

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