@@ -487,6 +487,64 @@ task_cb (WButton *button, int action)
487
487
/*** public functions ****************************************************************************/
488
488
/* --------------------------------------------------------------------------------------------- */
489
489
490
+ void
491
+ about_box (void )
492
+ {
493
+ char * label_cp_display ;
494
+ char * label_cp_source ;
495
+
496
+ char * version = g_strdup_printf ("Midnight Commander %s" , mc_global .mc_version );
497
+
498
+ const char * name_cp_display =
499
+ ((codepage_desc * ) g_ptr_array_index (codepages , mc_global .display_codepage ))-> name ;
500
+
501
+ const char * name_cp_source = mc_global .source_codepage >= 0
502
+ ? ((codepage_desc * ) g_ptr_array_index (codepages , mc_global .source_codepage ))-> name
503
+ : N_ ("No translation" );
504
+
505
+ label_cp_display =
506
+ g_strdup_printf ("%s: %s" , N_ ("Detected display codepage" ), name_cp_display );
507
+ label_cp_source =
508
+ g_strdup_printf ("%s: %s" , N_ ("Selected source (file I/O) codepage" ), name_cp_source );
509
+
510
+ quick_widget_t quick_widgets [] = {
511
+ QUICK_LABEL (version , NULL ),
512
+ QUICK_SEPARATOR (TRUE),
513
+ QUICK_LABEL (N_ ("Classic terminal file manager inspired by Norton Commander." ), NULL ),
514
+ QUICK_SEPARATOR (FALSE),
515
+ QUICK_LABEL (N_ ("Copyright (C) 1996-2025 the Free Software Foundation" ), NULL ),
516
+ QUICK_SEPARATOR (TRUE),
517
+ QUICK_LABEL (label_cp_display , NULL ),
518
+ QUICK_LABEL (label_cp_source , NULL ),
519
+ QUICK_START_BUTTONS (TRUE, TRUE),
520
+ QUICK_BUTTON (N_ ("&OK" ), B_ENTER , NULL , NULL ),
521
+ QUICK_END ,
522
+ };
523
+
524
+ WRect r = { -1 , -1 , 0 , 40 };
525
+
526
+ quick_dialog_t qdlg = {
527
+ .rect = r ,
528
+ .title = N_ ("About" ),
529
+ .help = "[Overview]" ,
530
+ .widgets = quick_widgets ,
531
+ .callback = NULL ,
532
+ .mouse_callback = NULL ,
533
+ };
534
+
535
+ quick_widgets [0 ].pos_flags = WPOS_KEEP_TOP | WPOS_CENTER_HORZ ;
536
+ quick_widgets [2 ].pos_flags = WPOS_KEEP_TOP | WPOS_CENTER_HORZ ;
537
+ quick_widgets [4 ].pos_flags = WPOS_KEEP_TOP | WPOS_CENTER_HORZ ;
538
+
539
+ (void ) quick_dialog (& qdlg );
540
+
541
+ g_free (version );
542
+ g_free (label_cp_display );
543
+ g_free (label_cp_source );
544
+ }
545
+
546
+ /* --------------------------------------------------------------------------------------------- */
547
+
490
548
void
491
549
configure_box (void )
492
550
{
@@ -590,24 +648,10 @@ void
590
648
appearance_box (void )
591
649
{
592
650
const gboolean shadows = mc_global .tty .shadows ;
593
- char * label_cp_display ;
594
- char * label_cp_source ;
595
651
596
652
current_skin_name = g_strdup (mc_skin__default .name );
597
653
skin_names = mc_skin_list ();
598
654
599
- const char * name_cp_display =
600
- ((codepage_desc * ) g_ptr_array_index (codepages , mc_global .display_codepage ))-> name ;
601
-
602
- const char * name_cp_source = mc_global .source_codepage >= 0
603
- ? ((codepage_desc * ) g_ptr_array_index (codepages , mc_global .source_codepage ))-> name
604
- : N_ ("No translation" );
605
-
606
- label_cp_display =
607
- g_strdup_printf ("%s: %s" , N_ ("Detected display codepage" ), name_cp_display );
608
- label_cp_source =
609
- g_strdup_printf ("%s: %s" , N_ ("Selected source (file I/O) codepage" ), name_cp_source );
610
-
611
655
{
612
656
quick_widget_t quick_widgets [] = {
613
657
// clang-format off
@@ -619,9 +663,6 @@ appearance_box (void)
619
663
QUICK_STOP_COLUMNS ,
620
664
QUICK_SEPARATOR (TRUE),
621
665
QUICK_CHECKBOX (N_ ("&Shadows" ), & mc_global .tty .shadows , & shadows_id ),
622
- QUICK_SEPARATOR (TRUE),
623
- QUICK_LABEL (label_cp_display , NULL ),
624
- QUICK_LABEL (label_cp_source , NULL ),
625
666
QUICK_BUTTONS_OK_CANCEL ,
626
667
QUICK_END ,
627
668
// clang-format on
@@ -648,8 +689,6 @@ appearance_box (void)
648
689
}
649
690
}
650
691
651
- g_free (label_cp_display );
652
- g_free (label_cp_source );
653
692
g_free (current_skin_name );
654
693
g_ptr_array_free (skin_names , TRUE);
655
694
}
0 commit comments