Mercurial > pidgin
comparison libpurple/protocols/qq/qq.c @ 18807:b9a0b1bd321b
Improve a bunch of strings in QQ
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Mon, 06 Aug 2007 00:14:47 +0000 |
parents | c2466041c77b |
children | f15bdcc44fc1 |
comparison
equal
deleted
inserted
replaced
18803:abb9aac69507 | 18807:b9a0b1bd321b |
---|---|
193 /* a floating text when mouse is on the icon, show connection status here */ | 193 /* a floating text when mouse is on the icon, show connection status here */ |
194 static void _qq_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) | 194 static void _qq_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) |
195 { | 195 { |
196 qq_buddy *q_bud; | 196 qq_buddy *q_bud; |
197 gchar *ip_str; | 197 gchar *ip_str; |
198 char *tmp, *tmp2; | 198 const char *tmp; |
199 char *tmp2; | |
199 | 200 |
200 g_return_if_fail(b != NULL); | 201 g_return_if_fail(b != NULL); |
201 | 202 |
202 q_bud = (qq_buddy *) b->proto_data; | 203 q_bud = (qq_buddy *) b->proto_data; |
203 g_return_if_fail(q_bud != NULL); | 204 g_return_if_fail(q_bud != NULL); |
204 | 205 |
205 if (PURPLE_BUDDY_IS_ONLINE(b) && q_bud != NULL) | 206 if (PURPLE_BUDDY_IS_ONLINE(b) && q_bud != NULL) |
206 { | 207 { |
207 ip_str = gen_ip_str(q_bud->ip); | 208 ip_str = gen_ip_str(q_bud->ip); |
208 if (strlen(ip_str) != 0) { | 209 if (strlen(ip_str) != 0) { |
209 tmp = g_strdup_printf(_("%s Address"), | 210 if (q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) |
210 ((q_bud->comm_flag & QQ_COMM_FLAG_TCP_MODE) ? "TCP" : "UDP")); | 211 tmp = _("TCP Address"); |
212 else | |
213 tmp = _("UDP Address"); | |
211 tmp2 = g_strdup_printf("%s:%d", ip_str, q_bud->port); | 214 tmp2 = g_strdup_printf("%s:%d", ip_str, q_bud->port); |
212 purple_notify_user_info_add_pair(user_info, tmp, tmp2); | 215 purple_notify_user_info_add_pair(user_info, tmp, tmp2); |
213 g_free(tmp2); | 216 g_free(tmp2); |
214 g_free(tmp); | |
215 } | 217 } |
216 g_free(ip_str); | 218 g_free(ip_str); |
217 | 219 |
218 tmp = g_strdup_printf("%d", q_bud->age); | 220 tmp = g_strdup_printf("%d", q_bud->age); |
219 purple_notify_user_info_add_pair(user_info, _("Age"), tmp); | 221 purple_notify_user_info_add_pair(user_info, _("Age"), tmp); |
236 } | 238 } |
237 | 239 |
238 if (q_bud->level) { | 240 if (q_bud->level) { |
239 tmp = g_strdup_printf("%d", q_bud->level); | 241 tmp = g_strdup_printf("%d", q_bud->level); |
240 purple_notify_user_info_add_pair(user_info, _("Level"), tmp); | 242 purple_notify_user_info_add_pair(user_info, _("Level"), tmp); |
241 g_free(tmp); | 243 g_free(tmp); |
242 } | 244 } |
243 /* For debugging */ | 245 /* For debugging */ |
244 /* | 246 /* |
245 g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); | 247 g_string_append_printf(tooltip, "\n<b>Flag:</b> %01x", q_bud->flag1); |
246 g_string_append_printf(tooltip, "\n<b>CommFlag:</b> %01x", q_bud->comm_flag); | 248 g_string_append_printf(tooltip, "\n<b>CommFlag:</b> %01x", q_bud->comm_flag); |
273 { | 275 { |
274 PurpleStatusType *status; | 276 PurpleStatusType *status; |
275 GList *types = NULL; | 277 GList *types = NULL; |
276 | 278 |
277 status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, | 279 status = purple_status_type_new_full(PURPLE_STATUS_AVAILABLE, |
278 "available", _("QQ: Available"), FALSE, TRUE, FALSE); | 280 "available", _("Available"), FALSE, TRUE, FALSE); |
279 types = g_list_append(types, status); | 281 types = g_list_append(types, status); |
280 | 282 |
281 status = purple_status_type_new_full(PURPLE_STATUS_AWAY, | 283 status = purple_status_type_new_full(PURPLE_STATUS_AWAY, |
282 "away", _("QQ: Away"), FALSE, TRUE, FALSE); | 284 "away", _("Away"), FALSE, TRUE, FALSE); |
283 types = g_list_append(types, status); | 285 types = g_list_append(types, status); |
284 | 286 |
285 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, | 287 status = purple_status_type_new_full(PURPLE_STATUS_INVISIBLE, |
286 "invisible", _("QQ: Invisible"), FALSE, TRUE, FALSE); | 288 "invisible", _("Invisible"), FALSE, TRUE, FALSE); |
287 types = g_list_append(types, status); | 289 types = g_list_append(types, status); |
288 | 290 |
289 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, | 291 status = purple_status_type_new_full(PURPLE_STATUS_OFFLINE, |
290 "offline", _("QQ: Offline"), FALSE, TRUE, FALSE); | 292 "offline", _("Offline"), FALSE, TRUE, FALSE); |
291 types = g_list_append(types, status); | 293 types = g_list_append(types, status); |
292 | 294 |
293 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE, | 295 status = purple_status_type_new_full(PURPLE_STATUS_MOBILE, |
294 "mobile", NULL, FALSE, FALSE, TRUE); | 296 "mobile", NULL, FALSE, FALSE, TRUE); |
295 types = g_list_append(types, status); | 297 types = g_list_append(types, status); |
414 g = g_new0(gc_and_uid, 1); | 416 g = g_new0(gc_and_uid, 1); |
415 g->gc = gc; | 417 g->gc = gc; |
416 g->uid = uid; | 418 g->uid = uid; |
417 | 419 |
418 purple_request_action(gc, _("Block Buddy"), | 420 purple_request_action(gc, _("Block Buddy"), |
419 _("Are you sure to block this buddy?"), NULL, | 421 _("Are you sure you want to block this buddy?"), NULL, |
420 1, g, 2, | 422 1, g, 2, |
421 _("Cancel"), | 423 _("Cancel"), |
422 G_CALLBACK(qq_do_nothing_with_gc_and_uid), | 424 G_CALLBACK(qq_do_nothing_with_gc_and_uid), |
423 _("Block"), G_CALLBACK(qq_block_buddy_with_gc_and_uid)); | 425 _("Block"), G_CALLBACK(qq_block_buddy_with_gc_and_uid)); |
424 } | 426 } |
468 static void _qq_menu_create_permanent_group(PurplePluginAction * action) | 470 static void _qq_menu_create_permanent_group(PurplePluginAction * action) |
469 { | 471 { |
470 PurpleConnection *gc = (PurpleConnection *) action->context; | 472 PurpleConnection *gc = (PurpleConnection *) action->context; |
471 purple_request_input(gc, _("Create QQ Qun"), | 473 purple_request_input(gc, _("Create QQ Qun"), |
472 _("Input Qun name here"), | 474 _("Input Qun name here"), |
473 _("Only QQ member can create permanent Qun"), | 475 _("Only QQ members can create permanent Qun"), |
474 "OpenQ", FALSE, FALSE, NULL, | 476 "OpenQ", FALSE, FALSE, NULL, |
475 _("Create"), G_CALLBACK(qq_group_create_with_name), _("Cancel"), NULL, gc); | 477 _("Create"), G_CALLBACK(qq_group_create_with_name), _("Cancel"), NULL, gc); |
476 } | 478 } |
477 */ | 479 */ |
478 | 480 |
526 { | 528 { |
527 GList *m; | 529 GList *m; |
528 PurplePluginAction *act; | 530 PurplePluginAction *act; |
529 | 531 |
530 m = NULL; | 532 m = NULL; |
531 act = purple_plugin_action_new(_("Modify My Information"), _qq_menu_modify_my_info); | 533 act = purple_plugin_action_new(_("Set My Information"), _qq_menu_modify_my_info); |
532 m = g_list_append(m, act); | 534 m = g_list_append(m, act); |
533 | 535 |
534 act = purple_plugin_action_new(_("Change Password"), _qq_menu_change_password); | 536 act = purple_plugin_action_new(_("Change Password"), _qq_menu_change_password); |
535 m = g_list_append(m, act); | 537 m = g_list_append(m, act); |
536 | 538 |
553 { | 555 { |
554 GList *m; | 556 GList *m; |
555 PurpleMenuAction *act; | 557 PurpleMenuAction *act; |
556 | 558 |
557 m = NULL; | 559 m = NULL; |
558 act = purple_menu_action_new(_("Exit this QQ Qun"), PURPLE_CALLBACK(_qq_menu_unsubscribe_group), NULL, NULL); | 560 act = purple_menu_action_new(_("Leave this QQ Qun"), PURPLE_CALLBACK(_qq_menu_unsubscribe_group), NULL, NULL); |
559 m = g_list_append(m, act); | 561 m = g_list_append(m, act); |
560 | 562 |
561 /* TODO: enable this | 563 /* TODO: enable this |
562 act = purple_menu_action_new(_("Show Details"), PURPLE_CALLBACK(_qq_menu_manage_group), NULL, NULL); | 564 act = purple_menu_action_new(_("Show Details"), PURPLE_CALLBACK(_qq_menu_manage_group), NULL, NULL); |
563 m = g_list_append(m, act); | 565 m = g_list_append(m, act); |