Ticket #2163: mc-4.8.8-rotating-dash.patch

File mc-4.8.8-rotating-dash.patch, 6.7 KB (added by egmont, 11 years ago)

remove rotating dash when finished rotating

  • src/filemanager/cmd.c

    diff -ur mc-4.8.8.orig/src/filemanager/cmd.c mc-4.8.8/src/filemanager/cmd.c
    old new  
    320320                data2 = mmap (0, size, PROT_READ, MAP_FILE | MAP_PRIVATE, file2, 0); 
    321321                if (data2 != (char *) -1) 
    322322                { 
    323                     rotate_dash (); 
     323                    rotate_dash (TRUE); 
    324324                    result = memcmp (data1, data2, size); 
    325325                    munmap (data2, size); 
    326326                } 
     
    330330            /* Don't have mmap() :( Even more ugly :) */ 
    331331            char buf1[BUFSIZ], buf2[BUFSIZ]; 
    332332            int n1, n2; 
    333             rotate_dash (); 
     333            rotate_dash (TRUE); 
    334334            do 
    335335            { 
    336336                while ((n1 = read (file1, buf1, BUFSIZ)) == -1 && errno == EINTR); 
     
    343343        } 
    344344        close (file1); 
    345345    } 
     346    rotate_dash (FALSE); 
    346347    return result; 
    347348} 
    348349 
  • src/filemanager/dir.c

    diff -ur mc-4.8.8.orig/src/filemanager/dir.c mc-4.8.8/src/filemanager/dir.c
    old new  
    599599        next_free++; 
    600600 
    601601        if ((next_free & 31) == 0) 
    602             rotate_dash (); 
     602            rotate_dash (TRUE); 
    603603    } 
    604604 
    605605    if (next_free != 0) 
     
    608608  ret: 
    609609    mc_closedir (dirp); 
    610610    tree_store_end_check (); 
     611    rotate_dash (FALSE); 
    611612    return next_free; 
    612613} 
    613614 
     
    738739        list->list[next_free].second_sort_key = NULL; 
    739740        next_free++; 
    740741        if (!(next_free % 16)) 
    741             rotate_dash (); 
     742            rotate_dash (TRUE); 
    742743    } 
    743744    mc_closedir (dirp); 
    744745    tree_store_end_check (); 
     
    748749        do_sort (list, sort, next_free - 1, lc_reverse, lc_case_sensitive, exec_ff); 
    749750    } 
    750751    clean_dir (&dir_copy, count); 
     752    rotate_dash (FALSE); 
    751753    return next_free; 
    752754} 
    753755 
  • src/filemanager/file.c

    diff -ur mc-4.8.8.orig/src/filemanager/file.c mc-4.8.8/src/filemanager/file.c
    old new  
    828828    long dt; 
    829829 
    830830    /* 1. Update rotating dash after some time */ 
    831     rotate_dash (); 
     831    rotate_dash (TRUE); 
    832832 
    833833    /* 3. Compute ETA */ 
    834834    dt = (tv_current.tv_sec - tv_transfer_start.tv_sec); 
     
    19221922    dst_status = DEST_FULL;     /* copy successful, don't remove target file */ 
    19231923 
    19241924  ret: 
     1925    rotate_dash (FALSE); 
    19251926    while (src_desc != -1 && mc_close (src_desc) < 0 && !ctx->skip_all) 
    19261927    { 
    19271928        temp_status = file_error (_("Cannot close source file \"%s\"\n%s"), src_path); 
  • src/filemanager/find.c

    diff -ur mc-4.8.8.orig/src/filemanager/find.c mc-4.8.8/src/filemanager/find.c
    old new  
    11851185/* --------------------------------------------------------------------------------------------- */ 
    11861186 
    11871187static void 
    1188 find_rotate_dash (const WDialog * h, gboolean finish) 
     1188find_rotate_dash (const WDialog * h, gboolean show) 
    11891189{ 
    11901190    static const char rotating_dash[] = "|/-\\"; 
    11911191    static unsigned int pos = 0; 
     
    11971197        pos = (pos + 1) % 4; 
    11981198        tty_setcolor (h->color[DLG_COLOR_NORMAL]); 
    11991199        widget_move (h, w->lines - 7, w->cols - 4); 
    1200         tty_print_char (finish ? ' ' : rotating_dash[pos]); 
     1200        tty_print_char (show ? rotating_dash[pos] : ' '); 
    12011201        mc_refresh (); 
    12021202    } 
    12031203} 
     
    12611261                                                  ignore_count), ignore_count); 
    12621262                            status_update (msg); 
    12631263                        } 
    1264                         find_rotate_dash (h, TRUE); 
     1264                        find_rotate_dash (h, FALSE); 
    12651265                        stop_idle (h); 
    12661266                        return 0; 
    12671267                    } 
     
    13601360            ; 
    13611361    }                           /* for */ 
    13621362 
    1363     find_rotate_dash (h, FALSE); 
     1363    find_rotate_dash (h, TRUE); 
    13641364 
    13651365    return 1; 
    13661366} 
     
    17701770            next_free++; 
    17711771            g_free (name); 
    17721772            if (!(next_free & 15)) 
    1773                 rotate_dash (); 
     1773                rotate_dash (TRUE); 
    17741774        } 
    17751775 
    17761776        if (next_free) 
     
    17961796    do_search (NULL);           /* force do_search to release resources */ 
    17971797    g_free (old_dir); 
    17981798    old_dir = NULL; 
     1799    rotate_dash (FALSE); 
    17991800 
    18001801    return return_value; 
    18011802} 
  • src/filemanager/layout.c

    diff -ur mc-4.8.8.orig/src/filemanager/layout.c mc-4.8.8/src/filemanager/layout.c
    old new  
    863863/* --------------------------------------------------------------------------------------------- */ 
    864864 
    865865void 
    866 rotate_dash (void) 
     866rotate_dash (gboolean show) 
    867867{ 
    868868    static const char rotating_dash[] = "|/-\\"; 
    869869    static size_t pos = 0; 
     
    871871    if (!nice_rotating_dash || (ok_to_refresh <= 0)) 
    872872        return; 
    873873 
     874    if (!show) { 
     875        tty_gotoyx (0, COLS - 1); 
     876        if (menubar_visible) { 
     877            tty_setcolor (MENU_INACTIVE_COLOR); 
     878            tty_print_char (' '); 
     879        } else { 
     880            tty_setcolor (NORMAL_COLOR); 
     881            tty_print_alt_char (ACS_URCORNER, FALSE); 
     882        } 
     883        mc_refresh (); 
     884        return; 
     885    } 
     886 
    874887    if (pos >= sizeof (rotating_dash) - 1) 
    875888        pos = 0; 
    876889    tty_gotoyx (0, COLS - 1); 
  • src/filemanager/layout.h

    diff -ur mc-4.8.8.orig/src/filemanager/layout.h mc-4.8.8/src/filemanager/layout.h
    old new  
    7979 
    8080/* Rotating dash routines */ 
    8181void use_dash (gboolean flag);  /* Disable/Enable rotate_dash routines */ 
    82 void rotate_dash (void); 
     82void rotate_dash (gboolean show); 
    8383 
    8484#ifdef ENABLE_SUBSHELL 
    8585gboolean do_load_prompt (void); 
  • src/filemanager/panelize.c

    diff -ur mc-4.8.8.orig/src/filemanager/panelize.c mc-4.8.8/src/filemanager/panelize.c
    old new  
    368368        list->list[next_free].second_sort_key = NULL; 
    369369        next_free++; 
    370370        if (!(next_free & 32)) 
    371             rotate_dash (); 
     371            rotate_dash (TRUE); 
    372372    } 
    373373 
    374374    current_panel->is_panelized = TRUE; 
     
    392392    close_error_pipe (D_NORMAL, NULL); 
    393393    try_to_select (current_panel, NULL); 
    394394    panel_re_sort (current_panel); 
     395    rotate_dash (FALSE); 
    395396} 
    396397 
    397398/* --------------------------------------------------------------------------------------------- */