pidgin/pidginapplication.c

changeset 41947
7b3312d0760c
parent 41932
0c3de459b1cc
child 41958
76d1633b8ec0
equal deleted inserted replaced
41946:0fb3b0e7122f 41947:7b3312d0760c
256 } 256 }
257 } 257 }
258 } 258 }
259 259
260 static void 260 static void
261 pidgin_application_about(GSimpleAction *simple, GVariant *parameter, 261 pidgin_application_about(G_GNUC_UNUSED GSimpleAction *simple,
262 gpointer data) 262 G_GNUC_UNUSED GVariant *parameter, gpointer data)
263 { 263 {
264 PidginApplication *application = data; 264 PidginApplication *application = data;
265 static GtkWidget *about = NULL; 265 static GtkWidget *about = NULL;
266 266
267 if(!GTK_IS_WIDGET(about)) { 267 if(!GTK_IS_WIDGET(about)) {
271 271
272 pidgin_application_present_transient_window(application, GTK_WINDOW(about)); 272 pidgin_application_present_transient_window(application, GTK_WINDOW(about));
273 } 273 }
274 274
275 static void 275 static void
276 pidgin_application_accounts(GSimpleAction *simple, GVariant *parameter, 276 pidgin_application_accounts(G_GNUC_UNUSED GSimpleAction *simple,
277 gpointer data) 277 G_GNUC_UNUSED GVariant *parameter, gpointer data)
278 { 278 {
279 PidginApplication *application = data; 279 PidginApplication *application = data;
280 static GtkWidget *manager = NULL; 280 static GtkWidget *manager = NULL;
281 281
282 if(!GTK_IS_WIDGET(manager)) { 282 if(!GTK_IS_WIDGET(manager)) {
287 pidgin_application_present_transient_window(application, 287 pidgin_application_present_transient_window(application,
288 GTK_WINDOW(manager)); 288 GTK_WINDOW(manager));
289 } 289 }
290 290
291 static void 291 static void
292 pidgin_application_add_buddy(GSimpleAction *simple, GVariant *parameter, 292 pidgin_application_add_buddy(G_GNUC_UNUSED GSimpleAction *simple,
293 gpointer data) 293 G_GNUC_UNUSED GVariant *parameter,
294 G_GNUC_UNUSED gpointer data)
294 { 295 {
295 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL); 296 purple_blist_request_add_buddy(NULL, NULL, NULL, NULL);
296 } 297 }
297 298
298 static void 299 static void
299 pidgin_application_add_chat(GSimpleAction *simple, GVariant *parameter, 300 pidgin_application_add_chat(G_GNUC_UNUSED GSimpleAction *simple,
300 gpointer data) 301 G_GNUC_UNUSED GVariant *parameter,
302 G_GNUC_UNUSED gpointer data)
301 { 303 {
302 purple_blist_request_add_chat(NULL, NULL, NULL, NULL); 304 purple_blist_request_add_chat(NULL, NULL, NULL, NULL);
303 } 305 }
304 306
305 static void 307 static void
306 pidgin_application_add_group(GSimpleAction *simple, GVariant *parameter, 308 pidgin_application_add_group(G_GNUC_UNUSED GSimpleAction *simple,
307 gpointer data) 309 G_GNUC_UNUSED GVariant *parameter,
310 G_GNUC_UNUSED gpointer data)
308 { 311 {
309 purple_blist_request_add_group(); 312 purple_blist_request_add_group();
310 } 313 }
311 314
312 static void 315 static void
313 pidgin_application_connect_account(GSimpleAction *simple, GVariant *parameter, 316 pidgin_application_connect_account(G_GNUC_UNUSED GSimpleAction *simple,
314 gpointer data) 317 GVariant *parameter,
318 G_GNUC_UNUSED gpointer data)
315 { 319 {
316 PurpleAccount *account = NULL; 320 PurpleAccount *account = NULL;
317 PurpleAccountManager *manager = NULL; 321 PurpleAccountManager *manager = NULL;
318 const gchar *id = NULL; 322 const gchar *id = NULL;
319 323
326 purple_account_connect(account); 330 purple_account_connect(account);
327 } 331 }
328 } 332 }
329 333
330 static void 334 static void
331 pidgin_application_debug(GSimpleAction *simple, GVariant *parameter, 335 pidgin_application_debug(G_GNUC_UNUSED GSimpleAction *simple,
332 gpointer data) 336 G_GNUC_UNUSED GVariant *parameter,
337 G_GNUC_UNUSED gpointer data)
333 { 338 {
334 gboolean old = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled"); 339 gboolean old = purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled");
335 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", !old); 340 purple_prefs_set_bool(PIDGIN_PREFS_ROOT "/debug/enabled", !old);
336 } 341 }
337 342
338 343
339 static void 344 static void
340 pidgin_application_disable_account(GSimpleAction *simple, GVariant *parameter, 345 pidgin_application_disable_account(G_GNUC_UNUSED GSimpleAction *simple,
341 gpointer data) 346 GVariant *parameter,
347 G_GNUC_UNUSED gpointer data)
342 { 348 {
343 PurpleAccount *account = NULL; 349 PurpleAccount *account = NULL;
344 PurpleAccountManager *manager = NULL; 350 PurpleAccountManager *manager = NULL;
345 const gchar *id = NULL; 351 const gchar *id = NULL;
346 352
363 { 369 {
364 purple_notify_uri(NULL, "https://www.imfreedom.org/donate/"); 370 purple_notify_uri(NULL, "https://www.imfreedom.org/donate/");
365 } 371 }
366 372
367 static void 373 static void
368 pidgin_application_edit_account(GSimpleAction *simple, GVariant *parameter, 374 pidgin_application_edit_account(G_GNUC_UNUSED GSimpleAction *simple,
369 gpointer data) 375 GVariant *parameter, gpointer data)
370 { 376 {
371 PidginApplication *application = data; 377 PidginApplication *application = data;
372 PurpleAccount *account = NULL; 378 PurpleAccount *account = NULL;
373 PurpleAccountManager *manager = NULL; 379 PurpleAccountManager *manager = NULL;
374 const gchar *id = NULL; 380 const gchar *id = NULL;
385 GTK_WINDOW(editor)); 391 GTK_WINDOW(editor));
386 } 392 }
387 } 393 }
388 394
389 static void 395 static void
390 pidgin_application_enable_account(GSimpleAction *simple, GVariant *parameter, 396 pidgin_application_enable_account(G_GNUC_UNUSED GSimpleAction *simple,
391 gpointer data) 397 GVariant *parameter,
398 G_GNUC_UNUSED gpointer data)
392 { 399 {
393 PurpleAccount *account = NULL; 400 PurpleAccount *account = NULL;
394 PurpleAccountManager *manager = NULL; 401 PurpleAccountManager *manager = NULL;
395 const gchar *id = NULL; 402 const gchar *id = NULL;
396 403
405 } 412 }
406 } 413 }
407 } 414 }
408 415
409 static void 416 static void
410 pidgin_application_file_transfers(GSimpleAction *simple, GVariant *parameter, 417 pidgin_application_file_transfers(G_GNUC_UNUSED GSimpleAction *simple,
411 gpointer data) 418 G_GNUC_UNUSED GVariant *parameter,
419 G_GNUC_UNUSED gpointer data)
412 { 420 {
413 pidgin_xfer_dialog_show(NULL); 421 pidgin_xfer_dialog_show(NULL);
414 } 422 }
415 423
416 static void 424 static void
417 pidgin_application_get_user_info(GSimpleAction *simple, GVariant *parameter, 425 pidgin_application_get_user_info(G_GNUC_UNUSED GSimpleAction *simple,
418 gpointer data) 426 G_GNUC_UNUSED GVariant *parameter,
427 G_GNUC_UNUSED gpointer data)
419 { 428 {
420 pidgin_dialogs_info(); 429 pidgin_dialogs_info();
421 } 430 }
422 431
423 static void 432 static void
424 pidgin_application_join_chat(GSimpleAction *simple, GVariant *parameter, 433 pidgin_application_join_chat(G_GNUC_UNUSED GSimpleAction *simple,
425 gpointer data) 434 G_GNUC_UNUSED GVariant *parameter,
435 G_GNUC_UNUSED gpointer data)
426 { 436 {
427 pidgin_blist_joinchat_show(); 437 pidgin_blist_joinchat_show();
428 } 438 }
429 439
430 static void 440 static void
431 pidgin_application_new_message(GSimpleAction *simple, GVariant *parameter, 441 pidgin_application_new_message(G_GNUC_UNUSED GSimpleAction *simple,
432 gpointer data) 442 G_GNUC_UNUSED GVariant *parameter,
443 G_GNUC_UNUSED gpointer data)
433 { 444 {
434 pidgin_dialogs_im(); 445 pidgin_dialogs_im();
435 } 446 }
436 447
437 static void 448 static void
442 GtkWidget *editor = pidgin_status_editor_new(NULL); 453 GtkWidget *editor = pidgin_status_editor_new(NULL);
443 gtk_window_present_with_time(GTK_WINDOW(editor), GDK_CURRENT_TIME); 454 gtk_window_present_with_time(GTK_WINDOW(editor), GDK_CURRENT_TIME);
444 } 455 }
445 456
446 static void 457 static void
447 pidgin_application_online_help(GSimpleAction *simple, GVariant *parameter, 458 pidgin_application_online_help(G_GNUC_UNUSED GSimpleAction *simple,
448 gpointer data) 459 G_GNUC_UNUSED GVariant *parameter,
460 G_GNUC_UNUSED gpointer data)
449 { 461 {
450 purple_notify_uri(NULL, PURPLE_WEBSITE "help"); 462 purple_notify_uri(NULL, PURPLE_WEBSITE "help");
451 } 463 }
452 464
453 static void 465 static void
454 pidgin_application_plugins(GSimpleAction *simple, GVariant *parameter, 466 pidgin_application_plugins(G_GNUC_UNUSED GSimpleAction *simple,
455 gpointer data) 467 G_GNUC_UNUSED GVariant *parameter, gpointer data)
456 { 468 {
457 PidginApplication *application = data; 469 PidginApplication *application = data;
458 static GtkWidget *dialog = NULL; 470 static GtkWidget *dialog = NULL;
459 471
460 if(!GTK_IS_WIDGET(dialog)) { 472 if(!GTK_IS_WIDGET(dialog)) {
465 pidgin_application_present_transient_window(application, 477 pidgin_application_present_transient_window(application,
466 GTK_WINDOW(dialog)); 478 GTK_WINDOW(dialog));
467 } 479 }
468 480
469 static void 481 static void
470 pidgin_application_preferences(GSimpleAction *simple, GVariant *parameter, 482 pidgin_application_preferences(G_GNUC_UNUSED GSimpleAction *simple,
471 gpointer data) 483 G_GNUC_UNUSED GVariant *parameter,
484 G_GNUC_UNUSED gpointer data)
472 { 485 {
473 pidgin_prefs_show(); 486 pidgin_prefs_show();
474 } 487 }
475 488
476 static void 489 static void
477 pidgin_application_privacy(GSimpleAction *simple, GVariant *parameter, 490 pidgin_application_privacy(G_GNUC_UNUSED GSimpleAction *simple,
478 gpointer data) 491 G_GNUC_UNUSED GVariant *parameter,
492 G_GNUC_UNUSED gpointer data)
479 { 493 {
480 pidgin_privacy_dialog_show(); 494 pidgin_privacy_dialog_show();
481 } 495 }
482 496
483 static void 497 static void
484 pidgin_application_quit(GSimpleAction *simple, GVariant *parameter, 498 pidgin_application_quit(G_GNUC_UNUSED GSimpleAction *simple,
485 gpointer data) 499 G_GNUC_UNUSED GVariant *parameter,
500 G_GNUC_UNUSED gpointer data)
486 { 501 {
487 GPluginManager *manager = NULL; 502 GPluginManager *manager = NULL;
488 503
489 /* Remove the signal handlers for plugin state changing so we don't try to 504 /* Remove the signal handlers for plugin state changing so we don't try to
490 * update preferences. 505 * update preferences.
496 511
497 purple_core_quit(); 512 purple_core_quit();
498 } 513 }
499 514
500 static void 515 static void
501 pidgin_application_room_list(GSimpleAction *simple, GVariant *parameter, 516 pidgin_application_room_list(G_GNUC_UNUSED GSimpleAction *simple,
502 gpointer data) 517 G_GNUC_UNUSED GVariant *parameter,
518 G_GNUC_UNUSED gpointer data)
503 { 519 {
504 pidgin_roomlist_dialog_show(); 520 pidgin_roomlist_dialog_show();
505 } 521 }
506 522
507 static void 523 static void
508 pidgin_application_set_mood(GSimpleAction *simple, GVariant *parameter, 524 pidgin_application_set_mood(G_GNUC_UNUSED GSimpleAction *simple,
509 gpointer data) 525 G_GNUC_UNUSED GVariant *parameter,
526 G_GNUC_UNUSED gpointer data)
510 { 527 {
511 pidgin_mood_dialog_show(NULL); 528 pidgin_mood_dialog_show(NULL);
512 } 529 }
513 530
514 static void 531 static void
515 pidgin_application_show_status_manager(GSimpleAction *simple, 532 pidgin_application_show_status_manager(G_GNUC_UNUSED GSimpleAction *simple,
516 GVariant *parameter, gpointer data) 533 G_GNUC_UNUSED GVariant *parameter,
534 gpointer data)
517 { 535 {
518 PidginApplication *application = data; 536 PidginApplication *application = data;
519 static GtkWidget *manager = NULL; 537 static GtkWidget *manager = NULL;
520 538
521 if(!GTK_IS_WIDGET(manager)) { 539 if(!GTK_IS_WIDGET(manager)) {
665 TRUE); 683 TRUE);
666 } 684 }
667 } 685 }
668 686
669 static void 687 static void
670 pidgin_application_signed_off_cb(PurpleAccount *account, gpointer data) { 688 pidgin_application_signed_off_cb(G_GNUC_UNUSED PurpleAccount *account,
689 gpointer data)
690 {
671 PidginApplication *application = PIDGIN_APPLICATION(data); 691 PidginApplication *application = PIDGIN_APPLICATION(data);
672 gboolean should_disable_chat = TRUE, should_disable_room_list = TRUE; 692 gboolean should_disable_chat = TRUE, should_disable_room_list = TRUE;
673 GList *connections = NULL, *l = NULL; 693 GList *connections = NULL, *l = NULL;
674 gint n_actions = 0; 694 gint n_actions = 0;
675 695
912 application); 932 application);
913 933
914 } 934 }
915 935
916 static void 936 static void
917 pidgin_application_activate(GApplication *application) { 937 pidgin_application_activate(G_GNUC_UNUSED GApplication *application) {
918 GtkWidget *convwin = pidgin_display_window_get_default(); 938 GtkWidget *convwin = pidgin_display_window_get_default();
919 939
920 if(GTK_IS_WINDOW(convwin)) { 940 if(GTK_IS_WINDOW(convwin)) {
921 gtk_window_present(GTK_WINDOW(convwin)); 941 gtk_window_present(GTK_WINDOW(convwin));
922 } 942 }
945 965
946 return 0; 966 return 0;
947 } 967 }
948 968
949 static gint 969 static gint
950 pidgin_application_handle_local_options(GApplication *application, 970 pidgin_application_handle_local_options(G_GNUC_UNUSED GApplication *application,
951 GVariantDict *options) 971 GVariantDict *options)
952 { 972 {
953 if (g_variant_dict_contains(options, "version")) { 973 if (g_variant_dict_contains(options, "version")) {
954 printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION, 974 printf("%s %s (libpurple %s)\n", PIDGIN_NAME, DISPLAY_VERSION,
955 purple_core_get_version()); 975 purple_core_get_version());

mercurial