void Filesets_Restore (LPIDENT lpiParent) { LPSET_RESTORE_PARAMS psrp = New (SET_RESTORE_PARAMS); psrp->lpi = lpiParent; psrp->szFileset[0] = TEXT('\0'); psrp->szFilename[0] = TEXT('\0'); psrp->fIncremental = FALSE; if (lpiParent && lpiParent->fIsFileset()) lpiParent->GetFilesetName (psrp->szFileset); INT_PTR rc = ModalDialogParam (IDD_SET_RESTORE, GetActiveWindow(), (DLGPROC)Filesets_Restore_DlgProc, (LPARAM)psrp); if (rc != IDOK) { Delete (psrp); } else if (!ASSERT( psrp->lpi != NULL )) { Delete (psrp); } else if (!ASSERT( psrp->szFileset[0] != TEXT('\0') )) { Delete (psrp); } else if (!ASSERT( psrp->szFilename[0] != TEXT('\0') )) { Delete (psrp); } else { StartTask (taskSET_RESTORE, NULL, psrp); } }
LPTSTR Alert_GetDescription (LPIDENT lpi, size_t iAlert, BOOL fFull) { LPOBJECTALERTS lpoa; if ((lpoa = Alert_GetObjectAlerts (lpi)) == NULL) return NULL; if (!lpoa->nAlerts && lpi->fIsServer()) { LPSERVER_PREF lpsp; if ((lpsp = (LPSERVER_PREF)lpi->GetUserParam()) != NULL) { if (!lpsp->fIsMonitored) { TCHAR szName[ cchNAME ]; lpi->GetServerName (szName); return FormatString (IDS_ALERT_DESCSHORT_UNMONITORED, TEXT("%s"), szName); } } } if (iAlert >= lpoa->nAlerts) return NULL; if (lpoa->aAlerts[ iAlert ].alert == alertSECONDARY) { return Alert_GetDescriptionFunc (lpoa->aAlerts[ iAlert ].aiSECONDARY.lpiSecondary, lpoa->aAlerts[ iAlert ].aiSECONDARY.iSecondary, lpi, fFull); } return Alert_GetDescriptionFunc (lpi, iAlert, NULL, fFull); }
void Server_CloseAll (BOOL fUserRequested) { HWND hWnd; while ((hWnd = PropCache_Search (pcSERVER, ANYVALUE)) != NULL) { LPIDENT lpiServer = Server_GetServer (hWnd); Server_SaveRect (hWnd, !fUserRequested); DestroyWindow (hWnd); if (lpiServer && fUserRequested) { // If there's a subset active, the user may want us to stop // monitoring this server once its window is closed. // LPSERVER_PREF lpsp; if ((lpsp = (LPSERVER_PREF)lpiServer->GetUserParam()) != NULL) { if (g.sub && gr.fCloseUnmonitors && lpsp->fIsMonitored) { StartTask (taskSVR_MONITOR_ONOFF, NULL, lpiServer); } } } } }
void Server_SyncVLDB_OnInitDialog (HWND hDlg, LPIDENT lpi) { if (lpi->fIsServer()) { TCHAR szServer[ cchNAME ]; lpi->GetServerName (szServer); LPTSTR pszText = FormatString (IDS_SYNCVLDB_SVR_DESC, TEXT("%s"), szServer); SetDlgItemText (hDlg, IDC_SYNC_DESC, pszText); FreeString (pszText); pszText = FormatString (IDS_SYNCVLDB_SVR_DESC2, TEXT("%s"), szServer); SetDlgItemText (hDlg, IDC_SYNC_DESC2, pszText); FreeString (pszText); ShowWindow (hDlg, SW_SHOW); } else // (lpi->fIsAggregate()) { TCHAR szServer[ cchNAME ]; lpi->GetServerName (szServer); TCHAR szAggregate[ cchNAME ]; lpi->GetAggregateName (szAggregate); LPTSTR pszText = FormatString (IDS_SYNCVLDB_AGG_DESC, TEXT("%s%s"), szServer, szAggregate); SetDlgItemText (hDlg, IDC_SYNC_DESC, pszText); FreeString (pszText); pszText = FormatString (IDS_SYNCVLDB_AGG_DESC2, TEXT("%s%s"), szServer, szAggregate); SetDlgItemText (hDlg, IDC_SYNC_DESC2, pszText); FreeString (pszText); StartTask (taskAGG_FIND_GHOST, hDlg, lpi); } }
void Filesets_General_OnInitDialog (HWND hDlg, LPIDENT lpi) { TCHAR szText[ cchRESOURCE ]; TCHAR szSvrName[ cchNAME ]; TCHAR szAggName[ cchNAME ]; TCHAR szSetName[ cchNAME ]; VOLUMEID vidFileset; lpi->GetServerName (szSvrName); lpi->GetAggregateName (szAggName); lpi->GetFilesetName (szSetName); lpi->GetFilesetID (&vidFileset); GetDlgItemText (hDlg, IDC_SET_NAME, szText, cchRESOURCE); LPTSTR pszText = FormatString (szText, TEXT("%s%s%s"), szSvrName, szAggName, szSetName); SetDlgItemText (hDlg, IDC_SET_NAME, pszText); FreeString (pszText); pszText = FormatString (TEXT("%1"), TEXT("%lu"), vidFileset); SetDlgItemText (hDlg, IDC_SET_ID, pszText); FreeString (pszText); EnableWindow (GetDlgItem (hDlg, IDC_SET_LOCK), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_UNLOCK), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_QUOTA), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_DEF), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_PERCENT), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_DESC), FALSE); }
void Aggregates_ShowPopupMenu (HWND hList, POINT ptList, POINT ptScreen) { if (!ptScreen.x && !ptScreen.y) { RECT rWindow; GetWindowRect (hList, &rWindow); ptScreen.x = rWindow.left + (rWindow.right -rWindow.left)/2; ptScreen.y = rWindow.top + (rWindow.bottom -rWindow.top)/2; Aggregates_ShowParticularPopupMenu (hList, ptScreen, NULL); } else if (FL_HitTestForHeaderBar (hList, ptList)) { HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS); DisplayContextMenu (hm, ptScreen, hList); } else { LPIDENT lpiSelected = NULL; HLISTITEM hItem; if ((hItem = FastList_ItemFromPoint (hList, &ptList, TRUE)) != NULL) lpiSelected = (LPIDENT)FastList_GetItemParam (hList, hItem); if (lpiSelected && (lpiSelected != (LPIDENT)FL_GetSelectedData (hList))) lpiSelected = NULL; if (lpiSelected && lpiSelected->fIsServer()) Server_ShowParticularPopupMenu (hList, ptScreen, lpiSelected); else Aggregates_ShowParticularPopupMenu (hList, ptScreen, lpiSelected); } }
DWORD WINAPI AfsAdmSvr_AutoOpen_ThreadProc (PVOID lp) { DWORD dwScope = PtrToUlong(lp); ULONG status; if (!l.fOperational) return 0; // First we'll have to find out which cell to open // TCHAR szCell[ cchNAME ]; if (!CELL::GetDefaultCell (szCell, &status)) { Print (dlERROR, TEXT("CELL::GetDefaultCell failed; error 0x%08lX"), status); } else { // Then try to actually open the cell // Print (dlSTANDARD, TEXT("Auto-opening cell %s; scope=%s"), szCell, (dwScope == (AFSADMSVR_SCOPE_VOLUMES | AFSADMSVR_SCOPE_USERS)) ? TEXT("full") : (dwScope == AFSADMSVR_SCOPE_VOLUMES) ? TEXT("volumes") : TEXT("users")); LPIDENT lpiCell; if ((lpiCell = CELL::OpenCell ((LPTSTR)szCell, &status)) == NULL) { Print (dlERROR, TEXT("Auto-open of cell %s failed; error 0x%08lX"), szCell, status); } else { LPCELL lpCell; if ((lpCell = lpiCell->OpenCell (&status)) == NULL) { Print (dlERROR, TEXT("Auto-open: OpenCell failed; error 0x%08lX"), status); } else { AfsAdmSvr_AddToMinScope (dwScope); if (!lpCell->RefreshAll (&status)) Print (dlERROR, TEXT("Auto-open: RefreshCell failed; error 0x%08lX"), status); else Print (dlSTANDARD, TEXT("Auto-open of cell %s successful"), szCell); lpCell->Close(); // We intentionally do not call CELL::CloseCell() here--as would // ordinarily be necessary to balance our CELL::OpenCell() call // above--because we never want to close our cache for this cell. // The point of calling AutoOpen() up front is to keep an admin // server alive and ready for use on a particular cell--calling // CELL::CloseCell() here negates that purpose. } } } return 0; }
BOOL Filesets_BeginDrag (HWND hDlg, BOOL fRightBtn) { LPIDENT lpi = Filesets_GetFocused (hDlg); if (!lpi || !lpi->fIsFileset()) // can only drag filesets! return FALSE; l.fRightBtn = fRightBtn; StartTask (taskSET_BEGINDRAG, hDlg, lpi); return TRUE; }
void Server_Scout_OnEndTask_Apply (HWND hDlg, LPTASKPACKET ptp) { if (!ptp->rc) { LPIDENT lpiServer = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); TCHAR szText[ cchNAME ]; lpiServer->GetServerName (szText); ErrorDialog (ptp->status, IDS_ERROR_CHANGE_SERVER_STATUS, TEXT("%s"), szText); } }
void Alert_BeginUpdate (LPIDENT lpi, LPSERVER *ppServer) { if (lpi->fIsServer()) { *ppServer = NULL; } else { *ppServer = lpi->OpenServer(); } }
void Aggregates_General_OnEndTask_Apply (HWND hDlg, LPTASKPACKET ptp) { if (!ptp->rc) { LPIDENT lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); TCHAR szSvrName[ cchNAME ]; TCHAR szAggName[ cchNAME ]; lpi->GetServerName (szSvrName); lpi->GetAggregateName (szAggName); ErrorDialog (ptp->status, IDS_ERROR_CHANGE_AGGREGATE_STATUS, TEXT("%s%s"), szSvrName, szAggName); } }
void Server_Salvage_OnServer (HWND hDlg, LPIDENT lpi) { LPIDENT lpiServer; if ((lpiServer = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SERVER))) != NULL) { LPAGG_ENUM_TO_COMBOBOX_PACKET lpp = New (AGG_ENUM_TO_COMBOBOX_PACKET); memset (lpp, 0x00, sizeof(AGG_ENUM_TO_COMBOBOX_PACKET)); lpp->hCombo = GetDlgItem (hDlg, IDC_AGGREGATE); lpp->lpiServer = lpiServer; lpp->lpiSelect = (lpi && (!lpi->fIsCell()) && (!lpi->fIsServer()) && (lpiServer == lpi->GetServer())) ? (lpi->GetAggregate()) : NULL; StartTask (taskAGG_ENUM_TO_COMBOBOX, hDlg, lpp); } }
void Filesets_ContinueDrag (HWND hDlg) { if (l.fDragging) { LPIDENT lpi = NULL; HLISTITEM hItemTarget; DWORD dw = GetMessagePos(); POINT pt = { LOWORD(dw), HIWORD(dw) }; HWND hTarget = WindowFromPoint (pt); if (hTarget != NULL) { POINT ptClient = pt; ScreenToClient (hTarget, &ptClient); if ((lpi = IdentifyPoint (hTarget, ptClient, &hItemTarget)) != NULL) { if (!lpi->fIsServer() && !lpi->fIsAggregate()) lpi = NULL; } } if (lpi != l.lpiTarget) { ImageList_DragLeave (NULL); if (l.hItemTarget) { LPARAM dwFlags = FastList_GetItemFlags (l.hwndTarget, l.hItemTarget); FastList_SetItemFlags (l.hwndTarget, l.hItemTarget, dwFlags & (~FLIF_DROPHIGHLIGHT)); l.hItemTarget = NULL; l.lpiTarget = NULL; } if ((l.lpiTarget = lpi) != NULL) { l.hwndTarget = hTarget; l.hItemTarget = hItemTarget; LPARAM dwFlags = FastList_GetItemFlags (l.hwndTarget, l.hItemTarget); FastList_SetItemFlags (l.hwndTarget, l.hItemTarget, dwFlags | FLIF_DROPHIGHLIGHT); } ScreenToClient (NULL, &pt); ImageList_DragEnter (NULL, pt.x, pt.y); } ImageList_DragMove (LOWORD(dw), HIWORD(dw)); } }
void Services_Delete_OnInitDialog (HWND hDlg, LPIDENT lpi) { TCHAR szServer[ cchNAME ]; TCHAR szService[ cchNAME ]; lpi->GetServerName (szServer); lpi->GetServiceName (szService); TCHAR szOld[ cchRESOURCE ]; GetDlgItemText (hDlg, IDC_DELSVC_DESC, szOld, cchRESOURCE); LPTSTR pszNew = FormatString (szOld, TEXT("%s%s"), szServer, szService); SetDlgItemText (hDlg, IDC_DELSVC_DESC, pszNew); FreeString (pszNew); }
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); } } }
void Filesets_OnSelect (HWND hDlg) { LPIDENT lpi = Filesets_GetSelected (hDlg); if (!lpi || !lpi->fIsFileset()) { EnableWindow (GetDlgItem (hDlg, IDC_SET_REP), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_DELETE), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SET_SETQUOTA), FALSE); } else { StartTask (taskSET_SELECT, hDlg, lpi); } }
void Server_Salvage_OnEndTask_Salvage (HWND hDlg, LPIDENT lpiSalvage, LPTASKPACKET ptp) { if (!ptp->rc) { ErrorDialog (ptp->status, IDS_ERROR_CANT_SALVAGE); DestroyWindow (hDlg); } else { if (TASKDATA(ptp)->pszText1) { SetDlgItemText (hDlg, IDC_SALVAGE_DETAILS, TASKDATA(ptp)->pszText1); } else { TCHAR szServer[ cchNAME ]; lpiSalvage->GetServerName (szServer); LPTSTR pszNoLog = FormatString (IDS_ERROR_CANT_READ_SALVAGE_LOG, TEXT("%s"), szServer); SetDlgItemText (hDlg, IDC_SALVAGE_DETAILS, pszNoLog); FreeString (pszNoLog); } ShowWindow (hDlg, SW_SHOW); } }
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); } } }
void Server_SelectServer (HWND hDlg, LPIDENT lpiNew, BOOL fForceRedraw) { LPIDENT lpiOld = Server_GetServer (hDlg); if (lpiNew != lpiOld) { SetWindowLongPtr (hDlg, DWLP_USER, (LONG_PTR)lpiNew); if (hDlg != g.hMain) { if (lpiOld) PropCache_Delete (pcSERVER, lpiOld); if (lpiNew) { PropCache_Add (pcSERVER, lpiNew, hDlg); TCHAR szName[ cchNAME ]; lpiNew->GetServerName (szName); LPTSTR pszTitle = FormatString (IDS_SERVER_TITLE, TEXT("%s"), szName); SetWindowText (hDlg, pszTitle); FreeString (pszTitle); } } fForceRedraw = TRUE; } if (fForceRedraw) { Server_ForceRedraw (hDlg); } }
LPTSTR Alert_GetQuickDescription (LPIDENT lpi) { LPTSTR pszStatus = NULL; size_t cAlerts; if ((cAlerts = Alert_GetCount (lpi)) <= 1) pszStatus = Alert_GetDescription (lpi, 0, FALSE); else if (lpi->fIsServer()) pszStatus = FormatString (IDS_SERVER_MULTIPLE_PROBLEMS, TEXT("%lu"), cAlerts); else if (lpi->fIsService()) pszStatus = FormatString (IDS_SERVICE_MULTIPLE_PROBLEMS, TEXT("%lu"), cAlerts); else if (lpi->fIsAggregate()) pszStatus = FormatString (IDS_AGGREGATE_MULTIPLE_PROBLEMS, TEXT("%lu"), cAlerts); else if (lpi->fIsFileset()) pszStatus = FormatString (IDS_FILESET_MULTIPLE_PROBLEMS, TEXT("%lu"), cAlerts); return pszStatus; }
void Server_Salvage_OnEndTask_EnumServers (HWND hDlg, LPIDENT lpi, LPTASKPACKET ptp) { // We'll only fill the Servers list once, and that during initialization. // When the filling completes, find out what server is currently selected // (it should already be the one the user chose earlier), and fill the // aggregates list for it. We won't enable anything yet. // LPIDENT lpiServer; if ((lpiServer = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SERVER))) != NULL) { LPAGG_ENUM_TO_COMBOBOX_PACKET lpp = New (AGG_ENUM_TO_COMBOBOX_PACKET); memset (lpp, 0x00, sizeof(AGG_ENUM_TO_COMBOBOX_PACKET)); lpp->hCombo = GetDlgItem (hDlg, IDC_AGGREGATE); lpp->lpiServer = lpiServer; lpp->lpiSelect = (lpi && (!lpi->fIsCell()) && (!lpi->fIsServer()) && (lpiServer == lpi->GetServer())) ? (lpi->GetAggregate()) : NULL; StartTask (taskAGG_ENUM_TO_COMBOBOX, hDlg, lpp); } }
void Server_Salvage_OnAggregate (HWND hDlg, LPIDENT lpi) { LPIDENT lpiServer; if ((lpiServer = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SERVER))) != NULL) { LPIDENT lpiAggregate; if ((lpiAggregate = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_AGGREGATE))) != NULL) { LPSET_ENUM_TO_COMBOBOX_PACKET lpp = New (SET_ENUM_TO_COMBOBOX_PACKET); memset (lpp, 0x00, sizeof(SET_ENUM_TO_COMBOBOX_PACKET)); lpp->hCombo = GetDlgItem (hDlg, IDC_FILESET); lpp->lpiServer = lpiServer; lpp->lpiAggregate = lpiAggregate; lpp->lpiSelect = ((lpiServer == lpi) && (lpi->fIsFileset())) ? (lpi->GetFileset()) : NULL; StartTask (taskSET_ENUM_TO_COMBOBOX, hDlg, lpp); } } }
void Server_SyncVLDB_OnEndTask_Init (HWND hDlg, LPTASKPACKET ptp) { if (ptp->rc && (!(TASKDATA(ptp)->wGhost & GHOST_HAS_SERVER_ENTRY))) { LPIDENT lpi = (LPIDENT)( ptp->lpUser ); TCHAR szServer[ cchNAME ]; lpi->GetServerName (szServer); TCHAR szAggregate[ cchNAME ]; lpi->GetAggregateName (szAggregate); ErrorDialog (0, IDS_ERROR_CANT_SYNC_GHOST_AGGREGATE, TEXT("%s%s"), szServer, szAggregate); DestroyWindow (hDlg); return; } ShowWindow (hDlg, SW_SHOW); }
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); } } }
LPTSTR Server_GetColumnText (LPIDENT lpi, SERVERCOLUMN svrcol) { static TCHAR aszBuffer[ nSERVERCOLUMNS ][ cchRESOURCE ]; static size_t iBufferNext = 0; LPTSTR pszBuffer = aszBuffer[ iBufferNext++ ]; if (iBufferNext == nSERVERCOLUMNS) iBufferNext = 0; *pszBuffer = TEXT('\0'); LPSERVERSTATUS lpss = NULL; LPSERVER_PREF lpsp; if ((lpsp = (LPSERVER_PREF)lpi->GetUserParam()) != NULL) { lpss = &lpsp->ssLast; } switch (svrcol) { case svrcolNAME: lpi->GetServerName (pszBuffer); break; case svrcolADDRESS: if (lpss) FormatSockAddr (pszBuffer, TEXT("%a"), &lpss->aAddresses[0]); break; case svrcolSTATUS: { LPTSTR pszDesc; if ((pszDesc = Alert_GetQuickDescription (lpi)) == NULL) GetString (pszBuffer, IDS_STATUS_NOALERTS); else { lstrcpy (pszBuffer, pszDesc); FreeString (pszDesc); } } break; } return pszBuffer; }
void Server_General_OnInitDialog (HWND hDlg, LPIDENT lpiServer) { TCHAR szText[ cchRESOURCE ]; lpiServer->GetServerName (szText); SetDlgItemText (hDlg, IDC_SVR_NAME, szText); EnableWindow (GetDlgItem (hDlg, IDC_SVR_AUTH_YES), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SVR_AUTH_NO), FALSE); EnableWindow (GetDlgItem (hDlg, IDC_SVR_CHANGEADDR), FALSE); }
void Filesets_Release_OnInitDialog (HWND hDlg, LPIDENT lpi) { TCHAR szServer[ cchNAME ]; TCHAR szAggregate[ cchNAME ]; TCHAR szFileset[ cchNAME ]; lpi->GetServerName (szServer); lpi->GetAggregateName (szAggregate); lpi->GetFilesetName (szFileset); TCHAR szOld[ cchRESOURCE ]; GetDlgItemText (hDlg, IDC_RELSET_DESC, szOld, cchRESOURCE); LPTSTR pszText = FormatString (szOld, TEXT("%s%s%s"), szServer, szAggregate, szFileset); SetDlgItemText (hDlg, IDC_RELSET_DESC, pszText); FreeString (pszText); CheckDlgButton (hDlg, IDC_RELSET_NORMAL, TRUE); CheckDlgButton (hDlg, IDC_RELSET_FORCE, FALSE); }
void Filesets_ShowPopupMenu (HWND hList, POINT ptList, POINT ptScreen) { if (!ptScreen.x && !ptScreen.y) { RECT rWindow; GetWindowRect (hList, &rWindow); ptScreen.x = rWindow.left + (rWindow.right -rWindow.left)/2; ptScreen.y = rWindow.top + (rWindow.bottom -rWindow.top)/2; Filesets_ShowParticularPopupMenu (hList, ptScreen, NULL); } else if (FL_HitTestForHeaderBar (hList, ptList)) { HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS); DisplayContextMenu (hm, ptScreen, hList); } else { LPIDENT lpi = Filesets_GetFocused (GetParent (hList), &ptList); if (lpi && (lpi != Filesets_GetSelected (GetParent (hList)))) { lpi = NULL; // right-click on item other than highlighted one? } if (lpi && lpi->fIsFileset()) { Filesets_ShowParticularPopupMenu (hList, ptScreen, lpi); } else if (lpi && lpi->fIsAggregate()) { Aggregates_ShowParticularPopupMenu (hList, ptScreen, lpi); } else if (lpi && lpi->fIsServer()) { Server_ShowParticularPopupMenu (hList, ptScreen, lpi); } else if (!lpi) // display the _NONE menu? (no menu if it's a cell ident) { Filesets_ShowParticularPopupMenu (hList, ptScreen, lpi); } } }
BOOL GetPreferencesInfo (LPIDENT lpi, LPTSTR pszPath, WORD *pwVer) { if (lpi == NULL) return FALSE; // HKCU\Software\...\SVRMgr + \CellName // lstrcpy (pszPath, REGSTR_SETTINGS_PREFS); lstrcat (pszPath, TEXT("\\")); lpi->GetCellName (&pszPath[ lstrlen(pszPath) ]); // HKCU\Software\...\SVRMgr\CellName + \ServerName // lstrcat (pszPath, TEXT("\\")); lpi->GetLongServerName (&pszPath[ lstrlen(pszPath) ]); *pwVer = wVerSERVER_PREF; if (lpi->fIsService()) { // HKCU\Software\...\SVRMgr\CellName\ServerName + \Services\ServiceName // lstrcat (pszPath, TEXT("\\")); lstrcat (pszPath, SERVICES_KW); lstrcat (pszPath, TEXT("\\")); lpi->GetServiceName (&pszPath[ lstrlen(pszPath) ]); *pwVer = wVerSERVICE_PREF; } else if (lpi->fIsAggregate()) { // HKCU\Software\...\SVRMgr\CellName\ServerName + \Aggs\AggregateName // lstrcat (pszPath, TEXT("\\")); lstrcat (pszPath, AGGREGATES_KW); lstrcat (pszPath, TEXT("\\")); lpi->GetAggregateName (&pszPath[ lstrlen(pszPath) ]); *pwVer = wVerAGGREGATE_PREF; } else if (lpi->fIsFileset()) { // HKCU\Software\...\SVRMgr\CellName\ServerName + \Filesets\FilesetName // lstrcat (pszPath, TEXT("\\")); lstrcat (pszPath, FILESETS_KW); lstrcat (pszPath, TEXT("\\")); lpi->GetFilesetName (&pszPath[ lstrlen(pszPath) ]); *pwVer = wVerFILESET_PREF; } return TRUE; }
BOOL Aggregates_SavePreferences (LPIDENT lpiAggregate) { BOOL rc = FALSE; PVOID pap = lpiAggregate->GetUserParam(); if (pap != NULL) { rc = StorePreferences (lpiAggregate, pap, sizeof(AGGREGATE_PREF)); } return rc; }