comparison pidgin/gtkcertmgr.c @ 21099:51cf02dbdb0e

disapproval of revision 'c484d979c4fda4433a9633ff8b69bd8a395c9479'
author Richard Laager <rlaager@wiktel.com>
date Fri, 16 Nov 2007 23:30:03 +0000
parents cab348e39751
children fcb848b2d669
comparison
equal deleted inserted replaced
21095:cab348e39751 21099:51cf02dbdb0e
182 default_hostname = purple_certificate_get_subject_name(crt); 182 default_hostname = purple_certificate_get_subject_name(crt);
183 /* TODO: Find a way to make sure that crt gets destroyed 183 /* TODO: Find a way to make sure that crt gets destroyed
184 if the window gets closed unusually, such as by handle 184 if the window gets closed unusually, such as by handle
185 deletion */ 185 deletion */
186 /* TODO: Display some more information on the certificate? */ 186 /* TODO: Display some more information on the certificate? */
187 purple_request_input_with_hint(tpm_dat, 187 purple_request_input(tpm_dat,
188 _("Certificate Import"), 188 _("Certificate Import"),
189 _("Specify a hostname"), 189 _("Specify a hostname"),
190 _("Type the host name this certificate is for."), 190 _("Type the host name this certificate is for."),
191 default_hostname, 191 default_hostname,
192 FALSE, /* Not multiline */ 192 FALSE, /* Not multiline */
195 _("OK"), 195 _("OK"),
196 G_CALLBACK(tls_peers_mgmt_import_ok2_cb), 196 G_CALLBACK(tls_peers_mgmt_import_ok2_cb),
197 _("Cancel"), 197 _("Cancel"),
198 G_CALLBACK(tls_peers_mgmt_import_cancel2_cb), 198 G_CALLBACK(tls_peers_mgmt_import_cancel2_cb),
199 NULL, NULL, NULL, /* No account/who/conv*/ 199 NULL, NULL, NULL, /* No account/who/conv*/
200 "certmgr", crt /* Pass cert instance to callback*/ 200 crt /* Pass cert instance to callback*/
201 ); 201 );
202 202
203 g_free(default_hostname); 203 g_free(default_hostname);
204 } else { 204 } else {
205 /* Errors! Oh no! */ 205 /* Errors! Oh no! */
218 218
219 static void 219 static void
220 tls_peers_mgmt_import_cb(GtkWidget *button, gpointer data) 220 tls_peers_mgmt_import_cb(GtkWidget *button, gpointer data)
221 { 221 {
222 /* TODO: need to tell the user that we want a .PEM file! */ 222 /* TODO: need to tell the user that we want a .PEM file! */
223 purple_request_file_with_hint(tpm_dat, 223 purple_request_file(tpm_dat,
224 _("Select a PEM certificate"), 224 _("Select a PEM certificate"),
225 "certificate.pem", 225 "certificate.pem",
226 FALSE, /* Not a save dialog */ 226 FALSE, /* Not a save dialog */
227 G_CALLBACK(tls_peers_mgmt_import_ok_cb), 227 G_CALLBACK(tls_peers_mgmt_import_ok_cb),
228 NULL, /* Do nothing if cancelled */ 228 NULL, /* Do nothing if cancelled */
229 NULL, NULL, NULL, "certmgr", NULL );/* No account,conv,etc. */ 229 NULL, NULL, NULL, NULL );/* No account,conv,etc. */
230 } 230 }
231 231
232 static void 232 static void
233 tls_peers_mgmt_export_ok_cb(gpointer data, const char *filename) 233 tls_peers_mgmt_export_ok_cb(gpointer data, const char *filename)
234 { 234 {
293 } 293 }
294 g_free(id); 294 g_free(id);
295 295
296 296
297 /* TODO: inform user that it will be a PEM? */ 297 /* TODO: inform user that it will be a PEM? */
298 purple_request_file_with_hint(tpm_dat, 298 purple_request_file(tpm_dat,
299 _("PEM X.509 Certificate Export"), 299 _("PEM X.509 Certificate Export"),
300 "certificate.pem", 300 "certificate.pem",
301 TRUE, /* Is a save dialog */ 301 TRUE, /* Is a save dialog */
302 G_CALLBACK(tls_peers_mgmt_export_ok_cb), 302 G_CALLBACK(tls_peers_mgmt_export_ok_cb),
303 G_CALLBACK(tls_peers_mgmt_export_cancel_cb), 303 G_CALLBACK(tls_peers_mgmt_export_cancel_cb),
304 NULL, NULL, NULL, /* No account,conv,etc. */ 304 NULL, NULL, NULL, /* No account,conv,etc. */
305 "certmgr", crt); /* Pass the certificate on to the callback */ 305 crt); /* Pass the certificate on to the callback */
306 } 306 }
307 307
308 static void 308 static void
309 tls_peers_mgmt_info_cb(GtkWidget *button, gpointer data) 309 tls_peers_mgmt_info_cb(GtkWidget *button, gpointer data)
310 { 310 {
369 369
370 /* Prompt to confirm deletion */ 370 /* Prompt to confirm deletion */
371 primary = g_strdup_printf( 371 primary = g_strdup_printf(
372 _("Really delete certificate for %s?"), id ); 372 _("Really delete certificate for %s?"), id );
373 373
374 purple_request_yes_no_with_hint(tpm_dat, _("Confirm certificate delete"), 374 purple_request_yes_no(tpm_dat, _("Confirm certificate delete"),
375 primary, NULL, /* Can this be NULL? */ 375 primary, NULL, /* Can this be NULL? */
376 2, /* NO is default action */ 376 2, /* NO is default action */
377 NULL, NULL, NULL, 377 NULL, NULL, NULL,
378 "certmgr",
379 id, /* id ownership passed to callback */ 378 id, /* id ownership passed to callback */
380 tls_peers_mgmt_delete_confirm_cb, 379 tls_peers_mgmt_delete_confirm_cb,
381 tls_peers_mgmt_delete_confirm_cb ); 380 tls_peers_mgmt_delete_confirm_cb );
382 381
383 g_free(primary); 382 g_free(primary);