Changeset 1424 for trunk/dll/notebook.c


Ignore:
Timestamp:
Jun 6, 2009, 9:16:12 PM (16 years ago)
Author:
Gregg Young
Message:

Show either file system type or drive label beside dirve letter in tree. (tickets 47 & 339)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/notebook.c

    r1409 r1424  
    155155BOOL fSeparateParms;
    156156BOOL fShowEnv;
     157BOOL fShowLabel;
     158BOOL fShowSysType;
    157159BOOL fShowTarget;
    158160BOOL fStartMaximized;
     
    13621364    WinCheckButton(hwnd, CFGT_SHOWENV, fShowEnv);
    13631365    WinSetDlgItemText(hwnd, CFGT_ENVVARLIST, pszTreeEnvVarList);
     1366    {
     1367      long th = fShowLabel ? 2 : (fShowSysType ? 1 : 0);
     1368      WinCheckButton(hwnd, CFGT_SYSTYPELABEL, th);
     1369    }
    13641370    return 0;
    13651371
     
    14111417
    14121418  case WM_CLOSE:
    1413     fVTreeOpensWPS = WinQueryButtonCheckstate(hwnd, CFGT_VTREEOPENSWPS);
    1414     PrfWriteProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS,
    1415                         sizeof(BOOL));
    1416     fCollapseFirst = WinQueryButtonCheckstate(hwnd, CFGT_COLLAPSEFIRST);
    1417     PrfWriteProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst,
    1418                         sizeof(BOOL));
    1419     fSwitchTreeOnFocus = WinQueryButtonCheckstate(hwnd,
    1420                                                   CFGT_SWITCHTREEONFOCUS);
    1421     PrfWriteProfileData(fmprof, appname, "SwitchTreeOnFocus",
    1422                         &fSwitchTreeOnFocus, sizeof(BOOL));
    1423     fSwitchTreeExpand = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEEXPAND);
    1424     PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand",
    1425                         &fSwitchTreeExpand, sizeof(BOOL));
    1426     fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE);
    1427     PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree,
    1428                         sizeof(BOOL));
    1429     fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE);
    1430     PrfWriteProfileData(fmprof, appname, "FollowTree", &fFollowTree,
    1431                         sizeof(BOOL));
    1432     fTopDir = WinQueryButtonCheckstate(hwnd, CFGT_TOPDIR);
    1433     PrfWriteProfileData(fmprof, appname, "TopDir", (PVOID) & fTopDir,
    1434                         sizeof(BOOL));
    1435     fDCOpens = WinQueryButtonCheckstate(hwnd, CFGT_DCOPENS);
    1436     PrfWriteProfileData(fmprof, FM3Str, "DoubleClickOpens", &fDCOpens,
    1437                         sizeof(BOOL));
    1438     fShowEnvChanged = (fShowEnv != WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV));
    1439     fShowEnv = WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV);
    1440     PrfWriteProfileData(fmprof, appname, "ShowEnv", &fShowEnv, sizeof(BOOL));
    14411419    {
    1442       char * pszTemp = xmalloc(WinQueryDlgItemTextLength(hwnd, CFGT_ENVVARLIST) + 1, pszSrcFile, __LINE__);
    1443       if (pszTemp) {
    1444         WinQueryDlgItemText(hwnd, CFGT_ENVVARLIST, MaxComLineStrg, pszTemp);
    1445         strupr(pszTemp);
    1446         if (strcmp(pszTemp, pszTreeEnvVarList)) {
    1447           fTreeEnvVarListChanged = TRUE;
    1448           strcpy(pszTreeEnvVarList, pszTemp);
    1449           PrfWriteProfileString(fmprof, appname, "TreeEnvVarList", pszTreeEnvVarList);
    1450         }
    1451         free(pszTemp);
    1452       }
    1453       if (hwndTree && (fShowEnvChanged || (fShowEnv && fTreeEnvVarListChanged)))
     1420      long test;
     1421 
     1422      test = WinQueryButtonCheckstate(hwnd, CFGT_SYSTYPELABEL);
     1423      fShowSysType = (test == 1);
     1424      fShowLabel = (test == 2);
     1425      PrfWriteProfileData(fmprof, FM3Str, "ShowSysType", &fShowSysType, sizeof(BOOL));
     1426      PrfWriteProfileData(fmprof,       FM3Str, "ShowLabel", &fShowLabel, sizeof(BOOL));
     1427      fVTreeOpensWPS = WinQueryButtonCheckstate(hwnd, CFGT_VTREEOPENSWPS);
     1428      PrfWriteProfileData(fmprof, FM3Str, "VTreeOpensWPS", &fVTreeOpensWPS,
     1429                          sizeof(BOOL));
     1430      fCollapseFirst = WinQueryButtonCheckstate(hwnd, CFGT_COLLAPSEFIRST);
     1431      PrfWriteProfileData(fmprof, appname, "CollapseFirst", &fCollapseFirst,
     1432                          sizeof(BOOL));
     1433      fSwitchTreeOnFocus = WinQueryButtonCheckstate(hwnd,
     1434                                                    CFGT_SWITCHTREEONFOCUS);
     1435      PrfWriteProfileData(fmprof, appname, "SwitchTreeOnFocus",
     1436                          &fSwitchTreeOnFocus, sizeof(BOOL));
     1437      fSwitchTreeExpand = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREEEXPAND);
     1438      PrfWriteProfileData(fmprof, appname, "SwitchTreeExpand",
     1439                          &fSwitchTreeExpand, sizeof(BOOL));
     1440      fSwitchTree = WinQueryButtonCheckstate(hwnd, CFGT_SWITCHTREE);
     1441      PrfWriteProfileData(fmprof, appname, "SwitchTree", &fSwitchTree,
     1442                          sizeof(BOOL));
     1443      fFollowTree = WinQueryButtonCheckstate(hwnd, CFGT_FOLLOWTREE);
     1444      PrfWriteProfileData(fmprof, appname, "FollowTree", &fFollowTree,
     1445                          sizeof(BOOL));
     1446      fTopDir = WinQueryButtonCheckstate(hwnd, CFGT_TOPDIR);
     1447      PrfWriteProfileData(fmprof, appname, "TopDir", (PVOID) & fTopDir,
     1448                          sizeof(BOOL));
     1449      fDCOpens = WinQueryButtonCheckstate(hwnd, CFGT_DCOPENS);
     1450      PrfWriteProfileData(fmprof, FM3Str, "DoubleClickOpens", &fDCOpens,
     1451                          sizeof(BOOL));
     1452      fShowEnvChanged = (fShowEnv != WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV));
     1453      fShowEnv = WinQueryButtonCheckstate(hwnd, CFGT_SHOWENV);
     1454      PrfWriteProfileData(fmprof, appname, "ShowEnv", &fShowEnv, sizeof(BOOL));
    14541455      {
    1455         PCNRITEM pci = WinSendMsg(WinWindowFromID
    1456                 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), CM_QUERYRECORDEMPHASIS,
    1457                                   MPFROMLONG(CMA_FIRST),
    1458                                   MPFROMSHORT(CRA_SELECTED));
    1459         PostMsg(WinWindowFromID
    1460                 (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), WM_COMMAND,
    1461                 MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
    1462         pszTemp = xstrdup(pci->pszFileName, pszSrcFile, __LINE__);
    1463         if (pszTemp) {
    1464           if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTemp), MPVOID))
    1465             free(pszTemp);
    1466           /* pszTemp is freed in the UM_SHOWME code */
    1467         }
    1468       }
    1469     }
    1470     break;
     1456        char * pszTemp = xmalloc(WinQueryDlgItemTextLength(hwnd, CFGT_ENVVARLIST) + 1, pszSrcFile, __LINE__);
     1457        if (pszTemp) {
     1458          WinQueryDlgItemText(hwnd, CFGT_ENVVARLIST, MaxComLineStrg, pszTemp);
     1459          strupr(pszTemp);
     1460          if (strcmp(pszTemp, pszTreeEnvVarList)) {
     1461            fTreeEnvVarListChanged = TRUE;
     1462            strcpy(pszTreeEnvVarList, pszTemp);
     1463            PrfWriteProfileString(fmprof, appname, "TreeEnvVarList", pszTreeEnvVarList);
     1464          }
     1465          free(pszTemp);
     1466        }
     1467        if (hwndTree && (fShowEnvChanged || (fShowEnv && fTreeEnvVarListChanged)))
     1468        {
     1469          PCNRITEM pci = WinSendMsg(WinWindowFromID
     1470                  (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), CM_QUERYRECORDEMPHASIS,
     1471                                    MPFROMLONG(CMA_FIRST),
     1472                                    MPFROMSHORT(CRA_SELECTED));
     1473          PostMsg(WinWindowFromID
     1474                  (WinWindowFromID(hwndTree, FID_CLIENT), TREE_CNR), WM_COMMAND,
     1475                  MPFROM2SHORT(IDM_RESCAN, 0), MPVOID);
     1476          pszTemp = xstrdup(pci->pszFileName, pszSrcFile, __LINE__);
     1477          if (pszTemp) {
     1478            if (!PostMsg(hwndTree, UM_SHOWME, MPFROMP(pszTemp), MPVOID))
     1479              free(pszTemp);
     1480            /* pszTemp is freed in the UM_SHOWME code */
     1481          }
     1482        }
     1483      }
     1484      break;
     1485    }
    14711486  }
    14721487  return WinDefDlgProc(hwnd, msg, mp1, mp2);
Note: See TracChangeset for help on using the changeset viewer.