Changeset 1444 for trunk/dll/misc.c


Ignore:
Timestamp:
Jul 23, 2009, 1:24:23 AM (16 years ago)
Author:
Gregg Young
Message:

Rework of drivebar to rescan all drives and refresh media buttons and menu items grey out inappropriate menu items. Streamline Tree scan code and use semaphores to serialize access. Add NOEASUPPORT and LOCALHD driveflag; .LONGNAME usage fixes; (Tickets 377-386)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/misc.c

    r1439 r1444  
    6161                add State.version key for check
    6262  12 Jul 09 GKY Add xDosQueryAppType and xDoxAlloc... to allow FM/2 to load in high memory
     63  22 Jul 09 GKY Check if drives support EAs add driveflag for this
     64  22 Jul 09 GKY Allow .LONGNAME to be displayed for FAT drives.
    6365
    6466***********************************************************************/
     
    480482}
    481483
    482 VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds)
     484VOID AdjustCnrColsForFSType(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds, BOOL compare)
    483485{
    484486  CHAR FileSystem[CCHMAXPATH];
     
    487489  BOOL hasAccessDT;
    488490  BOOL hasLongNames;
     491  BOOL hasSubjects;
    489492
    490493  if (!directory || !*directory)
     
    492495  x = CheckDrive(toupper(*directory), FileSystem, NULL);
    493496  if (x != -1) {
     497    x = toupper(*directory) - 'A';
    494498    if (!stricmp(FileSystem, HPFS) ||
    495499        !stricmp(FileSystem, JFS) ||
     
    501505      hasCreateDT = TRUE;
    502506      hasAccessDT = TRUE;
    503       hasLongNames = TRUE;
     507      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     508        hasSubjects  = FALSE;
     509        hasLongNames = FALSE;
     510      }
     511      else {
     512        hasSubjects  = TRUE;
     513        hasLongNames = TRUE;
     514      }
    504515    }
    505516    else if (!strcmp(FileSystem, CDFS) || !strcmp(FileSystem, ISOFS)) {
    506517      hasCreateDT = TRUE;
    507518      hasAccessDT = FALSE;
    508       hasLongNames = FALSE;
     519      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     520        hasSubjects  = FALSE;
     521        hasLongNames = FALSE;
     522      }
     523      else {
     524        hasSubjects  = TRUE;
     525        hasLongNames = TRUE;
     526      }
    509527    }
    510528    else {
     
    512530      hasCreateDT = FALSE;
    513531      hasAccessDT = FALSE;
    514       hasLongNames = FALSE;
     532      if (driveflags[x] & DRIVE_NOEASUPPORT) {
     533        hasSubjects  = FALSE;
     534        hasLongNames = FALSE;
     535      }
     536      else {
     537        hasSubjects  = TRUE;
     538        hasLongNames = TRUE;
     539      }
    515540    }
    516541  }
     
    519544    hasCreateDT = FALSE;
    520545    hasAccessDT = FALSE;
    521     hasLongNames = FALSE;
     546    if (driveflags[x] & DRIVE_NOEASUPPORT) {
     547      hasSubjects  = FALSE;
     548      hasLongNames = FALSE;
     549    }
     550    else {
     551      hasSubjects  = TRUE;
     552      hasLongNames = TRUE;
     553    }
    522554  }
    523555  AdjustCnrColVis(hwndCnr,
     
    536568                  GetPString(IDS_CRTIME),
    537569                  pds->detailscrtime ? hasCreateDT : FALSE,
    538                   FALSE);
     570                  FALSE);
     571  if (pds->detailslongname && !pds->detailssubject && hasSubjects) {
     572    AdjustCnrColVis(hwndCnr,
     573                    compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     574                    TRUE,
     575                    FALSE);
     576    AdjustCnrColVis(hwndCnr,
     577                    GetPString(IDS_LNAME),
     578                    pds->detailslongname ? hasLongNames : FALSE,
     579                    FALSE);
     580    WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
     581  }
     582  else
     583    AdjustCnrColVis(hwndCnr,
     584                    GetPString(IDS_LNAME),
     585                    pds->detailslongname ? hasLongNames : FALSE,
     586                    FALSE);
    539587  AdjustCnrColVis(hwndCnr,
    540                   GetPString(IDS_LNAME),
    541                   pds->detailslongname ? hasLongNames : FALSE,
    542                   FALSE);
     588                  compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     589                  pds->detailssubject ? hasSubjects : FALSE,
     590                  FALSE);
    543591  WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
    544592}
    545593
    546 VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS * pds,
     594VOID AdjustCnrColsForPref(HWND hwndCnr, PCSZ directory, DETAILS_SETTINGS *pds,
    547595                          BOOL compare)
    548596{
    549 
    550   AdjustCnrColVis(hwndCnr,
    551                   compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
    552                   pds->detailssubject,
    553                   FALSE);
    554 
    555597  AdjustCnrColVis(hwndCnr, GetPString(IDS_ATTR), pds->detailsattr, FALSE);
    556598  AdjustCnrColVis(hwndCnr, GetPString(IDS_ICON), pds->detailsicon, FALSE);
     
    561603
    562604  if (!directory) {
     605    AdjustCnrColVis(hwndCnr,
     606                    compare ? GetPString(IDS_STATUS) : GetPString(IDS_SUBJ),
     607                    pds->detailssubject,
     608                    FALSE);
    563609    AdjustCnrColVis(hwndCnr, GetPString(IDS_LADATE), pds->detailsladate, FALSE);
    564610    AdjustCnrColVis(hwndCnr, GetPString(IDS_LATIME), pds->detailslatime, FALSE);
     
    568614    WinSendMsg(hwndCnr, CM_INVALIDATEDETAILFIELDINFO, MPVOID, MPVOID);
    569615  }
    570   else
    571     AdjustCnrColsForFSType(hwndCnr, directory, pds);
     616  else {
     617    AdjustCnrColsForFSType(hwndCnr, directory, pds, compare);
     618  }
    572619}
    573620
     
    619666
    620667    pfi = pfi->pNextFieldInfo;
    621     pfi->flData = CFA_STRING | CFA_LEFT;
     668    pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    622669    pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    623670    pfi->pTitleData = (PSZ)GetPString(IDS_LNAME);
    624671    pfi->offStruct = FIELDOFFSET(CNRITEM, pszLongName);
     672    pfiLastLeftCol = pfi;
     673
     674    // Store the current pfi value as that will be used to indicate the
     675    // last column in the lefthand container window (we have a splitbar)
     676    if (!dsDirCnrDefault.fSubjectInLeftPane)
     677      pfiLastLeftCol = pfi;
     678    else
     679      pfiLastLeftCol = pfi->pNextFieldInfo;
    625680
    626681    // Fill in column info for subjects
    627 
    628     if (dsDirCnrDefault.fSubjectInLeftPane) {
    629       pfi = pfi->pNextFieldInfo;
    630       pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    631       if (isCompCnr)
    632         pfi->flData |= CFA_FIREADONLY;
    633       pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    634       pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
    635                                     (PSZ)GetPString(IDS_SUBJ);
    636       pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
    637       pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    638 
    639       // Store the current pfi value as that will be used to indicate the
    640       // last column in the lefthand container window (we have a splitbar)
    641 
    642       pfiLastLeftCol = pfi;
    643     }
    644     else {
    645       // Store the current pfi value as that will be used to indicate the
    646       // last column in the lefthand container window (we have a splitbar)
    647 
    648       pfiLastLeftCol = pfi;
    649       pfi = pfi->pNextFieldInfo;
    650       pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
    651       if (isCompCnr)
    652         pfi->flData |= CFA_FIREADONLY;
    653       pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
    654       pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
    655                                     (PSZ)GetPString(IDS_SUBJ);
    656       pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
    657       pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    658     }
     682    pfi = pfi->pNextFieldInfo;
     683    pfi->flData = CFA_STRING | CFA_LEFT | CFA_SEPARATOR;
     684    if (isCompCnr)
     685      pfi->flData |= CFA_FIREADONLY;
     686    pfi->flTitle = CFA_LEFT | CFA_FITITLEREADONLY;
     687    pfi->pTitleData = isCompCnr ? (PSZ)GetPString(IDS_STATUS) :
     688                                  (PSZ)GetPString(IDS_SUBJ);
     689    pfi->offStruct = FIELDOFFSET(CNRITEM, pszSubject);
     690    pfi->cxWidth = dsDirCnrDefault.SubjectDisplayWidth;
    659691
    660692    // Fill in column information for the file size
    661 
    662693
    663694    pfi = pfi->pNextFieldInfo;
Note: See TracChangeset for help on using the changeset viewer.