diff --git a/src/filemanager/boxes.c b/src/filemanager/boxes.c
index 1de6f7d..f03ed05 100644
a
|
b
|
skin_apply (const gchar * skin_override) |
544 | 544 | |
545 | 545 | /* --------------------------------------------------------------------------------------------- */ |
546 | 546 | |
| 547 | static const gchar * |
| 548 | skin_name_to_label (const gchar *name) |
| 549 | { |
| 550 | if (strcmp (name, "default") == 0) |
| 551 | return _("< Default >"); |
| 552 | return name; |
| 553 | } |
| 554 | |
| 555 | /* --------------------------------------------------------------------------------------------- */ |
| 556 | |
547 | 557 | static int |
548 | 558 | sel_skin_button (WButton * button, int action) |
549 | 559 | { |
550 | 560 | int result; |
551 | 561 | WListbox *skin_list; |
552 | 562 | WDialog *skin_dlg; |
553 | | gchar *skin_name; |
| 563 | const gchar *skin_name; |
554 | 564 | int lxx, lyy; |
555 | | unsigned int i; |
| 565 | unsigned int i, pos; |
556 | 566 | |
557 | 567 | (void) action; |
558 | 568 | |
… |
… |
sel_skin_button (WButton * button, int action) |
563 | 573 | DLG_COMPACT); |
564 | 574 | |
565 | 575 | skin_list = listbox_new (1, 1, 11, 22, FALSE, NULL); |
| 576 | skin_name = "default"; |
| 577 | listbox_add_item (skin_list, LISTBOX_APPEND_AT_END, 0, skin_name_to_label(skin_name), (void *) skin_name); |
| 578 | if (strcmp (skin_name, current_skin_name) == 0) |
| 579 | listbox_select_entry (skin_list, 0); |
| 580 | pos = 1; |
566 | 581 | for (i = 0; i < skin_names->len; i++) |
567 | 582 | { |
568 | 583 | skin_name = g_ptr_array_index (skin_names, i); |
569 | | listbox_add_item (skin_list, LISTBOX_APPEND_AT_END, 0, skin_name, NULL); |
| 584 | if (strcmp (skin_name, "default") == 0) |
| 585 | continue; |
| 586 | listbox_add_item (skin_list, LISTBOX_APPEND_AT_END, 0, skin_name_to_label(skin_name), (void *) skin_name); |
570 | 587 | if (strcmp (skin_name, current_skin_name) == 0) |
571 | | listbox_select_entry (skin_list, i); |
| 588 | listbox_select_entry (skin_list, pos); |
| 589 | pos++; |
572 | 590 | } |
573 | 591 | |
574 | 592 | add_widget (skin_dlg, skin_list); |
… |
… |
sel_skin_button (WButton * button, int action) |
577 | 595 | if (result == B_ENTER) |
578 | 596 | { |
579 | 597 | Widget *w; |
| 598 | gchar *skin_label; |
580 | 599 | |
581 | | listbox_get_current (skin_list, &skin_name, NULL); |
| 600 | listbox_get_current (skin_list, &skin_label, (void **) &skin_name); |
582 | 601 | g_free (current_skin_name); |
583 | 602 | current_skin_name = g_strdup (skin_name); |
584 | 603 | skin_apply (skin_name); |
585 | 604 | w = dlg_find_by_id (WIDGET (button)->owner, skin_name_id); |
586 | | button_set_text (BUTTON (w), str_fit_to_term (skin_name, 20, J_LEFT_FIT)); |
| 605 | button_set_text (BUTTON (w), str_fit_to_term (skin_label, 20, J_LEFT_FIT)); |
587 | 606 | } |
588 | 607 | dlg_destroy (skin_dlg); |
589 | 608 | return 0; |
… |
… |
appearance_box (void) |
603 | 622 | QUICK_START_COLUMNS, |
604 | 623 | QUICK_LABEL (N_("Skin:"), NULL), |
605 | 624 | QUICK_NEXT_COLUMN, |
606 | | QUICK_BUTTON (str_fit_to_term(current_skin_name, 20, J_LEFT_FIT), B_USER, |
607 | | sel_skin_button, &skin_name_id), |
| 625 | QUICK_BUTTON (str_fit_to_term(skin_name_to_label(current_skin_name), 20, J_LEFT_FIT), |
| 626 | B_USER, sel_skin_button, &skin_name_id), |
608 | 627 | QUICK_STOP_COLUMNS, |
609 | 628 | QUICK_BUTTONS_OK_CANCEL, |
610 | 629 | QUICK_END |