void Server_Scout_OnApply (HWND hDlg, LPIDENT lpiServer) { LPSVR_SCOUT_APPLY_PACKET lpp; if ((lpp = New (SVR_SCOUT_APPLY_PACKET)) != NULL) { lpp->lpiServer = lpiServer; lpp->fIDC_SVR_WARN_AGGFULL = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_AGGFULL); lpp->wIDC_SVR_WARN_AGGFULL_PERCENT = (short)SP_GetPos (GetDlgItem (hDlg, IDC_SVR_WARN_AGGFULL_PERCENT)); lpp->fIDC_SVR_WARN_SETFULL = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_SETFULL); lpp->wIDC_SVR_WARN_SETFULL_PERCENT = (short)SP_GetPos (GetDlgItem (hDlg, IDC_SVR_WARN_SETFULL_PERCENT)); lpp->fIDC_SVR_WARN_AGGALLOC = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_AGGALLOC); lpp->fIDC_SVR_WARN_SVCSTOP = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_SVCSTOP); lpp->fIDC_SVR_WARN_TIMEOUT = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_TIMEOUT); lpp->fIDC_SVR_WARN_SETNOVLDB = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_SETNOVLDB); lpp->fIDC_SVR_WARN_SETNOSERV = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_SETNOSERV); lpp->fIDC_SVR_WARN_AGGNOSERV = IsDlgButtonChecked (hDlg, IDC_SVR_WARN_AGGNOSERV); lpp->fIDC_SVR_AUTOREFRESH = IsDlgButtonChecked (hDlg, IDC_SVR_AUTOREFRESH); lpp->dwIDC_SVR_AUTOREFRESH_MINUTES = SP_GetPos (GetDlgItem (hDlg, IDC_SVR_AUTOREFRESH_MINUTES)); StartTask (taskSVR_SCOUT_APPLY, hDlg, lpp); } }
void Diag_OnOK (HWND hDlg) { nTraceBufSize = SP_GetPos (GetDlgItem (hDlg, IDC_TRACE_LOG_BUF_SIZE)); fTrapOnPanic = CB_GetSelected (GetDlgItem (hDlg, IDC_TRAP_ON_PANIC)); fReportSessionStartups = CB_GetSelected (GetDlgItem (hDlg, IDC_REPORT_SESSION_STARTUPS)); EndDialog(hDlg, IDOK); }
void Misc_OnOK (HWND hDlg) { #if undef nLanAdapter = (IsDlgButtonChecked(hDlg,IDC_AUTOLANA))?-1 :SP_GetPos (GetDlgItem (hDlg, IDC_LAN_ADAPTER)); #endif csecProbe = SP_GetPos (GetDlgItem (hDlg, IDC_PROBE)); nThreads = SP_GetPos (GetDlgItem (hDlg, IDC_THREADS)); nDaemons = SP_GetPos (GetDlgItem (hDlg, IDC_DAEMONS)); GetDlgItemText (hDlg, IDC_SYSNAME, szSysName, sizeof(szSysName)); GetDlgItemText (hDlg, IDC_ROOTVOLUME, szRootVolume, sizeof(szRootVolume)); GetDlgItemText (hDlg, IDC_MOUNTDIR, szMountDir, sizeof(szMountDir)); EndDialog(hDlg, IDOK); }
void Filesets_General_OnApply (HWND hDlg, LPIDENT lpi) { LPSET_PROP_APPLY_PARAMS lpp = New (SET_PROP_APPLY_PARAMS); lpp->lpi = lpi; lpp->fIDC_SET_WARN = IsDlgButtonChecked (hDlg, IDC_SET_WARN); lpp->fIDC_SET_WARN_SETFULL_DEF = IsDlgButtonChecked (hDlg, IDC_SET_WARN_SETFULL_DEF); lpp->wIDC_SET_WARN_SETFULL_PERCENT = (WORD)SP_GetPos (GetDlgItem (hDlg, IDC_SET_WARN_SETFULL_PERCENT)); StartTask (taskSET_PROP_APPLY, hDlg, lpp); }
void Aggregates_General_OnApply (HWND hDlg) { LPAGG_PROP_APPLY_PACKET lpp; if ((lpp = New (AGG_PROP_APPLY_PACKET)) != NULL) { lpp->lpi = (LPIDENT)GetWindowLongPtr (hDlg, DWLP_USER); lpp->fIDC_AGG_WARNALLOC = IsDlgButtonChecked (hDlg, IDC_AGG_WARNALLOC); lpp->fIDC_AGG_WARN = IsDlgButtonChecked (hDlg, IDC_AGG_WARN); lpp->fIDC_AGG_WARN_AGGFULL_DEF = IsDlgButtonChecked (hDlg, IDC_AGG_WARN_AGGFULL_DEF); lpp->wIDC_AGG_WARN_AGGFULL_PERCENT = (short)SP_GetPos (GetDlgItem (hDlg, IDC_AGG_WARN_AGGFULL_PERCENT)); StartTask (taskAGG_PROP_APPLY, hDlg, lpp); } }
void Server_Salvage_OnOK (HWND hDlg) { // Prepare a taskSVR_SALVAGE packet // LPSVR_SALVAGE_PARAMS lpp = New (SVR_SALVAGE_PARAMS); memset (lpp, 0x00, sizeof(SVR_SALVAGE_PARAMS)); GetDlgItemText (hDlg, IDC_SALVAGE_TEMPDIR, lpp->szTempDir, MAX_PATH); GetDlgItemText (hDlg, IDC_SALVAGE_LOG_FILE, lpp->szLogFile, MAX_PATH); lpp->fForce = IsDlgButtonChecked (hDlg, IDC_SALVAGE_FORCE); lpp->fReadonly = IsDlgButtonChecked (hDlg, IDC_SALVAGE_READONLY); lpp->fLogInodes = IsDlgButtonChecked (hDlg, IDC_SALVAGE_LOG_INODES); lpp->fLogRootInodes = IsDlgButtonChecked (hDlg, IDC_SALVAGE_LOG_ROOT); lpp->fRebuildDirs = IsDlgButtonChecked (hDlg, IDC_SALVAGE_FIXDIRS); lpp->fReadBlocks = IsDlgButtonChecked (hDlg, IDC_SALVAGE_BLOCK); if (IsDlgButtonChecked (hDlg, IDC_SALVAGE_SIMUL)) lpp->nProcesses = (int)SP_GetPos (GetDlgItem (hDlg, IDC_SALVAGE_NUM)); lpp->lpiSalvage = NULL; if (!IsDlgButtonChecked (hDlg, IDC_FILESET_ALL)) lpp->lpiSalvage = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_FILESET)); if (!lpp->lpiSalvage && !IsDlgButtonChecked (hDlg, IDC_AGGREGATE_ALL)) lpp->lpiSalvage = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_AGGREGATE)); if (!lpp->lpiSalvage) // salvage the whole server lpp->lpiSalvage = (LPIDENT)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SERVER)); if (!lpp->lpiSalvage) Delete (lpp); else { // Create (but don't show) a results dialog for this operation. // HWND hResults = ModelessDialogParam (IDD_SVR_SALVAGE_RESULTS, NULL, (DLGPROC)Server_Salvage_Results_DlgProc, (LPARAM)(lpp->lpiSalvage)); AfsAppLib_RegisterModelessDialog (hDlg); // Fire up the background task; when it finishes, have the task scheduler // send the result packet to that results dialog. // StartTask (taskSVR_SALVAGE, hResults, lpp); } }
BOOL Group_Create_OnOK (HWND hDlg) { LPCREATEGROUPDLG lpp = (LPCREATEGROUPDLG)GetWindowLongPtr (hDlg, DWLP_USER); // Start a background task to do all the work. // LPGROUP_CREATE_PARAMS pTask = New (GROUP_CREATE_PARAMS); memset (pTask, 0x00, sizeof(GROUP_CREATE_PARAMS)); if (IsDlgButtonChecked (hDlg, IDC_NEWGROUP_ID_AUTO)) pTask->idGroup = UID_AUTOSELECT; else // (IsDlgButtonChecked (hDlg, IDC_NEWGROUP_ID_MANUAL)) pTask->idGroup = SP_GetPos (GetDlgItem (hDlg, IDC_NEWGROUP_ID)); lstrcpy (pTask->Properties.szOwner, lpp->Advanced.szOwner); pTask->Properties.aaListStatus = lpp->Advanced.aaStatus; pTask->Properties.aaListGroupsOwned = lpp->Advanced.aaGroups; pTask->Properties.aaListMembers = lpp->Advanced.aaMembers; pTask->Properties.aaAddMember = lpp->Advanced.aaAdd; pTask->Properties.aaDeleteMember = lpp->Advanced.aaRemove; if (lpp->Advanced.pMembers) asc_AsidListCopy (&pTask->pMembers, &lpp->Advanced.pMembers); else pTask->pMembers = NULL; if (lpp->Advanced.pGroupsOwner) asc_AsidListCopy (&pTask->pGroupsOwner, &lpp->Advanced.pGroupsOwner); else pTask->pGroupsOwner = NULL; // Crack the specified list of user names into a multi-string // TCHAR szSeparators[ cchRESOURCE ]; GetString (szSeparators, IDS_SEPARATORS); lstrcat (szSeparators, TEXT(" \t")); LPTSTR pszNames = GetEditText (GetDlgItem (hDlg, IDC_NEWGROUP_NAME)); LPCTSTR pszStart = pszNames; while (lstrchr (szSeparators, *pszStart)) ++pszStart; while (*pszStart) { // Find the first non-name character // LPCTSTR pszEnd = pszStart; while (*pszEnd && !lstrchr(szSeparators, *pszEnd)) ++pszEnd; // Copy off this particular name // TCHAR szName[ cchNAME ]; lstrcpy (szName, pszStart); szName[ pszEnd - pszStart ] = TEXT('\0'); if (szName[0]) FormatMultiString (&pTask->mszNames, FALSE, TEXT("%1"), TEXT("%s"), szName); // Find the next valid-name character // pszStart = pszEnd; while (lstrchr(szSeparators, *pszStart)) ++pszStart; } FreeString (pszNames); // Do the real work of creating the user(s) // StartTask (taskGROUP_CREATE, NULL, pTask); // Store these creation parameters as the new defaults // memcpy (&gr.CreateGroup, &lpp->Advanced, sizeof(GROUPPROPINFO)); return TRUE; }
BOOL CALLBACK Filesets_Create_DlgProc (HWND hDlg, UINT msg, WPARAM wp, LPARAM lp) { static LPSET_CREATE_PARAMS pscp = NULL; if (msg == WM_INITDIALOG) pscp = (LPSET_CREATE_PARAMS)lp; if (HandleColumnNotify (hDlg, msg, wp, lp, &gr.viewAggCreate)) return FALSE; if (AfsAppLib_HandleHelp (IDD_SET_CREATE, hDlg, msg, wp, lp)) return TRUE; if (pscp != NULL) { switch (msg) { case WM_INITDIALOG: FastList_SetTextCallback (GetDlgItem (hDlg, IDC_AGG_LIST), GetItemText, &gr.viewAggCreate); Filesets_Create_OnInitDialog (hDlg, pscp); break; case WM_CONTEXTMENU: HWND hList; hList = GetDlgItem (hDlg, IDC_AGG_LIST); POINT ptScreen; POINT ptClient; ptScreen.x = LOWORD(lp); ptScreen.y = HIWORD(lp); ptClient = ptScreen; ScreenToClient (hList, &ptClient); if (FL_HitTestForHeaderBar (hList, ptClient)) { HMENU hm = TaLocale_LoadMenu (MENU_COLUMNS); DisplayContextMenu (hm, ptScreen, hList); } break; case WM_ENDTASK: LPTASKPACKET ptp; if ((ptp = (LPTASKPACKET)lp) != NULL) { if (ptp->idTask == taskAGG_FIND_QUOTA_LIMITS) Filesets_Create_OnEndTask_FindQuotaLimits (hDlg, ptp, pscp); else if (ptp->idTask == taskAGG_ENUM_TO_LISTVIEW) Filesets_Create_OnEndTask_EnumAggregates (hDlg); else if (ptp->idTask == taskSVR_ENUM_TO_COMBOBOX) { EnableWindow (GetDlgItem (hDlg, IDC_SET_SERVER), TRUE); Filesets_Create_StartDisplay_Aggregates (hDlg, &pscp->lpiParent); } FreeTaskPacket (ptp); } break; case WM_COLUMNS_CHANGED: LPARAM lpSel; lpSel = FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST)); FL_RestoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate); Filesets_Create_OnSelectServer (hDlg, (LPIDENT*)&lpSel); break; case WM_COMMAND: switch (LOWORD(wp)) { case IDOK: if (pscp->lpiParent && pscp->lpiParent->fIsAggregate() && pscp->szName[0]) EndDialog (hDlg, LOWORD(wp)); break; case IDCANCEL: EndDialog (hDlg, LOWORD(wp)); break; case IDC_SET_SERVER: if (HIWORD(wp) == CBN_SELCHANGE) Filesets_Create_OnSelectServer (hDlg, &pscp->lpiParent); break; case IDC_SET_NAME: GetDlgItemText (hDlg, IDC_SET_NAME, pscp->szName, cchNAME); Filesets_Create_EnableOK (hDlg, pscp); break; case IDC_SET_QUOTA: if (HIWORD(wp) == SPN_UPDATE) { pscp->ckQuota = SP_GetPos (GetDlgItem (hDlg, IDC_SET_QUOTA)); if (gr.cbQuotaUnits == cb1MB) pscp->ckQuota *= ck1MB; } break; case IDC_SET_QUOTA_UNITS: if (HIWORD(wp) == CBN_SELCHANGE) { gr.cbQuotaUnits = (size_t)CB_GetSelectedData (GetDlgItem (hDlg, IDC_SET_QUOTA_UNITS)); StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent); } break; case IDC_SET_CLONE: pscp->fCreateClone = IsDlgButtonChecked (hDlg, IDC_SET_CLONE); break; } break; case WM_DESTROY: FL_StoreView (GetDlgItem (hDlg, IDC_AGG_LIST), &gr.viewAggCreate); pscp = NULL; break; case WM_NOTIFY: switch (((LPNMHDR)lp)->code) { case FLN_ITEMSELECT: LPIDENT lpi; if ((lpi = (LPIDENT)FL_GetSelectedData (GetDlgItem (hDlg, IDC_AGG_LIST))) != NULL) { pscp->lpiParent = lpi; StartTask (taskAGG_FIND_QUOTA_LIMITS, hDlg, pscp->lpiParent); Filesets_Create_EnableOK (hDlg, pscp); } break; } break; } } return FALSE; }