Mercurial > pidgin
comparison src/gtkconv.c @ 8105:42c7227d6e4d
[gaim-migrate @ 8805]
Patch from Nathan Fredrickson to fix some accessibility focus issues
with conversation windows. The text input does not force itself to
have focus all the time now, but typing normal text should still go
into the input box.
I organized key_press_cb in gtkconv.c so it's sane. I don't think
I lost any shortcuts, but it's possible.
Also from Nathan Fredrickson, gtkimhtml widgets marked as
non-editable no longer allow text to be pasted into themselves.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 15 Jan 2004 03:43:32 +0000 |
parents | 56b74730715f |
children | 70816fbc2541 |
comparison
equal
deleted
inserted
replaced
8104:a89cffefca93 | 8105:42c7227d6e4d |
---|---|
1247 | 1247 |
1248 return TRUE; | 1248 return TRUE; |
1249 } | 1249 } |
1250 | 1250 |
1251 static gboolean | 1251 static gboolean |
1252 entry_key_pressed_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) | 1252 entry_key_press_cb(GtkWidget *entry, GdkEventKey *event, gpointer data) |
1253 { | 1253 { |
1254 GaimConvWindow *win; | 1254 GaimConvWindow *win; |
1255 GaimConversation *conv; | 1255 GaimConversation *conv; |
1256 GaimGtkConversation *gtkconv; | 1256 GaimGtkConversation *gtkconv; |
1257 GaimGtkWindow *gtkwin; | 1257 GaimGtkWindow *gtkwin; |
1258 | 1258 int numconvs; |
1259 conv = (GaimConversation *)data; | 1259 int curconv; |
1260 gtkconv = GAIM_GTK_CONVERSATION(conv); | 1260 |
1261 win = gaim_conversation_get_window(conv); | 1261 conv = (GaimConversation *)data; |
1262 gtkwin = GAIM_GTK_WINDOW(win); | 1262 gtkconv = GAIM_GTK_CONVERSATION(conv); |
1263 | 1263 win = gaim_conversation_get_window(conv); |
1264 if (event->keyval == GDK_Page_Up) { | 1264 gtkwin = GAIM_GTK_WINDOW(win); |
1265 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1265 numconvs = gaim_conv_window_get_conversation_count(win); |
1266 | 1266 curconv = gaim_conversation_get_index(conv); |
1267 if (!(event->state & GDK_CONTROL_MASK)) | 1267 |
1268 gtk_imhtml_page_up(GTK_IMHTML(gtkconv->imhtml)); | 1268 /* If CTRL was held down... */ |
1269 } | 1269 if (event->state & GDK_CONTROL_MASK) { |
1270 else if (event->keyval == GDK_Page_Down) { | |
1271 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1272 | |
1273 if (!(event->state & GDK_CONTROL_MASK)) | |
1274 gtk_imhtml_page_down(GTK_IMHTML(gtkconv->imhtml)); | |
1275 } | |
1276 else if (event->keyval == GDK_F2) { | |
1277 | |
1278 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", | |
1279 !gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); | |
1280 } | |
1281 else if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) { | |
1282 if ((event->state & GDK_CONTROL_MASK) && | |
1283 gaim_prefs_get_bool("/gaim/gtk/conversations/ctrl_enter_sends")) { | |
1284 | |
1285 send_cb(NULL, conv); | |
1286 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1287 | |
1288 return TRUE; | |
1289 } | |
1290 else if (!(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) && | |
1291 gaim_prefs_get_bool("/gaim/gtk/conversations/enter_sends")) { | |
1292 | |
1293 send_cb(NULL, conv); | |
1294 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1295 | |
1296 return TRUE; | |
1297 } | |
1298 | |
1299 return FALSE; | |
1300 } | |
1301 else if ((event->state & GDK_CONTROL_MASK) && (event->keyval == 'm' || | |
1302 event->keyval == 'M')) { | |
1303 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1304 gtk_text_buffer_insert_at_cursor(gtkconv->entry_buffer, "\n", 1); | |
1305 } | |
1306 else if (event->state & GDK_CONTROL_MASK) { | |
1307 switch (event->keyval) { | 1270 switch (event->keyval) { |
1271 case GDK_Return: | |
1272 case GDK_KP_Enter: | |
1273 if (gaim_prefs_get_bool("/gaim/gtk/conversations/ctrl_enter_sends")) { | |
1274 send_cb(NULL, conv); | |
1275 | |
1276 return TRUE; | |
1277 } | |
1278 break; | |
1279 | |
1308 case GDK_Up: | 1280 case GDK_Up: |
1309 if (!conv->send_history) | 1281 if (!conv->send_history) |
1310 break; | 1282 break; |
1311 | 1283 |
1312 if (!conv->send_history->prev) { | 1284 if (!conv->send_history->prev) { |
1330 conv->send_history = conv->send_history->next; | 1302 conv->send_history = conv->send_history->next; |
1331 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); | 1303 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
1332 gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->entry), conv->send_history->data, 0, NULL); | 1304 gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->entry), conv->send_history->data, 0, NULL); |
1333 } | 1305 } |
1334 | 1306 |
1307 return TRUE; | |
1335 break; | 1308 break; |
1336 | 1309 |
1337 case GDK_Down: | 1310 case GDK_Down: |
1338 if (!conv->send_history) | 1311 if (!conv->send_history) |
1339 break; | 1312 break; |
1340 | 1313 |
1341 if (conv->send_history->prev) { | 1314 if (conv->send_history->prev && |
1315 conv->send_history->prev->data) { | |
1316 | |
1342 conv->send_history = conv->send_history->prev; | 1317 conv->send_history = conv->send_history->prev; |
1343 | 1318 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); |
1344 if (conv->send_history->data) { | 1319 gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->entry), conv->send_history->data, 0, NULL); |
1345 gtk_imhtml_clear(GTK_IMHTML(gtkconv->entry)); | |
1346 gtk_imhtml_append_text_with_images(GTK_IMHTML(gtkconv->entry), conv->send_history->data, 0, NULL); | |
1347 } | |
1348 } | 1320 } |
1349 | 1321 |
1322 return TRUE; | |
1350 break; | 1323 break; |
1351 } | 1324 |
1325 case GDK_Page_Up: | |
1326 if (curconv + 1 < numconvs) | |
1327 gaim_conv_window_switch_conversation(win, curconv + 1); | |
1328 | |
1329 return TRUE; | |
1330 break; | |
1331 | |
1332 case GDK_Page_Down: | |
1333 if (curconv > 0) | |
1334 gaim_conv_window_switch_conversation(win, curconv - 1); | |
1335 | |
1336 return TRUE; | |
1337 break; | |
1338 | |
1339 } /* End of switch */ | |
1352 | 1340 |
1353 if (gaim_prefs_get_bool("/gaim/gtk/conversations/html_shortcuts")) { | 1341 if (gaim_prefs_get_bool("/gaim/gtk/conversations/html_shortcuts")) { |
1354 switch (event->keyval) { | 1342 switch (event->keyval) { |
1355 case 'i': | 1343 case 'i': |
1356 case 'I': | 1344 case 'I': |
1357 set_toggle(gtkconv->toolbar.italic, | 1345 set_toggle(gtkconv->toolbar.italic, |
1358 !gtk_toggle_button_get_active( | 1346 !gtk_toggle_button_get_active( |
1359 GTK_TOGGLE_BUTTON(gtkconv->toolbar.italic))); | 1347 GTK_TOGGLE_BUTTON(gtkconv->toolbar.italic))); |
1360 | 1348 |
1361 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1349 return TRUE; |
1362 "key_press_event"); | |
1363 break; | 1350 break; |
1364 | 1351 |
1365 case 'u': /* ctrl-u is GDK_Clear, which clears the line. */ | 1352 case 'u': /* ctrl-u is GDK_Clear, which clears the line. */ |
1366 case 'U': | 1353 case 'U': |
1367 set_toggle(gtkconv->toolbar.underline, | 1354 set_toggle(gtkconv->toolbar.underline, |
1368 !gtk_toggle_button_get_active( | 1355 !gtk_toggle_button_get_active( |
1369 GTK_TOGGLE_BUTTON(gtkconv->toolbar.underline))); | 1356 GTK_TOGGLE_BUTTON(gtkconv->toolbar.underline))); |
1370 | 1357 |
1371 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1358 return TRUE; |
1372 "key_press_event"); | |
1373 break; | 1359 break; |
1374 | 1360 |
1375 case 'b': /* ctrl-b is GDK_Left, which moves backwards. */ | 1361 case 'b': /* ctrl-b is GDK_Left, which moves backwards. */ |
1376 case 'B': | 1362 case 'B': |
1377 set_toggle(gtkconv->toolbar.bold, | 1363 set_toggle(gtkconv->toolbar.bold, |
1378 !gtk_toggle_button_get_active( | 1364 !gtk_toggle_button_get_active( |
1379 GTK_TOGGLE_BUTTON(gtkconv->toolbar.bold))); | 1365 GTK_TOGGLE_BUTTON(gtkconv->toolbar.bold))); |
1380 | 1366 |
1381 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1367 return TRUE; |
1382 "key_press_event"); | |
1383 break; | 1368 break; |
1384 | 1369 |
1385 case '-': | 1370 case '-': |
1386 set_toggle(gtkconv->toolbar.smaller_size, | 1371 set_toggle(gtkconv->toolbar.smaller_size, |
1387 !gtk_toggle_button_get_active( | 1372 !gtk_toggle_button_get_active( |
1388 GTK_TOGGLE_BUTTON(gtkconv->toolbar.smaller_size))); | 1373 GTK_TOGGLE_BUTTON(gtkconv->toolbar.smaller_size))); |
1389 | 1374 |
1390 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1375 return TRUE; |
1391 "key_press_event"); | |
1392 break; | 1376 break; |
1393 | 1377 |
1394 case '=': | 1378 case '=': |
1395 case '+': | 1379 case '+': |
1396 set_toggle(gtkconv->toolbar.larger_size, | 1380 set_toggle(gtkconv->toolbar.larger_size, |
1397 !gtk_toggle_button_get_active( | 1381 !gtk_toggle_button_get_active( |
1398 GTK_TOGGLE_BUTTON(gtkconv->toolbar.larger_size))); | 1382 GTK_TOGGLE_BUTTON(gtkconv->toolbar.larger_size))); |
1399 | 1383 |
1400 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1384 return TRUE; |
1401 "key_press_event"); | |
1402 break; | 1385 break; |
1403 | 1386 |
1387 #if 0 | |
1404 case '0': | 1388 case '0': |
1405 /*set_toggle(gtkconv->toolbar.normal_size, | 1389 set_toggle(gtkconv->toolbar.normal_size, |
1406 !gtk_toggle_button_get_active( | 1390 !gtk_toggle_button_get_active( |
1407 GTK_TOGGLE_BUTTON(gtkconv->toolbar.normal_size))); | 1391 GTK_TOGGLE_BUTTON(gtkconv->toolbar.normal_size))); |
1408 | 1392 |
1409 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1393 return TRUE; |
1410 "key_press_event"); */ | |
1411 break; | 1394 break; |
1395 #endif | |
1412 | 1396 |
1413 case 'f': | 1397 case 'f': |
1414 case 'F': | 1398 case 'F': |
1415 set_toggle(gtkconv->toolbar.font, | 1399 set_toggle(gtkconv->toolbar.font, |
1416 !gtk_toggle_button_get_active( | 1400 !gtk_toggle_button_get_active( |
1417 GTK_TOGGLE_BUTTON(gtkconv->toolbar.font))); | 1401 GTK_TOGGLE_BUTTON(gtkconv->toolbar.font))); |
1418 | 1402 |
1419 g_signal_stop_emission_by_name(G_OBJECT(entry), | 1403 return TRUE; |
1420 "key_press_event"); | |
1421 break; | 1404 break; |
1422 } | 1405 } |
1423 } | 1406 } /* End of switch */ |
1424 | 1407 |
1425 if (gaim_prefs_get_bool("/gaim/gtk/conversations/smiley_shortcuts")) { | 1408 if (gaim_prefs_get_bool("/gaim/gtk/conversations/smiley_shortcuts")) { |
1426 char buf[7]; | 1409 char buf[7]; |
1427 | 1410 |
1428 *buf = '\0'; | 1411 *buf = '\0'; |
1442 case '$': strcpy(buf, "O:-)"); break; | 1425 case '$': strcpy(buf, "O:-)"); break; |
1443 case '%': strcpy(buf, ":-/"); break; | 1426 case '%': strcpy(buf, ":-/"); break; |
1444 case '^': strcpy(buf, ":'("); break; | 1427 case '^': strcpy(buf, ":'("); break; |
1445 case '&': strcpy(buf, ":-X"); break; | 1428 case '&': strcpy(buf, ":-X"); break; |
1446 case '*': strcpy(buf, ":-D"); break; | 1429 case '*': strcpy(buf, ":-D"); break; |
1447 default: break; | |
1448 } | 1430 } |
1449 | 1431 |
1450 if (*buf) { | 1432 if (*buf) { |
1451 gtk_imhtml_insert_smiley(GTK_IMHTML(gtkconv->entry), conv->account->protocol_id, buf); | 1433 gtk_imhtml_insert_smiley(GTK_IMHTML(gtkconv->entry), conv->account->protocol_id, buf); |
1452 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1434 return TRUE; |
1453 } | 1435 } |
1454 } | 1436 } |
1455 | 1437 |
1456 if (event->keyval == 'l') { | 1438 if (event->keyval == 'l') { |
1457 gtk_imhtml_clear(GTK_IMHTML(gtkconv->imhtml)); | 1439 gtk_imhtml_clear(GTK_IMHTML(gtkconv->imhtml)); |
1458 g_string_free(conv->history, TRUE); | 1440 g_string_free(conv->history, TRUE); |
1459 conv->history = g_string_new(""); | 1441 conv->history = g_string_new(""); |
1442 | |
1443 return TRUE; | |
1460 } | 1444 } |
1461 else if (event->keyval == 'z') { | 1445 else if (event->keyval == 'z') { |
1462 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1463 | |
1464 gtk_window_iconify(GTK_WINDOW(gtkwin->window)); | 1446 gtk_window_iconify(GTK_WINDOW(gtkwin->window)); |
1447 | |
1448 return TRUE; | |
1465 } | 1449 } |
1466 else if (event->keyval == '[') { | 1450 else if (event->keyval == '[') { |
1467 gaim_conv_window_switch_conversation(win, | 1451 gaim_conv_window_switch_conversation(win, |
1468 gaim_conversation_get_index(conv) - 1); | 1452 gaim_conversation_get_index(conv) - 1); |
1469 | 1453 |
1470 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1454 return TRUE; |
1471 } | 1455 } |
1472 else if (event->keyval == ']') { | 1456 else if (event->keyval == ']') { |
1473 gaim_conv_window_switch_conversation(win, | 1457 gaim_conv_window_switch_conversation(win, |
1474 gaim_conversation_get_index(conv) + 1); | 1458 gaim_conversation_get_index(conv) + 1); |
1475 | 1459 |
1476 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1460 return TRUE; |
1477 } | 1461 } |
1478 else if (event->keyval == GDK_Tab) { | 1462 else if (event->keyval == GDK_Tab) { |
1479 move_next_tab(conv); | 1463 move_next_tab(conv); |
1480 | 1464 |
1481 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | |
1482 | |
1483 return TRUE; | 1465 return TRUE; |
1484 } | 1466 } |
1485 } | 1467 |
1486 else if (event->keyval == GDK_Tab && | 1468 return FALSE; |
1487 gaim_conversation_get_type(conv) == GAIM_CONV_CHAT && | 1469 } |
1488 gaim_prefs_get_bool("/gaim/gtk/conversations/chat/tab_completion")) { | 1470 |
1489 | 1471 /* If ALT (or whatever) was held down... */ |
1490 tab_complete(conv); | 1472 if (event->state & GDK_MOD1_MASK) { |
1491 | 1473 /* XXX - Make sure the conv exists befeore switching to it */ |
1492 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1474 if (event->keyval > '0' && event->keyval <= '9') { |
1493 | 1475 int switchto = event->keyval - '1'; |
1494 return TRUE; | 1476 if (switchto < numconvs) |
1495 } | 1477 gaim_conv_window_switch_conversation(win, switchto); |
1496 else if ((event->state & GDK_MOD1_MASK) && | 1478 |
1497 event->keyval > '0' && event->keyval <= '9') { | 1479 return TRUE; |
1498 | 1480 } |
1499 gaim_conv_window_switch_conversation(win, event->keyval - '1'); | 1481 |
1500 | 1482 return FALSE; |
1501 g_signal_stop_emission_by_name(G_OBJECT(entry), "key_press_event"); | 1483 } |
1502 } | 1484 |
1485 /* If neither CTRL nor ALT were held down... */ | |
1486 switch (event->keyval) { | |
1487 case GDK_Return: | |
1488 case GDK_KP_Enter: | |
1489 if (!(event->state & (GDK_SHIFT_MASK | GDK_CONTROL_MASK)) && | |
1490 gaim_prefs_get_bool("/gaim/gtk/conversations/enter_sends")) { | |
1491 | |
1492 send_cb(NULL, conv); | |
1493 return TRUE; | |
1494 } | |
1495 break; | |
1496 | |
1497 case GDK_Tab: | |
1498 if (gaim_conversation_get_type(conv) == GAIM_CONV_CHAT && | |
1499 gaim_prefs_get_bool("/gaim/gtk/conversations/chat/tab_completion")) { | |
1500 | |
1501 tab_complete(conv); | |
1502 return TRUE; | |
1503 } | |
1504 break; | |
1505 | |
1506 case GDK_Page_Up: | |
1507 gtk_imhtml_page_up(GTK_IMHTML(gtkconv->imhtml)); | |
1508 return TRUE; | |
1509 break; | |
1510 | |
1511 case GDK_Page_Down: | |
1512 gtk_imhtml_page_down(GTK_IMHTML(gtkconv->imhtml)); | |
1513 return TRUE; | |
1514 break; | |
1515 | |
1516 case GDK_F2: | |
1517 gaim_prefs_set_bool("/gaim/gtk/conversations/show_timestamps", | |
1518 !gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); | |
1519 return TRUE; | |
1520 break; | |
1521 | |
1522 } /* End of switch */ | |
1503 | 1523 |
1504 return FALSE; | 1524 return FALSE; |
1505 } | 1525 } |
1506 | 1526 |
1507 /* | 1527 /* |
1524 | 1544 |
1525 return FALSE; | 1545 return FALSE; |
1526 } | 1546 } |
1527 | 1547 |
1528 static gboolean | 1548 static gboolean |
1529 refocus_entry_cb(GtkWidget *widget, GdkEventButton *event, gpointer data) | 1549 refocus_entry_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
1530 { | 1550 { |
1531 GaimGtkConversation *gtkconv = data; | 1551 GaimGtkConversation *gtkconv = data; |
1532 | 1552 |
1533 gtk_widget_grab_focus(gtkconv->entry); | 1553 if (!(event->state & GDK_CONTROL_MASK)) { |
1554 gtk_widget_grab_focus(gtkconv->entry); | |
1555 gtk_widget_event(gtkconv->entry, (GdkEvent *)event); | |
1556 | |
1557 return TRUE; | |
1558 } | |
1534 | 1559 |
1535 return FALSE; | 1560 return FALSE; |
1536 } | 1561 } |
1537 | 1562 |
1538 static void | 1563 static void |
3587 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), | 3612 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
3588 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); | 3613 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); |
3589 | 3614 |
3590 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", | 3615 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", |
3591 G_CALLBACK(entry_stop_rclick_cb), NULL); | 3616 G_CALLBACK(entry_stop_rclick_cb), NULL); |
3592 g_signal_connect(G_OBJECT(gtkconv->imhtml), "button_release_event", | 3617 g_signal_connect(G_OBJECT(gtkconv->imhtml), "key_press_event", |
3593 G_CALLBACK(refocus_entry_cb), gtkconv); | 3618 G_CALLBACK(refocus_entry_cb), gtkconv); |
3594 | 3619 |
3595 gaim_setup_imhtml(gtkconv->imhtml); | 3620 gaim_setup_imhtml(gtkconv->imhtml); |
3596 | 3621 |
3597 gtk_widget_show(gtkconv->imhtml); | 3622 gtk_widget_show(gtkconv->imhtml); |
3714 MAX(gaim_prefs_get_int("/gaim/gtk/conversations/chat/entry_height"), | 3739 MAX(gaim_prefs_get_int("/gaim/gtk/conversations/chat/entry_height"), |
3715 25)); | 3740 25)); |
3716 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", conv); | 3741 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", conv); |
3717 | 3742 |
3718 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", | 3743 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", |
3719 G_CALLBACK(entry_key_pressed_cb), conv); | 3744 G_CALLBACK(entry_key_press_cb), conv); |
3720 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event", | 3745 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event", |
3721 G_CALLBACK(entry_stop_rclick_cb), NULL); | 3746 G_CALLBACK(entry_stop_rclick_cb), NULL); |
3722 | 3747 |
3723 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck")) | 3748 if (gaim_prefs_get_bool("/gaim/gtk/conversations/spellcheck")) |
3724 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry)); | 3749 gaim_gtk_setup_gtkspell(GTK_TEXT_VIEW(gtkconv->entry)); |
3774 gtkconv->imhtml = gtk_imhtml_new(NULL, NULL); | 3799 gtkconv->imhtml = gtk_imhtml_new(NULL, NULL); |
3775 gtk_container_add(GTK_CONTAINER(gtkconv->sw), gtkconv->imhtml); | 3800 gtk_container_add(GTK_CONTAINER(gtkconv->sw), gtkconv->imhtml); |
3776 | 3801 |
3777 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", | 3802 g_signal_connect_after(G_OBJECT(gtkconv->imhtml), "button_press_event", |
3778 G_CALLBACK(entry_stop_rclick_cb), NULL); | 3803 G_CALLBACK(entry_stop_rclick_cb), NULL); |
3779 g_signal_connect(G_OBJECT(gtkconv->imhtml), "button_release_event", | 3804 g_signal_connect(G_OBJECT(gtkconv->imhtml), "key_press_event", |
3780 G_CALLBACK(refocus_entry_cb), gtkconv); | 3805 G_CALLBACK(refocus_entry_cb), gtkconv); |
3781 | 3806 |
3782 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), | 3807 gtk_imhtml_show_comments(GTK_IMHTML(gtkconv->imhtml), |
3783 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); | 3808 gaim_prefs_get_bool("/gaim/gtk/conversations/show_timestamps")); |
3784 | 3809 |
3813 MAX(gaim_prefs_get_int("/gaim/gtk/conversations/im/entry_height"), | 3838 MAX(gaim_prefs_get_int("/gaim/gtk/conversations/im/entry_height"), |
3814 25)); | 3839 25)); |
3815 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", conv); | 3840 g_object_set_data(G_OBJECT(gtkconv->entry_buffer), "user_data", conv); |
3816 | 3841 |
3817 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", | 3842 g_signal_connect(G_OBJECT(gtkconv->entry), "key_press_event", |
3818 G_CALLBACK(entry_key_pressed_cb), conv); | 3843 G_CALLBACK(entry_key_press_cb), conv); |
3819 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event", | 3844 g_signal_connect_after(G_OBJECT(gtkconv->entry), "button_press_event", |
3820 G_CALLBACK(entry_stop_rclick_cb), NULL); | 3845 G_CALLBACK(entry_stop_rclick_cb), NULL); |
3821 | 3846 |
3822 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text", | 3847 g_signal_connect(G_OBJECT(gtkconv->entry_buffer), "insert_text", |
3823 G_CALLBACK(insert_text_cb), conv); | 3848 G_CALLBACK(insert_text_cb), conv); |
4179 | 4204 |
4180 g_signal_connect(G_OBJECT(pane), "drag_data_received", | 4205 g_signal_connect(G_OBJECT(pane), "drag_data_received", |
4181 G_CALLBACK(conv_dnd_recv), conv); | 4206 G_CALLBACK(conv_dnd_recv), conv); |
4182 g_signal_connect(G_OBJECT(gtkconv->imhtml), "drag_data_received", | 4207 g_signal_connect(G_OBJECT(gtkconv->imhtml), "drag_data_received", |
4183 G_CALLBACK(conv_dnd_recv), conv); | 4208 G_CALLBACK(conv_dnd_recv), conv); |
4184 /* g_signal_connect(G_OBJECT(gtkconv->entry), "drag_data_received", | 4209 #if 0 |
4185 G_CALLBACK(conv_dnd_recv), conv);*/ | 4210 g_signal_connect(G_OBJECT(gtkconv->entry), "drag_data_received", |
4211 G_CALLBACK(conv_dnd_recv), conv); | |
4212 #endif | |
4186 | 4213 |
4187 /* Setup the container for the tab. */ | 4214 /* Setup the container for the tab. */ |
4188 gtkconv->tab_cont = tab_cont = gtk_vbox_new(FALSE, 5); | 4215 gtkconv->tab_cont = tab_cont = gtk_vbox_new(FALSE, 5); |
4189 gtk_container_set_border_width(GTK_CONTAINER(tab_cont), 5); | 4216 gtk_container_set_border_width(GTK_CONTAINER(tab_cont), 5); |
4190 gtk_container_add(GTK_CONTAINER(tab_cont), pane); | 4217 gtk_container_add(GTK_CONTAINER(tab_cont), pane); |