void CSpiderAddPageDlg::OnChangeGroups() { SetDlgItemText (IDC_OUTFOLDER, m_wndGroups.GetSelectedGroup ()->strOutFolder); m_strBaseFolder = m_wndGroups.GetSelectedGroup ()->strOutFolder; BuildOutFolder (); }
void CSpiderAddPageDlg::OnUrlChanged() { fsURL url; if (IR_SUCCESS != url.Crack (m_strUrl)) return; fsSiteInfo *site = _SitesMgr.FindSite2 (url.GetHostName (), fsNPToSiteValidFor (fsSchemeToNP (url.GetInternetScheme ()))); if (site) { if (site->strUser != NULL && m_bAuthChanged == FALSE && *url.GetUserName () == 0) { CheckDlgButton (IDC_USELOGIN, BST_CHECKED); SetDlgItemText (IDC_USER, site->strUser); if (site->strPassword) SetDlgItemText (IDC_PASSWORD, site->strPassword); UpdateEnabled (); } if (site->pGroup && m_bGroupChanged == FALSE) { m_wndGroups.SelectGroup (site->pGroup); OnChangeGroups(); } } BuildOutFolder (); }
void CSpiderAddPageDlg::OnUrlChanged() { fsURL url; if (IR_SUCCESS != url.Crack (m_strUrl)) return; CString strNewUser, strNewPassword; strNewUser = url.GetUserName (); strNewPassword = url.GetPassword (); fsSiteInfo *site = _SitesMgr.FindSite (url.GetHostName (), fsNPToSiteValidFor (fsSchemeToNP (url.GetInternetScheme ()))); if (site) { if (!m_bAuthChanged && strNewUser.IsEmpty ()) { if (!site->strUser.IsEmpty ()) { strNewUser = site->strUser; if (!site->strPassword.IsEmpty ()) strNewPassword = site->strPassword; } } if (site->pGroup && m_bGroupChanged == FALSE) { m_wndGroups.SelectGroup (site->pGroup); OnChangeGroups(); m_bGroupChanged = FALSE; } } if (!m_bAuthChanged) { CheckDlgButton (IDC_USELOGIN, !strNewUser.IsEmpty () ? BST_CHECKED : BST_UNCHECKED); SetDlgItemText (IDC_USER, strNewUser); SetDlgItemText (IDC_PASSWORD, strNewPassword); m_bAuthChanged = FALSE; UpdateEnabled (); } BuildOutFolder (); }
BOOL CSpiderAddPageDlg::OnInitDialog() { CDialog::OnInitDialog(); m_task.hts.enType = HTS_ONCE; m_task.hts.last.dwHighDateTime = m_task.hts.last.dwLowDateTime = UINT_MAX; m_task.dwFlags = SCHEDULE_ENABLED; SYSTEMTIME time; GetLocalTime (&time); if (++time.wHour > 23) time.wHour = 0; time.wMinute = 0; SystemTimeToFileTime (&time, &m_task.hts.next); m_task.uWaitForConfirmation = 0; m_btnChooseFolder.SetIcon (SICO (IDI_CHOOSEFOLDER)); m_btnCreateGroup.SetIcon (SICO (IDI_CREATEGROUP)); m_btnSetTime.SetIcon (SICO (IDI_SETTIME)); m_btnOutFolderSetDefault.SetIcon (SICO (IDI_SETFOLDERDEFAULT)); m_wndGroups.Fill (); m_wndGroups.SelectGroupById (_App.CreateDld_IdOfLastGrpSelected ()); CheckDlgButton (IDC_KEEP, _App.Spider_Flags () & WPDF_KEEPFOLDERSTRUCTURE ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton (IDC_DONTSTOREPAGES, _App.Spider_Flags () & WPDF_DONTSTOREPAGES ? BST_CHECKED : BST_UNCHECKED); CheckDlgButton (IDC_DELCOMPLETED, _App.Spider_Flags () & WPDF_DELCOMPLETEDDLDS ? BST_CHECKED : BST_UNCHECKED); CComboBox *pUrls = (CComboBox*) GetDlgItem (IDC_URL); for (int i = 0; i < _LastUrlFiles.GetRecordCount (); i++) pUrls->AddString (_LastUrlFiles.GetRecord (i)); if (m_strStartUrl.GetLength () == 0) { LPCSTR pszUrl = _ClipbrdMgr.Text (); if (pszUrl) { fsURL url; if (url.Crack (pszUrl) == IR_SUCCESS) m_strUrl = pszUrl; } if (m_strUrl.GetLength () == 0) m_strUrl = "http://"; } else m_strUrl = m_strStartUrl; pUrls->SetWindowText (m_strUrl); CComboBox *pDirs = (CComboBox*) GetDlgItem (IDC_OUTFOLDER); for (i = 0; i < _LastFolders.GetRecordCount (); i++) pDirs->AddString (_LastFolders.GetRecord (i)); GetDlgItem (IDC_URL)->SetFocus (); m_bOutFolderChanged = m_bGroupChanged = FALSE; ReadAutostart (); ApplyLanguage (); if (m_bReqTopMost) { fsSetForegroundWindow (m_hWnd); ::SetWindowPos (m_hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE); } m_wndDepthSpin.SetRange (0, UD_MAXVAL); SetDlgItemInt (IDC_DEPTH, m_wpd->GetWDPS ()->iDepth); if (m_wndGroups.SelectGroupById (_App.NewDL_GroupId ())) m_bGroupChanged = TRUE; OnChangeGroups (); BuildOutFolder (); UpdateEnabled (); return TRUE; }
void CSpiderAddPageDlg::OnKeep() { BuildOutFolder (); }