[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.45,1.46
From: |
Colin Leroy <address@hidden> |
Subject: |
[Ayttm-commits] CVS: ayttm/src chat_room.c,1.45,1.46 |
Date: |
Thu, 06 Feb 2003 09:23:38 -0500 |
Update of /cvsroot/ayttm/ayttm/src
In directory subversions:/tmp/cvs-serv27137/src
Modified Files:
chat_room.c
Log Message:
make people clickable in the clist
Index: chat_room.c
===================================================================
RCS file: /cvsroot/ayttm/ayttm/src/chat_room.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -u -r1.45 -r1.46
--- chat_room.c 6 Feb 2003 09:15:37 -0000 1.45
+++ chat_room.c 6 Feb 2003 14:23:32 -0000 1.46
@@ -48,6 +48,50 @@
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 char *last_clicked_fellow = NULL;
+static guint32 last_time_clicked = 0;
+
+static void handle_fellow_click (char *name, eb_local_account *ela)
+{
+ eb_account *ea = NULL;
+
+ if (find_account_by_handle(name, ela->service_id)) {
+ ea = find_account_by_handle(name, ela->service_id);
+ } else {
+ ea = RUN_SERVICE(ela)->new_account(name);
+ add_unknown_account_window_new(ea);
+ }
+ eb_chat_window_display_account(ea);
+}
+
+static void fellows_click( GtkWidget * widget, int row, int column,
+ GdkEventButton *evt, gpointer data )
+{
+ eb_chat_room * ecr = (eb_chat_room *)data;
+ char *name = NULL;
+ gtk_clist_unselect_all(GTK_CLIST(ecr->fellows_widget));
+ if (gtk_clist_get_text(GTK_CLIST(ecr->fellows_widget), row, column,
&name)) {
+ if (last_clicked_fellow) {
+ if (evt->time - last_time_clicked < 2000
+ && !strcmp(last_clicked_fellow, name)) {
+ /* double-click ! */
+ handle_fellow_click(name, ecr->local_user);
+ free(last_clicked_fellow);
+ last_clicked_fellow = NULL;
+ return;
+ }
+ free(last_clicked_fellow);
+ }
+ last_clicked_fellow = strdup(name);
+ last_time_clicked = evt->time;
+ } else {
+ if (last_clicked_fellow) {
+ free(last_clicked_fellow);
+ }
+ last_clicked_fellow = NULL;
+ }
+}
+
static void send_cr_message( GtkWidget * widget, gpointer data )
{
eb_chat_room * ecr = (eb_chat_room *)data;
@@ -775,6 +819,8 @@
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwindow),
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
+ gtk_signal_connect(GTK_OBJECT(chat_room->fellows_widget), "select_row",
+ GTK_SIGNAL_FUNC(fellows_click),
chat_room );
/*make ourselves something to type into*/
entry_box = gtk_vbox_new(FALSE,0);
if ( iGetLocalPref("do_multi_line") ) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ayttm-commits] CVS: ayttm/src chat_room.c,1.45,1.46,
Colin Leroy <address@hidden> <=
- Prev by Date:
[Ayttm-commits] CVS: ayttm/src contact_util.c,1.1,1.2
- Next by Date:
[Ayttm-commits] CVS: ayttm ChangeLog,1.280,1.281 configure.in,1.276,1.277
- Previous by thread:
[Ayttm-commits] CVS: ayttm/src contact_util.c,1.1,1.2
- Next by thread:
[Ayttm-commits] CVS: ayttm ChangeLog,1.280,1.281 configure.in,1.276,1.277
- Index(es):