Exemple #1
0
void Server_ShowProperties (LPIDENT lpiServer, size_t nAlerts)
{
   HWND hCurrent;

   if ((hCurrent = PropCache_Search (pcSVR_PROP, lpiServer)) != NULL)
      {
      SetFocus (hCurrent);
      }
   else
      {
      TCHAR szName[ cchNAME ];
      lpiServer->GetServerName (szName);
      LPTSTR pszTitle = FormatString (IDS_SVR_PROP_TITLE, TEXT("%s"), szName);

      LPPROPSHEET psh = PropSheet_Create (pszTitle, FALSE);
      psh->fMadeCaption = TRUE;

      if ( (PropSheet_AddProblemsTab (psh, IDD_SVR_PROBLEMS, lpiServer, nAlerts)) &&
           (PropSheet_AddTab (psh, IDS_SVR_GENERAL_TAB, IDD_SVR_GENERAL, (DLGPROC)Server_General_DlgProc, (LPARAM)lpiServer, TRUE)) &&
           (PropSheet_AddTab (psh, IDS_SVR_SCOUT_TAB,   IDD_SVR_SCOUT,   (DLGPROC)Server_Scout_DlgProc,   (LPARAM)lpiServer, TRUE)) )
         {
         PropSheet_ShowModeless (psh);
         }
      }
}
Exemple #2
0
void ShowSubsetsDialog (void)
{
   LPPROPSHEET psh = PropSheet_Create (IDS_SUBSET_TAB, FALSE);
   psh->sh.hwndParent = g.hMain;

   LPSUBSET sub = Subsets_CopySubset (g.sub);
   PropSheet_AddTab (psh, 0, IDD_SUBSETS, (DLGPROC)Subsets_DlgProc, (LPARAM)sub, TRUE);
   PropSheet_ShowModal (psh, PumpMessage);
}
Exemple #3
0
void ShowOptionsDialog (void)
{
   TCHAR szCell[ cchNAME ];
   if (g.lpiCell)
      g.lpiCell->GetCellName (szCell);
   else
      AfsAppLib_GetLocalCell (szCell);

   LPPROPSHEET psh = PropSheet_Create (IDS_OPTIONS_TITLE, FALSE);
   psh->sh.hwndParent = g.hMain;
   PropSheet_AddTab (psh, IDS_OPTIONS_GENERAL_TAB, IDD_OPTIONS_GENERAL, (DLGPROC)Options_General_DlgProc, 0, TRUE);
   PropSheet_ShowModal (psh, PumpMessage);
}
Exemple #4
0
void HostsTab_OnAdd (HWND hDlg)
{
   TCHAR szTitle[ cchRESOURCE ];
   GetString (szTitle, IDS_CELLADD_TITLE);

   LPPROPSHEET psh = PropSheet_Create (szTitle, FALSE, GetParent(hDlg), 0);
   psh->sh.dwFlags |= PSH_NOAPPLYNOW;  // Remove the Apply button
   psh->sh.dwFlags |= PSH_HASHELP;     // Add a Help button instead
   PropSheet_AddTab (psh, szTitle, IDD_CELL_EDIT, (DLGPROC)CellEdit_DlgProc, 0, TRUE);
   PropSheet_ShowModal (psh);

   HostsTab_FillList (hDlg);
   HostsTab_OnSelect (hDlg);
}
Exemple #5
0
void ShowColumnsDialog (HWND hParent, LPVIEWINFO lpvi)
{
   for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
      {
      COLUMNS[ iCol ].fChanged = FALSE;
      }

   memcpy (&COLUMNS[ ceUSERS    ].vi, &gr.viewUsr, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceGROUPS   ].vi, &gr.viewGrp, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceMACHINES ].vi, &gr.viewMch, sizeof(VIEWINFO));

   if (lpvi == &gr.viewUsr)
      lpvi = &COLUMNS[ ceUSERS  ].vi;
   else if (lpvi == &gr.viewGrp)
      lpvi = &COLUMNS[ ceGROUPS ].vi;
   else if (lpvi == &gr.viewMch)
      lpvi = &COLUMNS[ ceMACHINES ].vi;

   // If the caller didn't specify which VIEWINFO structure to adjust
   // by default, pick whichever one is on the currently-displayed tab
   //
   if (!lpvi)
      {
      switch (Display_GetActiveTab())
         {
         case ttUSERS:
            lpvi = &COLUMNS[ ceUSERS ].vi;
            break;
         case ttGROUPS:
            lpvi = &COLUMNS[ ceGROUPS ].vi;
            break;
         case ttMACHINES:
            lpvi = &COLUMNS[ ceMACHINES ].vi;
            break;
         }
      }

   // Show the Columns dialog
   //
   LPPROPSHEET psh = PropSheet_Create (IDS_COLUMNS_TITLE, FALSE);
   psh->sh.hwndParent = hParent;

   ShowColumnsParams *pscp = New (ShowColumnsParams);
   pscp->hParent = hParent;
   pscp->lpviDefault = lpvi;

   PropSheet_AddTab (psh, 0, IDD_COLUMNS, (DLGPROC)Columns_DlgProc, (LPARAM)pscp, TRUE);
   PropSheet_ShowModal (psh, PumpMessage);
}
Exemple #6
0
void Aggregates_ShowProperties (LPIDENT lpiAggregate, size_t nAlerts, BOOL fJumpToThreshold, HWND hParentModal)
{
   HWND hCurrent;

   if ((hCurrent = PropCache_Search (pcAGG_PROP, lpiAggregate)) != NULL)
      {
      SetFocus (hCurrent);

      if (fJumpToThreshold)
         {
         HWND hTab;
         if ((hTab = GetDlgItem (hCurrent, IDC_PROPSHEET_TABCTRL)) != NULL)
            {
            int nTabs = TabCtrl_GetItemCount (hTab);
            TabCtrl_SetCurSel (hTab, nTabs-1);

            NMHDR nm;
            nm.hwndFrom = hTab;
            nm.idFrom = IDC_PROPSHEET_TABCTRL;
            nm.code = TCN_SELCHANGE;
            SendMessage (hCurrent, WM_NOTIFY, 0, (LPARAM)&nm);
            }
         }
      }
   else
      {
      TCHAR szSvrName[ cchNAME ];
      TCHAR szAggName[ cchNAME ];
      lpiAggregate->GetServerName (szSvrName);
      lpiAggregate->GetAggregateName (szAggName);
      LPTSTR pszTitle = FormatString (IDS_AGG_PROP_TITLE, TEXT("%s%s"), szSvrName, szAggName);

      LPPROPSHEET psh = PropSheet_Create (pszTitle, FALSE);
      psh->fMadeCaption = TRUE;
      psh->sh.hwndParent = hParentModal;

      if (PropSheet_AddProblemsTab (psh, IDD_AGG_PROBLEMS, lpiAggregate, nAlerts) &&
          PropSheet_AddTab (psh, IDS_AGG_GENERAL_TAB, IDD_AGG_GENERAL, (DLGPROC)Aggregates_General_DlgProc, (LPARAM)lpiAggregate, TRUE, FALSE))
         {
         if (fJumpToThreshold)
            psh->sh.nStartPage = psh->sh.nPages-1;

         if (hParentModal)
            PropSheet_ShowModal (psh, PumpMessage);
         else
            PropSheet_ShowModeless (psh);
         }
      }
}
Exemple #7
0
void ShowColumnsDialog (HWND hParent, LPVIEWINFO lpvi)
{
   for (size_t iCol = 0; iCol < nCOLUMNS; ++iCol)
      {
      COLUMNS[ iCol ].fChanged = FALSE;
      }

   if (gr.fPreview && !gr.fVert)
      memcpy (&COLUMNS[ ceSERVERS   ].vi, &gr.diHorz.viewSvr, sizeof(VIEWINFO));
    else
      memcpy (&COLUMNS[ ceSERVERS   ].vi, &gr.diVert.viewSvr, sizeof(VIEWINFO));

   memcpy (&COLUMNS[ ceFILESETS     ].vi, &gr.viewSet, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceAGGREGATES   ].vi, &gr.viewAgg, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceSERVICES     ].vi, &gr.viewSvc, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceREPLICAS     ].vi, &gr.viewRep, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceAGGS_MOVE    ].vi, &gr.viewAggMove, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceAGGS_CREATE  ].vi, &gr.viewAggCreate, sizeof(VIEWINFO));
   memcpy (&COLUMNS[ ceAGGS_RESTORE ].vi, &gr.viewAggRestore, sizeof(VIEWINFO));

   if (lpvi == &gr.viewSet)
      lpvi = &COLUMNS[ ceFILESETS     ].vi;
   else if (lpvi == &gr.viewAgg)
      lpvi = &COLUMNS[ ceAGGREGATES   ].vi;
   else if (lpvi == &gr.viewSvc)
      lpvi = &COLUMNS[ ceSERVICES     ].vi;
   else if (lpvi == &gr.viewRep)
      lpvi = &COLUMNS[ ceREPLICAS     ].vi;
   else if (lpvi == &gr.viewAggMove)
      lpvi = &COLUMNS[ ceAGGS_MOVE    ].vi;
   else if (lpvi == &gr.viewAggCreate)
      lpvi = &COLUMNS[ ceAGGS_CREATE  ].vi;
   else if (lpvi == &gr.viewAggRestore)
      lpvi = &COLUMNS[ ceAGGS_RESTORE ].vi;
   else
      lpvi = &COLUMNS[ ceSERVERS      ].vi;

   LPPROPSHEET psh = PropSheet_Create (IDS_COLUMNS_TITLE, FALSE);
   psh->sh.hwndParent = hParent;

   ShowColumnsParams *pscp = New (ShowColumnsParams);
   pscp->hParent = hParent;
   pscp->lpviDefault = lpvi;

   PropSheet_AddTab (psh, 0, IDD_COLUMNS, (DLGPROC)Columns_DlgProc, (LPARAM)pscp, TRUE);
   PropSheet_ShowModal (psh, PumpMessage);
}
Exemple #8
0
void Filesets_ShowProperties (LPIDENT lpiFileset, size_t nAlerts, BOOL fJumpToThreshold)
{
   HWND hCurrent;
   if ((hCurrent = PropCache_Search (pcSET_PROP, lpiFileset)) != NULL)
      {
      SetFocus (hCurrent);

      if (fJumpToThreshold)
         {
         HWND hTab;
         if ((hTab = GetDlgItem (hCurrent, IDC_PROPSHEET_TABCTRL)) != NULL)
            {
            int nTabs = TabCtrl_GetItemCount (hTab);
            TabCtrl_SetCurSel (hTab, nTabs-1);

            NMHDR nm;
            nm.hwndFrom = hTab;
            nm.idFrom = IDC_PROPSHEET_TABCTRL;
            nm.code = TCN_SELCHANGE;
            SendMessage (hCurrent, WM_NOTIFY, 0, (LPARAM)&nm);
            }
         }
      }
   else
      {
      TCHAR szCell[ cchNAME ];
      lpiFileset->GetCellName (szCell);

      TCHAR szFileset[ cchNAME ];
      lpiFileset->GetFilesetName (szFileset);

      LPTSTR pszTitle = FormatString (IDS_SET_PROP_TITLE, TEXT("%s"), szFileset);
      LPPROPSHEET psh = PropSheet_Create (pszTitle, FALSE);
      psh->fMadeCaption = TRUE;

      if (PropSheet_AddProblemsTab (psh, IDD_SET_PROBLEMS, lpiFileset, nAlerts) &&
          PropSheet_AddTab (psh, IDS_SET_GENERAL_TAB, IDD_SET_GENERAL, (DLGPROC)Filesets_General_DlgProc, (LPARAM)lpiFileset, TRUE))
         {
         if (fJumpToThreshold)
            psh->sh.nStartPage = psh->sh.nPages-1;
         PropSheet_ShowModeless (psh);
         }
      }
}
Exemple #9
0
void Server_Hosts (LPIDENT lpiServer)
{
   HWND hCurrent;
   if ((hCurrent = PropCache_Search (pcSVR_HOSTS, lpiServer)) != NULL)
      {
      SetFocus (hCurrent);
      }
   else
      {
      LPSVR_HOSTS_PARAMS lpp = New (SVR_HOSTS_PARAMS);
      memset (lpp, 0x00, sizeof(SVR_HOSTS_PARAMS));
      lpp->lpiServer = lpiServer;

      TCHAR szServer[ cchNAME ];
      lpiServer->GetServerName (szServer);
      LPTSTR pszTitle = FormatString (IDS_SVR_HOSTS_TITLE, TEXT("%s"), szServer);
      LPPROPSHEET psh = PropSheet_Create (pszTitle, FALSE);
      PropSheet_AddTab (psh, IDS_SVR_HOST_TAB, IDD_SVR_HOSTS, (DLGPROC)Server_Hosts_DlgProc, (LONG_PTR)lpp, TRUE);
      PropSheet_ShowModeless (psh);
      FreeString (pszTitle);
      }
}
Exemple #10
0
void HostsTab_OnEdit (HWND hDlg)
{
   HWND hList = GetDlgItem (hDlg, IDC_LIST);
   HLISTITEM hItem = FastList_FindFirstSelected (hList);
   if (hItem)
      {
      PCELLDBLINE pLine = (PCELLDBLINE)FastList_GetItemParam (hList, hItem);
      CELLDBLINEINFO Info;
      CSDB_CrackLine (&Info, pLine->szLine);

      LPTSTR pszTitle = FormatString (IDS_CELLEDIT_TITLE, TEXT("%s"), ((Info.szComment[0]) ? Info.szComment : Info.szCell));

      LPPROPSHEET psh = PropSheet_Create (pszTitle, FALSE, GetParent(hDlg), (LPARAM)pLine);
      psh->sh.dwFlags |= PSH_NOAPPLYNOW;  // Remove the Apply button
      psh->sh.dwFlags |= PSH_HASHELP;     // Add a Help button instead
      PropSheet_AddTab (psh, ((Info.szComment[0]) ? Info.szComment : Info.szCell), IDD_CELL_EDIT, (DLGPROC)CellEdit_DlgProc, (LPARAM)pLine, TRUE);
      PropSheet_ShowModal (psh);

      FreeString (pszTitle);
      }

   HostsTab_FillList (hDlg);
   HostsTab_OnSelect (hDlg);
}