Commit b733bc4a5fb238f95d81e704357d2ae3c25d4439

Authored by Perry Werneck
1 parent d7931c4d

Emitting message when the logo is not available on about window.

Showing 1 changed file with 23 additions and 21 deletions   Show diff stats
src/pw3270/dialog.c
@@ -467,11 +467,14 @@ @@ -467,11 +467,14 @@
467 467
468 G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget) 468 G_GNUC_INTERNAL void about_dialog_action(GtkAction *action, GtkWidget *widget)
469 { 469 {
470 - static const gchar *authors[] = { "Perry Werneck <perry.werneck@gmail.com>",  
471 - "Paul Mattes <Paul.Mattes@usa.net>",  
472 - "Georgia Tech Research Corporation (GTRC)",  
473 - "and others",  
474 - NULL }; 470 + static const gchar *authors[] =
  471 + {
  472 + "Perry Werneck <perry.werneck@gmail.com>",
  473 + "Paul Mattes <Paul.Mattes@usa.net>",
  474 + "Georgia Tech Research Corporation (GTRC)",
  475 + "and others",
  476 + NULL
  477 + };
475 478
476 static const gchar *license = 479 static const gchar *license =
477 N_( "This program is free software; you can redistribute it and/or " 480 N_( "This program is free software; you can redistribute it and/or "
@@ -490,13 +493,20 @@ @@ -490,13 +493,20 @@
490 GtkAboutDialog * dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); 493 GtkAboutDialog * dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
491 g_autofree gchar * text = g_strdup_printf("%s-logo.png",g_get_application_name()); 494 g_autofree gchar * text = g_strdup_printf("%s-logo.png",g_get_application_name());
492 g_autofree gchar * filename = build_data_filename(text,NULL); 495 g_autofree gchar * filename = build_data_filename(text,NULL);
493 - g_autofree gchar * info; 496 + g_autofree gchar * info = g_strdup_printf(_( "3270 terminal emulator for GTK %d.%d" ),GTK_MAJOR_VERSION,GTK_MINOR_VERSION);
  497 +
  498 + g_autofree gchar * version =
  499 +#ifdef PACKAGE_RELEASE
  500 + g_strdup_printf(_("Version %s-%s"),PACKAGE_VERSION,G_STRINGIFY(PACKAGE_RELEASE));
  501 +#else
  502 + g_strdup_printf(_("Version %s-%s"),PACKAGE_VERSION,G_STRINGIFY(BUILD_DATE));
  503 +#endif // PACKAGE_REVISION
  504 +
494 505
495 if(widget) { 506 if(widget) {
496 gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(widget))); 507 gtk_window_set_transient_for(GTK_WINDOW(dialog),GTK_WINDOW(gtk_widget_get_toplevel(widget)));
497 } 508 }
498 509
499 - trace("[%s]",filename);  
500 if(g_file_test(filename,G_FILE_TEST_EXISTS)) 510 if(g_file_test(filename,G_FILE_TEST_EXISTS))
501 { 511 {
502 GError * error = NULL; 512 GError * error = NULL;
@@ -513,28 +523,20 @@ @@ -513,28 +523,20 @@
513 g_warning("Can't load %s: %s",filename,error->message); 523 g_warning("Can't load %s: %s",filename,error->message);
514 g_error_free(error); 524 g_error_free(error);
515 } 525 }
516 - }  
517 526
518 - g_autofree gchar * version =  
519 -#ifdef PACKAGE_RELEASE  
520 - g_strdup_printf(_("Version %s-%s"),PACKAGE_VERSION,G_STRINGIFY(PACKAGE_RELEASE));  
521 -#else  
522 - g_strdup_printf(_("Version %s-%s"),PACKAGE_VERSION,G_STRINGIFY(BUILD_DATE));  
523 -#endif // PACKAGE_REVISION 527 + } else {
524 528
525 - gtk_about_dialog_set_version(dialog,version); 529 + g_message("Can't load %s: %s",filename,strerror(ENOENT));
526 530
527 - gtk_about_dialog_set_copyright(dialog, "Copyright © 2008 Banco do Brasil S.A." ); 531 + }
528 532
529 - info = g_strdup_printf(_( "3270 terminal emulator for GTK %d.%d" ),GTK_MAJOR_VERSION,GTK_MINOR_VERSION); 533 + gtk_about_dialog_set_version(dialog,version);
  534 + gtk_about_dialog_set_copyright(dialog, "Copyright © 2008 Banco do Brasil S.A." );
530 gtk_about_dialog_set_comments(dialog, info ); 535 gtk_about_dialog_set_comments(dialog, info );
531 -  
532 gtk_about_dialog_set_license(dialog, gettext( license ) ); 536 gtk_about_dialog_set_license(dialog, gettext( license ) );
533 gtk_about_dialog_set_wrap_license(dialog,TRUE); 537 gtk_about_dialog_set_wrap_license(dialog,TRUE);
534 -  
535 - gtk_about_dialog_set_website(dialog,_("https://portal.softwarepublico.gov.br/social/pw3270/")); 538 + gtk_about_dialog_set_website(dialog,"https://portal.softwarepublico.gov.br/social/pw3270/");
536 gtk_about_dialog_set_website_label(dialog,_( "Brazilian Public Software Portal" )); 539 gtk_about_dialog_set_website_label(dialog,_( "Brazilian Public Software Portal" ));
537 -  
538 gtk_about_dialog_set_authors(dialog,authors); 540 gtk_about_dialog_set_authors(dialog,authors);
539 gtk_about_dialog_set_translator_credits(dialog,_("translator-credits")); 541 gtk_about_dialog_set_translator_credits(dialog,_("translator-credits"));
540 542