comparison libpurple/protocols/silc10/buddy.c @ 20598:285bb637a2b7

Updated hinting to be less invasive
author Gabriel Schulhof <nix@go-nix.ca>
date Sat, 22 Sep 2007 16:19:34 +0000
parents 16bdcffb1c62
children 8c9aad9479c0
comparison
equal deleted inserted replaced
20597:591267f6f1d5 20598:285bb637a2b7
307 a->client_id = *client_entry->id; 307 a->client_id = *client_entry->id;
308 if (hostname) 308 if (hostname)
309 a->hostname = strdup(hostname); 309 a->hostname = strdup(hostname);
310 a->port = port; 310 a->port = port;
311 311
312 purple_request_action(client->application, _("Key Agreement Request"), tmp, 312 purple_request_action_with_hint(client->application, _("Key Agreement Request"), tmp,
313 hostname ? tmp2 : NULL, 1, gc->account, client_entry->nickname, 313 hostname ? tmp2 : NULL, 1, gc->account, client_entry->nickname,
314 NULL, a, 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb), 314 NULL, a, "blist", 2, _("Yes"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb),
315 _("No"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb)); 315 _("No"), G_CALLBACK(silcpurple_buddy_keyagr_request_cb));
316 } 316 }
317 317
318 static void 318 static void
319 silcpurple_buddy_keyagr(PurpleBlistNode *node, gpointer data) 319 silcpurple_buddy_keyagr(PurpleBlistNode *node, gpointer data)
460 if (!p) 460 if (!p)
461 return; 461 return;
462 p->client = sg->client; 462 p->client = sg->client;
463 p->conn = sg->conn; 463 p->conn = sg->conn;
464 p->client_id = *clients[0]->id; 464 p->client_id = *clients[0]->id;
465 purple_request_input(gc, _("IM With Password"), NULL, 465 purple_request_input_with_hint(gc, _("IM With Password"), NULL,
466 _("Set IM Password"), NULL, FALSE, TRUE, NULL, 466 _("Set IM Password"), NULL, FALSE, TRUE, NULL,
467 _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb), 467 _("OK"), G_CALLBACK(silcpurple_buddy_privkey_cb),
468 _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb), 468 _("Cancel"), G_CALLBACK(silcpurple_buddy_privkey_cb),
469 gc->account, NULL, NULL, p); 469 gc->account, NULL, NULL, "blist", p);
470 470
471 silc_free(clients); 471 silc_free(clients);
472 silc_free(nickname); 472 silc_free(nickname);
473 } 473 }
474 474
1062 silc_free(r); 1062 silc_free(r);
1063 return; 1063 return;
1064 } 1064 }
1065 1065
1066 /* Open file selector to select the public key. */ 1066 /* Open file selector to select the public key. */
1067 purple_request_file(r->client->application, _("Open..."), NULL, FALSE, 1067 purple_request_file_with_hint(r->client->application, _("Open..."), NULL, FALSE,
1068 G_CALLBACK(silcpurple_add_buddy_ask_import), 1068 G_CALLBACK(silcpurple_add_buddy_ask_import),
1069 G_CALLBACK(silcpurple_add_buddy_ask_pk_cancel), 1069 G_CALLBACK(silcpurple_add_buddy_ask_pk_cancel),
1070 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r); 1070 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, "blist", r);
1071 1071
1072 } 1072 }
1073 1073
1074 static void 1074 static void
1075 silcpurple_add_buddy_ask_pk(SilcPurpleBuddyRes r) 1075 silcpurple_add_buddy_ask_pk(SilcPurpleBuddyRes r)
1076 { 1076 {
1077 char tmp[512]; 1077 char tmp[512];
1078 g_snprintf(tmp, sizeof(tmp), _("The %s buddy is not present in the network"), 1078 g_snprintf(tmp, sizeof(tmp), _("The %s buddy is not present in the network"),
1079 r->b->name); 1079 r->b->name);
1080 purple_request_action(r->client->application, _("Add Buddy"), tmp, 1080 purple_request_action_with_hint(r->client->application, _("Add Buddy"), tmp,
1081 _("To add the buddy you must import his/her public key. " 1081 _("To add the buddy you must import his/her public key. "
1082 "Press Import to import a public key."), 0, 1082 "Press Import to import a public key."), 0,
1083 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r, 2, 1083 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, "blist", r, 2,
1084 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb), 1084 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb),
1085 _("_Import..."), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb)); 1085 _("_Import..."), G_CALLBACK(silcpurple_add_buddy_ask_pk_cb));
1086 } 1086 }
1087 1087
1088 static void 1088 static void
1175 fingerprint ? tmp2 : ""); 1175 fingerprint ? tmp2 : "");
1176 purple_request_field_list_add(f, tmp, clients[i]); 1176 purple_request_field_list_add(f, tmp, clients[i]);
1177 silc_free(fingerprint); 1177 silc_free(fingerprint);
1178 } 1178 }
1179 1179
1180 purple_request_fields(r->client->application, _("Add Buddy"), 1180 purple_request_fields_with_hint(r->client->application, _("Add Buddy"),
1181 _("Select correct user"), 1181 _("Select correct user"),
1182 r->pubkey_search 1182 r->pubkey_search
1183 ? _("More than one user was found with the same public key. Select " 1183 ? _("More than one user was found with the same public key. Select "
1184 "the correct user from the list to add to the buddy list.") 1184 "the correct user from the list to add to the buddy list.")
1185 : _("More than one user was found with the same name. Select " 1185 : _("More than one user was found with the same name. Select "
1186 "the correct user from the list to add to the buddy list."), 1186 "the correct user from the list to add to the buddy list."),
1187 fields, 1187 fields,
1188 _("OK"), G_CALLBACK(silcpurple_add_buddy_select_cb), 1188 _("OK"), G_CALLBACK(silcpurple_add_buddy_select_cb),
1189 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_select_cancel), 1189 _("Cancel"), G_CALLBACK(silcpurple_add_buddy_select_cancel),
1190 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, r); 1190 purple_buddy_get_account(r->b), purple_buddy_get_name(r->b), NULL, "blist", r);
1191 } 1191 }
1192 1192
1193 static void 1193 static void
1194 silcpurple_add_buddy_resolved(SilcClient client, 1194 silcpurple_add_buddy_resolved(SilcClient client,
1195 SilcClientConnection conn, 1195 SilcClientConnection conn,