[GnomeMeeting-devel-list] [PATCH] text chat autoclear
- From: PUYDT Julien <julien puydt laposte net>
- To: GnomeMeeting Devel Liste <gnomemeeting-devel-list gnome org>
- Subject: [GnomeMeeting-devel-list] [PATCH] text chat autoclear
- Date: Mon, 12 Apr 2004 21:07:44 +0200
Hi,
the autoclear feature of the text chat was handled in src/endpoint.cpp ;
this patch basically moves it to src/chat_window.cpp.
Snark
diff -ur gnomemeeting-cvs-20040412.CVS/src/chat_window.cpp gnomemeeting-cvs-20040412.CVS.patched/src/chat_window.cpp
--- gnomemeeting-cvs-20040412.CVS/src/chat_window.cpp 2004-04-07 11:37:44.000000000 +0200
+++ gnomemeeting-cvs-20040412.CVS.patched/src/chat_window.cpp 2004-04-12 20:50:39.000000000 +0200
@@ -46,6 +46,7 @@
#include "callbacks.h"
#include "misc.h"
+#include "gm_conf.h"
#include "gtk-text-tag-addon.h"
#include "gtk-text-buffer-addon.h"
#include "gtk-text-view-addon.h"
@@ -260,32 +261,40 @@
GtkTextIter iter;
GmTextChat *chat = NULL;
gchar *text = NULL;
+ gboolean auto_clear = FALSE;
g_return_if_fail (chat_window != NULL);
- // find the time at which the event occured
- time_t *timeptr;
- char *time_str;
-
- time_str = (char *) malloc (21);
- timeptr = new (time_t);
-
- time (timeptr);
- strftime(time_str, 20, "%H:%M:%S", localtime (timeptr));
-
- // prepare the message to be displayed
- text = g_strdup_printf ("---- Call ends at %s\n", time_str);
+ auto_clear = gm_conf_get_bool (USER_INTERFACE_KEY "auto_clear_text_chat");
- // displays the message
- chat = (GmTextChat *)g_object_get_data (G_OBJECT (chat_window), "GMObject");
- gtk_text_buffer_get_end_iter (chat->text_buffer, &iter);
-
- if (chat->something_typed == TRUE)
- gtk_text_buffer_insert(chat->text_buffer, &iter, text, -1);
+ if (auto_clear)
+ gnomemeeting_text_chat_clear (chat_window);
+ else {
+ // find the time at which the event occured
+ time_t *timeptr;
+ char *time_str;
+
+ time_str = (char *) malloc (21);
+ timeptr = new (time_t);
+
+ time (timeptr);
+ strftime(time_str, 20, "%H:%M:%S", localtime (timeptr));
+
+ // prepare the message to be displayed
+ text = g_strdup_printf ("---- Call ends at %s\n", time_str);
+
+ // displays the message
+ chat = (GmTextChat *)g_object_get_data (G_OBJECT (chat_window),
+ "GMObject");
+ gtk_text_buffer_get_end_iter (chat->text_buffer, &iter);
+
+ if (chat->something_typed == TRUE)
+ gtk_text_buffer_insert(chat->text_buffer, &iter, text, -1);
- // freeing what we need to
- free (time_str);
- g_free (text);
+ // freeing what we need to
+ free (time_str);
+ g_free (text);
+ }
}
void
diff -ur gnomemeeting-cvs-20040412.CVS/src/endpoint.cpp gnomemeeting-cvs-20040412.CVS.patched/src/endpoint.cpp
--- gnomemeeting-cvs-20040412.CVS/src/endpoint.cpp 2004-04-12 15:04:45.000000000 +0200
+++ gnomemeeting-cvs-20040412.CVS.patched/src/endpoint.cpp 2004-04-12 20:44:31.000000000 +0200
@@ -1115,7 +1115,6 @@
PTimeInterval t;
- BOOL auto_clear_text_chat = FALSE;
BOOL reg = FALSE;
BOOL stay_on_top = FALSE;
BOOL not_current = FALSE;
@@ -1137,8 +1136,6 @@
/* Get config settings */
gnomemeeting_threads_enter ();
- auto_clear_text_chat =
- gm_conf_get_bool (USER_INTERFACE_KEY "auto_clear_text_chat");
reg = gm_conf_get_bool (LDAP_KEY "enable_registering");
stay_on_top = gm_conf_get_bool (VIDEO_DISPLAY_KEY "stay_on_top");
icm = (IncomingCallMode)
@@ -1335,12 +1332,6 @@
gtk_widget_queue_draw_area (gw->stats_drawing_area, 0, 0, GTK_WIDGET (gw->stats_drawing_area)->allocation.width, GTK_WIDGET (gw->stats_drawing_area)->allocation.height);
gtk_label_set_text (GTK_LABEL (gw->stats_label), _("Lost packets:\nLate packets:\nRound-trip delay:\nJitter buffer:"));
-
- /* We empty the text chat buffer */
- if (auto_clear_text_chat)
- gnomemeeting_text_chat_clear (GnomeMeeting::Process ()->GetMainWindow ()->chat_window);
-
-
/* set-on-top to False */
if (stay_on_top) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]