Ticket #2967: mc.modal.diff

File mc.modal.diff, 3.1 KB (added by szaszg, 11 years ago)
  • lib/widget/dialog-switch.c

    diff --git a/lib/widget/dialog-switch.c b/lib/widget/dialog-switch.c
    index 0305ed1..9fe37ad 100644
    a b dialog_switch_remove (WDialog * h) 
    166166    mc_dialogs = g_list_delete_link (mc_dialogs, this); 
    167167 
    168168    /* adjust current dialog */ 
    169     if (top_dlg != NULL) 
    170         mc_current = g_list_find (mc_dialogs, DIALOG (top_dlg->data)); 
    171     else 
    172         mc_current = mc_dialogs; 
    173169 
     170    mc_current = g_list_last (mc_dialogs); 
    174171    /* resume forced the current screen */ 
    175172    if (mc_current != NULL) 
    176173        DIALOG (mc_current->data)->state = DLG_ACTIVE; 
  • lib/widget/dialog.c

    diff --git a/lib/widget/dialog.c b/lib/widget/dialog.c
    index 424e4c9..cdf81a6 100644
    a b dlg_execute_cmd (WDialog * h, unsigned long command) 
    310310        break; 
    311311 
    312312    case CK_ScreenList: 
    313         if (!h->modal) 
     313        if (!h->modal || (h->flags & DLG_ALLOW_SL)) 
    314314            dialog_switch_list (); 
    315315        else 
    316316            ret = MSG_NOT_HANDLED; 
    317317        break; 
    318318    case CK_ScreenNext: 
    319         if (!h->modal) 
     319        if (!h->modal || (h->flags & DLG_ALLOW_SL)) 
    320320            dialog_switch_next (); 
    321321        else 
    322322            ret = MSG_NOT_HANDLED; 
    323323        break; 
    324324    case CK_ScreenPrev: 
    325         if (!h->modal) 
     325        if (!h->modal || (h->flags & DLG_ALLOW_SL)) 
    326326            dialog_switch_prev (); 
    327327        else 
    328328            ret = MSG_NOT_HANDLED; 
    dlg_stop (WDialog * h) 
    11801180void 
    11811181dlg_init (WDialog * h) 
    11821182{ 
    1183     if (top_dlg != NULL && DIALOG (top_dlg->data)->modal) 
    1184         h->modal = TRUE; 
    1185  
    11861183    /* add dialog to the stack */ 
    11871184    top_dlg = g_list_prepend (top_dlg, h); 
    11881185 
  • lib/widget/dialog.h

    diff --git a/lib/widget/dialog.h b/lib/widget/dialog.h
    index 1135857..bea125b 100644
    a b typedef enum 
    3636    DLG_CENTER = (1 << 0),      /* Center the dialog */ 
    3737    DLG_TRYUP = (1 << 1),       /* Try to move two lines up the dialog */ 
    3838    DLG_COMPACT = (1 << 2),     /* Suppress spaces around the frame */ 
    39     DLG_WANT_TAB = (1 << 3)     /* Should the tab key be sent to the dialog? */ 
     39    DLG_WANT_TAB = (1 << 3),    /* Should the tab key be sent to the dialog? */ 
     40    DLG_ALLOW_SL = (1 << 4)     /* ScreenList available */ 
    4041} dlg_flags_t; 
    4142 
    4243/* Dialog state */ 
  • src/filemanager/find.c

    diff --git a/src/filemanager/find.c b/src/filemanager/find.c
    index a8766ad..ff44ce1 100644
    a b find_parameters (char **start_dir, ssize_t * start_dir_len, 
    606606 
    607607    find_dlg = 
    608608        dlg_create (TRUE, 0, 0, lines, cols, dialog_colors, find_parm_callback, NULL, "[Find File]", 
    609                     _("Find File"), DLG_CENTER); 
     609                    _("Find File"), DLG_CENTER|DLG_ALLOW_SL); 
    610610 
    611611    x1 = 3; 
    612612    x2 = cols / 2 + 1; 
    setup_gui (void) 
    16091609 
    16101610    find_dlg = 
    16111611        dlg_create (TRUE, 0, 0, lines, cols, dialog_colors, find_callback, NULL, "[Find File]", 
    1612                     _("Find File"), DLG_CENTER); 
     1612                    _("Find File"), DLG_CENTER|DLG_ALLOW_SL); 
    16131613 
    16141614    find_calc_button_locations (find_dlg, TRUE); 
    16151615