Esempio n. 1
0
// Message from CEasyDropTarget
LRESULT CNewProj::DragDropText(WPARAM wParam,LPARAM lParam) {
  if (lParam) {
    CString st=*((CString*) lParam);
    CLIPFORMAT cfFormat = (CLIPFORMAT) wParam;
    if (cfFormat==CF_HDROP) {
      if (st.Right(5).CompareNoCase(".whtt")==0)
        st=st.Left(st.GetLength()-5);
      if(st.GetLength()<256) {
        char s[256];
        strcpybuff(s,st);
        if (!fexist(s)) {
          if (st.Find('\n')<0) {
            int pos=st.ReverseFind('\\');
            SetDlgItemTextCP(this, IDC_projpath,st.Mid(0,pos));
            SetDlgItemTextCP(this, IDC_projname,st.Mid(pos+1));
            //
            OnChangeprojpath();
            OnChangeprojname();
          } else
            AfxMessageBox(LANG(LANG_DIAL3),MB_SYSTEMMODAL);
        } else
          AfxMessageBox(LANG(LANG_DIAL4),MB_SYSTEMMODAL);
      }
    } else
      AfxMessageBox(LANG(LANG_DIAL5),MB_SYSTEMMODAL);
  }
  return 0;
}
BOOL COptionTab7::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
  EnableToolTips(true);     // TOOL TIPS

  // mode modif à la volée
  if (modify==1) {
    GetDlgItem(IDC_ADD1) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ADD2) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_URL2) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_STATIC_finfo) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_STATIC_tip) ->ModifyStyle(0,WS_DISABLED);
  } else {
    GetDlgItem(IDC_ADD1) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ADD2) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_URL2) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_STATIC_finfo) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_STATIC_tip) ->ModifyStyle(WS_DISABLED,0);
  }

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    SetWindowTextCP(this, LANG(LANG_B9)); // "Filtres");
    SetDlgItemTextCP(this, IDC_STATIC_finfo,LANG(LANG_B10)); // "Vous pouvez exclure ou accepter plusieurs URLs ou liens, en utilisant les jokers\nVous pouvez utiliser les virgules ou les espaces entre les filtres\nExemple: +*.zip,-www.*.com,-www.*.edu/cgi-bin/*.cgi");
    SetDlgItemTextCP(this, IDC_ADD1,LANG(LANG_B11)); // "Exclure lien(s)..");
    SetDlgItemTextCP(this, IDC_ADD2,LANG(LANG_B12)); // "Accepter lien(s)..");
    SetDlgItemTextCP(this, IDC_STATIC_tip,LANG(LANG_B13)); // "Conseil: Si vous voulez accepter tous les fichiers gif d'un site, utilisez quelque chose comme +www.monweb.com/*.gif\n(+*.gif autorisera TOUS les fichiers gif sur TOUS les sites)");
  }

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 3
0
BOOL COptionTab11::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
  EnableToolTips(true);     // TOOL TIPS

  if (LANG_T(-1)) {    // Patcher en français
    SetDlgItemTextCP(this, IDC_STATIC_asso,LANG_W1);
    SetDlgItemTextCP(this, IDC_STATIC_filetype,LANG_W2);
    SetDlgItemTextCP(this, IDC_STATIC_mime,LANG_W3);
  }  

  SetWindowTextCP(this, LANG_IOPT11);

  // mode modif à la volée
  if (modify==1) {
    GetDlgItem(IDC_ext1           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext2           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext3           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext4           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext5           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext6           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext7           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ext8           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime1           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime2           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime3           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime4           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime5           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime6           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime7           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_mime8           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_up           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_down           ) ->ModifyStyle(0,WS_DISABLED);
  } else {
    GetDlgItem(IDC_ext1           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext2           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext3           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext4           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext5           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext6           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext7           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ext8           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime1           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime2           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime3           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime4           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime5           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime6           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime7           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_mime8           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_up           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_down           ) ->ModifyStyle(WS_DISABLED,0);
  }


	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 4
0
BOOL Ctrans::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

  ((CButton*)GetDlgItem(IDC_select_start))->SetCheck(1);
  strcpybuff(RasString,"");
  
  SetIcon(httrack_icon,false);
  SetIcon(httrack_icon,true);  
	EnableToolTips(true);     // TOOL TIPS

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    //SetDlgItemTextCP(this, ,"");
    SetWindowTextCP(this, LANG(LANG_J9) /*"Démarrer.."*/);
    SetDlgItemTextCP(this, IDC_select_start,LANG(LANG_J10) /*"Vous pouvez démarrer le miroir en pressant la touche DEMARRER,\nou définir avant les options de connexion"*/);
    SetDlgItemTextCP(this, IDC_select_save,LANG(LANG_J10b));
    SetDlgItemTextCP(this, IDC_STATIC_delay,LANG(LANG_J11) /*"Retarder"*/);
    SetDlgItemTextCP(this, IDC_wait,LANG(LANG_J12) /*"Attendre avant de commencer jusqu'à: (hh/mm/ss)"*/);
    //SetDlgItemTextCP(this, IDC_avant,LANG(LANG_BACK) /*"<- AVANT"*/);
    SetDlgItemTextCP(this, IDCANCEL,LANG(LANG_QUIT) /*"Quitter"*/);
    SetDlgItemTextCP(this, IDOK,LANG(LANG_J13) /*"DEMARRER!"*/);
    SetDlgItemTextCP(this, IDC_STATIC_ras,LANG(LANG_J14) /*"Connexion provider"*/);
    SetDlgItemTextCP(this, IDC_cnx,LANG(LANG_J15) /*"Connecter à ce provider"*/);
    SetDlgItemTextCP(this, IDC_rasdisc,LANG_J16);
  }

  // liste vide pour commencer
  isfilled=FALSE;
  FillProviderList(0);
  m_ctlrasid.SetCurSel(0);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void COptionTab10::OnChangeprox() 
{
  CString st="";
  char tempo[8192];
  CString port="";

  GetDlgItemText(IDC_prox,st);

  int pos=st.Find(':');
  if (pos>=0) {
    port=st.Mid(pos+1);
    st=st.Mid(0,pos);
    SetDlgItemTextCP(this, IDC_prox,st);
  }
  strcpybuff(tempo,st);
  
  int ex=0;
  do {
    if (strlen(tempo)>0) {
      switch (tempo[strlen(tempo)-1]) {
      case 10: case 13: case 32: tempo[strlen(tempo)-1]='\0';
        break;
      default: ex=1;
        break;
      }
    } else ex=1;
  } while(!ex);
  
  if ((strlen(tempo)>0)!=prox_status) {
    prox_status=!prox_status;
    
    if (strlen(tempo)>0) {
      CString st="";
      GetDlgItemText(IDC_portprox,st);
      if (strlen(st)==0) {
        SetDlgItemTextCP(this, IDC_portprox,"8080");
        m_ctl_portprox.RedrawWindow();
      }
      m_ctl_proxtitle.ModifyStyle(WS_DISABLED,0);
    }
    else {
      SetDlgItemTextCP(this, IDC_portprox,"");
      m_ctl_portprox.RedrawWindow();
      m_ctl_proxtitle.ModifyStyle(0,WS_DISABLED);
    }
    m_ctl_proxtitle.RedrawWindow();
  }  

  if (port.GetLength())
    SetDlgItemTextCP(this, IDC_portprox,port);
}
void COptionTab7::EnsureIncluded(BOOL state, CString filter)  {
  /* wipe all selected filters */
  CString st;
  CString ftok=filter;
  GetDlgItemText(IDC_URL2,st);
  ftok+=" ";
  while(ftok.Find(' ')>=0) {
    CString token=ftok.Mid(0,ftok.Find(' '));
    ftok=ftok.Mid(ftok.Find(' ')+1);
    ftok.TrimLeft();
    st.Replace(token,"");
    st.Replace("\r"," ");
    st.Replace("\t"," ");
    st.Replace("  "," ");
    st.Replace(" \n","\n");
    st.Replace("\n ","\n");
    st.Replace("\n\n","\n");
  }
  st.TrimLeft();
  st.TrimRight();
  /* add ? */
  if (state) {
    st+="\n";
    st+=filter;
  }
  st.Replace("\n","\r\n");      // W32 compatible
  SetDlgItemTextCP(this, IDC_URL2,st);
}
BOOL COptionTab6::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
  EnableToolTips(true);     // TOOL TIPS
	
  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    SetDlgItemTextCP(this, IDC_STATIC_browsid,LANG(LANG_I43)); // "Identité");
    SetDlgItemTextCP(this, IDC_STATIC_footer,LANG(LANG_I43b));
    SetDlgItemTextCP(this, IDC_STATIC_accept_language,LANG(LANG_I43c));
    SetDlgItemTextCP(this, IDC_STATIC_other_headers,LANG(LANG_I43d));
    SetDlgItemTextCP(this, IDC_STATIC_default_referer,LANG(LANG_I43e));
  }
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CFirstInfo::OnSetActive( ) {
  WHTT_LOCATION("FirstInfo");
  this_CWizTab->SetWizardButtons(PSWIZB_NEXT);
  SetDlgItemTextCP(this_CWizTab,IDCANCEL,LANG_QUIT);
  this_DirTreeView->ResetTree();
  this_CSplitterFrame->EnableSaveEntries(TRUE);
  //GetParent()->GetDlgItem(IDCANCEL)->ModifyStyle(0,WS_DISABLED);
  return 1;
}
Esempio n. 9
0
BOOL CNewProj::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
  SetIcon(httrack_icon,false);
  SetIcon(httrack_icon,true);
  EnableToolTips(true);     // TOOL TIPS
  SetForegroundWindow();   // yop en premier plan!

  // disabled
  OnChangeprojname();

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    SetWindowTextCP(this,  LANG(LANG_S10));
    // SetDlgItemTextCP(this, IDOK,LANG(LANG_NEXT )); // "SUIVANT ->");
    // SetDlgItemTextCP(this, IDCANCEL,LANG(LANG_QUIT));  // exit 
    SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11));
    SetDlgItemTextCP(this, IDC_STATIC_basepath,LANG(LANG_S12));
    SetDlgItemTextCP(this, IDC_STATIC_projcateg,LANG(LANG_S13));
    //SetDlgItemTextCP(this, IDC_STATIC_updtcontinue,LANG(LANG_S13));
  }
  
  CString strSection       = "DefaultValues";    
  CWinApp* pApp = AfxGetApp();
  CString st;

  st = pApp->GetProfileString(strSection, "BasePath");
  if (m_projpath.GetLength()==0) {
    if (st != "")
      SetDlgItemTextCP(this, IDC_projpath,st);    
    else
      SetDlgItemTextCP(this, IDC_projpath,LANG(LANG_S20));    
  }

  return TRUE;
}
void COptionTab10::Onproxyconfigure() 
{
  CProxyId proxy;
  char adr[256];
  CString s;
  GetDlgItemText(IDC_portprox,s);
  proxy.m_proxport=s;
  GetDlgItemText(IDC_prox,s);
  strcpybuff(adr,s);
  proxy.m_proxadr=jump_identification(adr);
  if (jump_identification(adr)!=adr) {
    char user_pass[256]; user_pass[0]='\0';
    char* a;
    size_t nsize = (size_t) ( ( jump_identification(adr) - adr ) - 1 );
    strncatbuff(user_pass,adr,nsize);
    a=strchr(user_pass,':');
    if (a)
      *a='\0';
    else
      a=user_pass+strlen(user_pass);
    proxy.m_proxlogin=user_pass;
    proxy.m_proxpass=a+1;
  }
  if (proxy.DoModal() == IDOK) {
    if (proxy.m_proxlogin.GetLength()==0) {
      SetDlgItemTextCP(this, IDC_prox,proxy.m_proxadr);
      m_ctl_pwdhide.SetCheck(0);
      OnPwdhide();
    } else {
      SetDlgItemTextCP(this, IDC_prox,proxy.m_proxlogin+":"+proxy.m_proxpass+"@"+proxy.m_proxadr);
      m_ctl_pwdhide.SetCheck(1);
      OnPwdhide();
    }
    SetDlgItemTextCP(this, IDC_portprox,proxy.m_proxport);
  }
}
Esempio n. 11
0
BOOL CNewProj::OnKillActive( ) {
  CString st;
  char tempo[HTS_URLMAXSIZE*2];
  GetDlgItemText(IDC_projpath,st);
  if (st.GetLength() > MAX_PATH) {
    return FALSE;
  }
  strcpybuff(tempo,st);
  if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\')) {
    tempo[strlen(tempo)-1]='\0';
    SetDlgItemTextCP(this, IDC_projpath,tempo);
  }

  UpdateData(TRUE);         // DoDataExchange

  // créer structure
  {
    char dest[HTS_URLMAXSIZE*2];
    int i=0;
    strcpybuff(dest,GetPath()+"hts-cache\\");
    {
      char* a;
      while(a=strchr(dest,'\\')) *a='/';
      structcheck(dest);
    }
  }

  CShellApp_app->end_path=dialog0->GetBasePath();
  CShellApp_app->end_path_complete=dialog0->GetPath();
  Build_TopIndex(FALSE);

  // structure visible
  TStamp t_start = mtime_local();
  // FIXME: VERY SLOW!!
  this_DirTreeView->EnsureVisible(GetPath()+"hts-cache");
  TStamp t_end = mtime_local();

  //TStamp l_dir = t_end - t_start;
  //CString a;
  //a.Format("t=%dms", (int)l_dir);
  //(void) AfxMessageBox(a, MB_OK);

  // charger préfs
  dialog1->OnChangepathlog();

  return 1;
}
Esempio n. 12
0
void CNewProj::Onbr() 
{
  CString st,spth;
  char pth[MAX_PATH + 32];
  GetDlgItemText(IDC_projpath,spth);
  if (spth.GetLength() > MAX_PATH) {
    return ;
  }
  strcpybuff(pth,spth);
  st=XSHBrowseForFolder(this->m_hWnd,"Select a path name for mirror",pth);
  if (st.GetLength()>0) {
    if (st.Right(1)=='\\')
      st=st.Left(st.GetLength()-1);
    SetDlgItemTextCP(this, IDC_projpath,st);
  }

}
Esempio n. 13
0
BOOL wizard::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
  SetIcon(httrack_icon,false);
  SetIcon(httrack_icon,true);  
  SetForegroundWindow();   // yop en premier plan!

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    //SetDlgItemText(,"");
    SetWindowTextCP(this, LANG(LANG_L1) /*"Question du wizard"*/);
    SetDlgItemTextCP(this, IDC_STATIC_answer,LANG(LANG_L2) /*"Votre réponse:"*/);
  }

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Esempio n. 14
0
void CNewProj::Changeprojname(CString stl) {
	char catbuff[CATBUFF_SIZE];
	CWaitCursor wait;
  CString st;
  //
  if (stl.GetLength()==0 || stl.GetLength() > HTS_URLMAXSIZE) {
    //m_ctl_idok.ModifyStyle(0,WS_DISABLED);
    SetDlgItemTextCP(this, IDC_STATIC_comments,LANG(LANG_S30));
    SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11c));
    this_CWizTab->SetWizardButtons(PSWIZB_BACK);
    can_click_next=FALSE;
  } else {
    char tempo[HTS_URLMAXSIZE*2];
    GetDlgItemText(IDC_projpath,st);
    if (st.GetLength() + stl.GetLength() + 32 > sizeof(tempo)) {
      can_click_next=FALSE;
    } else {
      strcpybuff(tempo,st);
      strcatbuff(tempo,"/");
      strcatbuff(tempo,stl);
      strcatbuff(tempo,"/");
      if (fexist(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"))     // un cache est présent
        && fsize(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"))>0) {   // taille log contrôle>0
        CString strSection       = "OptionsValues";
        CString st  = MyGetProfileString(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"),strSection,"CurrentUrl");
        CString st2 = MyGetProfileString(fconcat(catbuff,tempo,"hts-cache/winprofile.ini"),strSection,"Category");
        //
        SetDlgItemTextCP(this, IDC_STATIC_comments, st);
        SetDlgItemTextCP(this, IDC_projcateg, st2);
        // Static
        SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11b));
      } else {
        SetDlgItemTextCP(this, IDC_STATIC_comments,LANG(LANG_S31));
        SetDlgItemTextCP(this, IDC_STATIC_projname,LANG(LANG_S11));
      }
      //m_ctl_idok.ModifyStyle(WS_DISABLED,0);
      //if (!can_click_next)
      this_CWizTab->SetWizardButtons(PSWIZB_BACK|PSWIZB_NEXT);
      can_click_next=TRUE;
    }
  }
  //m_ctl_idok.RedrawWindow();
}
BOOL CFirstInfo::OnInitDialog() 
{

	CPropertyPage::OnInitDialog();
	EnableToolTips(true);     // TOOL TIPS

  WINDOWPLACEMENT wp;
  m_splash.GetWindowPlacement(&wp);
  wp.rcNormalPosition.right=wp.rcNormalPosition.left+300+1;
  wp.rcNormalPosition.bottom=wp.rcNormalPosition.top+69+1; 
  m_splash.SetWindowPlacement(&wp);

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    //SetDlgItemText(,"");
    
    SetDlgItemTextCP(this,IDC_STATIC_welcome, LANG_Y1);
  }

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
void COptionTab7::OnAdd2() 
{
  char s[1024]; s[0]='\0';
  NewFilter(1,s);
  if (strlen(s)>0) {
    char tempo[HTS_URLMAXSIZE*16];
    {
      CString st;
      GetDlgItemText(IDC_URL2,st);
      if (st.GetLength() < sizeof(tempo) - 2)
        strcpybuff(tempo,st);
      else
        tempo[0] = '\0';
    }
    if (strlen(tempo)>0) {
      if ((tempo[strlen(tempo)-1]!=' ') && (tempo[strlen(tempo)-1]!='\n') && (tempo[strlen(tempo)-1]!=13))
        strcatbuff(tempo,"\x0d\x0a");
    }
    strcatbuff(tempo,s);
    //	m_url2=tempo;
    SetDlgItemTextCP(this, IDC_URL2,tempo);
  }
}
Esempio n. 17
0
void CNewProj::OnChangeprojname() 
{
  CString stl;
  BOOLEAN modified = FALSE;
  int i;
  GetDlgItemText(IDC_projname,stl);
  for(i = 0 ; i < stl.GetLength() ; i++) {
    if (stl[i] == '\"') {
      stl.GetBuffer(0)[i] = '\'';
      modified = TRUE;
    }
    else if (((unsigned char)stl[i]) < 32) {
      stl.GetBuffer(0)[i] = ' ';
      modified = TRUE;
    }
    else if (stl[i] == '~'
      || stl[i] == '\\'
      || stl[i] == '/'
      || stl[i] == ':'
      || stl[i] == '*'
      || stl[i] == '?'
      || stl[i] == '<'
      || stl[i] == '>'
      || stl[i] == '|'
      ) {
      stl.GetBuffer(0)[i] = '_';
      modified = TRUE;
    }
  }
  if (modified) {
    DWORD dwSel=0;
    dwSel = m_ctl_projname.GetEditSel();
    SetDlgItemTextCP(this, IDC_projname, stl);
    m_ctl_projname.SetEditSel(HIWORD(dwSel), LOWORD(dwSel));
  }
  Changeprojname(stl);
}
Esempio n. 18
0
BOOL CNewProj::OnSetActive( ) {
  //this_CWizTab->SetWizardButtons(PSWIZB_BACK);

  WHTT_LOCATION("NewProj");
  //if (!can_click_next) {
  // structure visible
  CString st;
  GetDlgItemText(IDC_projpath,st);    
  TStamp t_start = mtime_local();
  // FIXME: VERY SLOW!!
  this_DirTreeView->EnsureVisible(st+"\\index.html");
  TStamp t_end = mtime_local();

  //TStamp l_dir = t_end - t_start;
  //CString a;
  //a.Format("t=%dms", (int)l_dir);
  //(void) AfxMessageBox(a, MB_OK);

  SetDlgItemTextCP(this_CWizTab, IDCANCEL,LANG_CANCEL);
  //} else
  //this_CWizTab->PressButton(PSBTN_NEXT);
  
  return 1;
}
BOOL COptionTab9::OnInitDialog() 
{
	CDialog::OnInitDialog();
  EnableToolTips(true);     // TOOL TIPS

  if (LANG_T(-1)) {    // Patcher en français
    SetDlgItemTextCP(this, IDC_index,LANG(LANG_I35)); // "Faire un index");
    SetDlgItemTextCP(this, IDC_index2,LANG(LANG_I35b));
    SetDlgItemTextCP(this, IDC_index_mail,LANG(LANG_I35c));
    SetDlgItemTextCP(this, IDC_logf,LANG(LANG_I36)); // "Fichiers d'audit");
    SetDlgItemTextCP(this, IDC_Cache2,LANG(LANG_I61));
    SetDlgItemTextCP(this, IDC_norecatch,LANG(LANG_I34b));
    SetCombo(this,IDC_logtype,LISTDEF_9);
  }  

  // mode modif à la volée
  if (modify==1) {
    GetDlgItem(IDC_norecatch)->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_index)   ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_index2)  ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_index_mail)->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_logf)    ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_Cache2)  ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_logtype) ->ModifyStyle(0,WS_DISABLED);
  } else {
    GetDlgItem(IDC_norecatch)->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_index)   ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_index2)  ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_index_mail)->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_logf)    ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_Cache2)  ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_logtype) ->ModifyStyle(WS_DISABLED,0);
  }


	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL COptionTab10::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();
	
  EnableToolTips(true);     // TOOL TIPS

  /* hide password */
  CString st;
  GetDlgItemText(IDC_prox,st);
  if (st.Find('@')>=0) {
    m_ctl_pwdhide.SetCheck(1);
    OnPwdhide();
  } else {
    m_ctl_pwdhide.SetCheck(0);
    OnPwdhide();
  }

  if (LANG_T(-1)) {    // Patcher en français
    SetDlgItemTextCP(this, IDC_proxyconfigure,LANG(LANG_I47b)); // "Configurer"
    SetDlgItemTextCP(this, IDC_ftpprox,LANG(LANG_I47c));
    SetDlgItemTextCP(this, IDC_PWDHIDE,LANG_HIDEPWD);  /* Hide password */
  }  

  // mode modif à la volée
  if (modify==1) {
    GetDlgItem(IDC_prox           ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_portprox       ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_proxyconfigure ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_proxtitle      ) ->ModifyStyle(0,WS_DISABLED);
    GetDlgItem(IDC_ftpprox        ) ->ModifyStyle(0,WS_DISABLED);
  } else {
    GetDlgItem(IDC_prox           ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_portprox       ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_proxyconfigure ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_proxtitle      ) ->ModifyStyle(WS_DISABLED,0);
    GetDlgItem(IDC_ftpprox        ) ->ModifyStyle(WS_DISABLED,0);
  }

  CString str;
  GetDlgItemText(IDC_prox,str);
  m_ctl_prox.ResetContent();
  m_ctl_prox.AddString("");

  HKEY phkResult;
  if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings",0,KEY_READ,&phkResult)==ERROR_SUCCESS) {
    DWORD type=0;
    DWORD datasize=1000;
    char data[1024];
    data[0]='\0';
    if (RegQueryValueEx(phkResult,"ProxyServer",0,&type,(unsigned char*)&data,&datasize)==ERROR_SUCCESS) {
      if (datasize) {
        char* a=strchr(data,':');
        if (a)
          *a='\0';
        m_ctl_prox.AddString(data);
      }
    }
    RegCloseKey(phkResult);
  }
  SetDlgItemTextCP(this, IDC_prox,str);

  // Do not search for a proxy everytime
  CWinApp* pApp = AfxGetApp();
  if (pApp->GetProfileInt("Interface","FirstProxySearch",0) != 1) {
    pApp->WriteProfileInt("Interface","FirstProxySearch",1);
    
    // Launch proxy name search
    int i=0;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="proxy")   ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="www")     ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="ns")      ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="web")     ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="ntserv")  ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="gate")    ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="gateway") ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="firewall"),this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    WSAAsyncGetHostByName(this->m_hWnd,wm_ProxySearch+i,(ProxyDetectName[i]="cache")   ,this->ProxyDetectBuff[i],sizeof(this->ProxyDetectBuff[i])); i++;
    
  }
  
  return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL Cinprogress::OnInitDialog() 
{
  m_inphide=TRUE;
  UpdateData(false);      // force to call DoDataExchange
  inprogress=this;

  memset(&SInfo, 0, sizeof(SInfo));

  BackAffLog=NULL;
  strcpybuff(pathlog,"");

	//CPropertyPage::OnInitDialog();
  EnableToolTips(true);     // TOOL TIPS

  // initialisation des champs pour les redraws en boucle
  element[0][0]=&m_st0;
  element[0][1]=&m_st1;
  element[0][2]=&m_st2;
  element[0][3]=&m_st3;
  element[0][4]=&m_st4;
  element[0][5]=&m_st5;
  element[0][6]=&m_st6;
  element[0][7]=&m_st7;
  element[0][8]=&m_st8;
  element[0][9]=&m_st9;
  element[0][10]=&m_st10;
  element[0][11]=&m_st11;
  element[0][12]=&m_st12;
  element[0][13]=&m_st13;

  element[1][0]=&m_nm0;
  element[1][1]=&m_nm1;
  element[1][2]=&m_nm2;
  element[1][3]=&m_nm3;
  element[1][4]=&m_nm4;
  element[1][5]=&m_nm5;
  element[1][6]=&m_nm6;
  element[1][7]=&m_nm7;
  element[1][8]=&m_nm8;
  element[1][9]=&m_nm9;
  element[1][10]=&m_nm10;
  element[1][11]=&m_nm11;
  element[1][12]=&m_nm12;
  element[1][13]=&m_nm13;

  // rajouté
  element[4][0]=&m_nn0;
  element[4][1]=&m_nn1;
  element[4][2]=&m_nn2;
  element[4][3]=&m_nn3;
  element[4][4]=&m_nn4;
  element[4][5]=&m_nn5;
  element[4][6]=&m_nn6;
  element[4][7]=&m_nn7;
  element[4][8]=&m_nn8;
  element[4][9]=&m_nn9;
  element[4][10]=&m_nn10;
  element[4][11]=&m_nn11;
  element[4][12]=&m_nn12;
  element[4][13]=&m_nn13;

  element[2][0]=&m_sl0;
  element[2][1]=&m_sl1;
  element[2][2]=&m_sl2;
  element[2][3]=&m_sl3;
  element[2][4]=&m_sl4;
  element[2][5]=&m_sl5;
  element[2][6]=&m_sl6;
  element[2][7]=&m_sl7;
  element[2][8]=&m_sl8;
  element[2][9]=&m_sl9;
  element[2][10]=&m_sl10;
  element[2][11]=&m_sl11;
  element[2][12]=&m_sl12;
  element[2][13]=&m_sl13;

  element[3][0]=&m_sk0;
  element[3][1]=&m_sk1;
  element[3][2]=&m_sk2;
  element[3][3]=&m_sk3;
  element[3][4]=&m_sk4;
  element[3][5]=&m_sk5;
  element[3][6]=&m_sk6;
  element[3][7]=&m_sk7;
  element[3][8]=&m_sk8;
  element[3][9]=&m_sk9;
  element[3][10]=&m_sk10;
  element[3][11]=&m_sk11;
  element[3][12]=&m_sk12;
  element[3][13]=&m_sk13;

  /* Init checkbox */
  CMenu* m;
  if (m = AfxGetApp()->GetMainWnd()->GetMenu()) {
    m->CheckMenuItem(ID_FILE_PAUSE,MF_UNCHECKED);
  }

  // Patcher l'interface pour les Français ;-)
  if (LANG_T(-1)) {    // Patcher en français
    //SetDlgItemTextCP(this, ,"");
    SetDlgItemTextCP(this, IDC_STATIC_bytes,LANG(LANG_H8) /*"Octets sauvés:"*/);
    SetDlgItemTextCP(this, IDC_STATIC_scanned,LANG(LANG_H9) /*"Liens parcourus:"*/);
    SetDlgItemTextCP(this, IDC_STATIC_time,LANG(LANG_H10) /*"Temps:"*/);
    SetDlgItemTextCP(this, IDC_STATIC_sockets,LANG(LANG_H11) /*"Connexions:"*/);
    SetDlgItemTextCP(this, IDC_inphide,LANG(LANG_H12) /*"En cours:"*/);
    SetDlgItemTextCP(this, IDC_STATIC_informations,LANG_H16);   
    SetDlgItemTextCP(this, IDC_STATIC_written,LANG_H17);   
    SetDlgItemTextCP(this, IDC_STATIC_updated,LANG_H18);   
    SetDlgItemTextCP(this, IDC_STATIC_errors,LANG_H19);    
    SetDlgItemTextCP(this, IDC_STATIC_inprog,LANG_H20);    
    //SetDlgItemTextCP(this, IDC_hide,LANG(LANG_H13) /*"Cacher"*/);
    SetDlgItemTextCP(this, IDC_STATIC_trate,LANG(LANG_H14) /*"Taux transfert"*/);
    for(int i=0;i<NStatsBuffer;i++)
      SetWindowTextCP(element[3][i], LANG(LANG_H15));
  }

  /*
  {
    LOGFONT lf;
    if (element[0][0]->GetFont()->GetLogFont(&lf)) {
      CFont* fnt = new CFont();
      if (fnt->CreateFont(lf.lfHeight,0,0,0,FW_DONTCARE,0,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH,"Fixedsys")) {
        int i;
        for (i=0;i<NStatsBuffer; i++) {
          element[0][i]->SetFont(fnt,true);
          element[1][i]->SetFont(fnt,true);
        }
      }
    }
  }
  */

  SetIcon(httrack_icon,false);
  SetIcon(httrack_icon,true);  

  if (ShellOptions != NULL && ShellOptions->choixdeb[0] == '!')
    Oniplog(0);           // ouvrir log

  // Lancer timer!
  StartTimer();

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
LRESULT Cinprogress::OnEndMirror(WPARAM /* wP*/, LPARAM /*lP*/) {
	char catbuff[CATBUFF_SIZE];
	char catbuff2[CATBUFF_SIZE];
  //this_CSplitterFrame->SetNewView(0,1,RUNTIME_CLASS(Cinfoend));

  // Copie de trans.cpp
  this_CWizTab->ModifyStyle(WS_VISIBLE,0,0);
  this_CWizTab->RedrawWindow();
  //
  //{
  //  CWizTab* tmp;
  //  tmp=this_CWizTab;
  this_CWizTab=this_intCWizTab;
  //  this_CWizTab2=tmp;
  //}
  //
  this_CWizTab->ModifyStyle(0,WS_VISIBLE,0);
  this_CWizTab->ModifyStyle(WS_DISABLED,0,0);
  this_CSplitterFrame->RedrawWindow();
  // Fin de Copie de trans.cpp

  this_CWizTab->EndInProgress();
  if (IsWindow(this_Cinfoend->m_hWnd))
    SetDlgItemTextCP(this_Cinfoend, IDC_infoend,end_mirror_msg);

  if (hts_is_exiting(global_opt) == 1) {     /* Interrupted mirror! */
    char pathlog[HTS_URLMAXSIZE*2];
    strcpybuff(pathlog,dialog0->GetPath());
    if (strlen(pathlog)>0) {
      if ((pathlog[strlen(pathlog)-1]!='/') && (pathlog[strlen(pathlog)-1]!='\\'))
        strcatbuff(pathlog,"/");
    }
    // Aborted updated.. restore old cache?!
    if ( 
      fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.zip"))
      ||
      (fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.dat")))
      && (fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.ndx"))) 
      ) {
      if (AfxMessageBox(LANG_F22b,MB_YESNO|MB_DEFBUTTON2) == IDYES) {
        if (fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.dat"))
          && fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.ndx"))) {
          if (remove(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/new.dat"))) {
            AfxMessageBox(LANG_F24 );
          }
          if (remove(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/new.ndx"))) {
            AfxMessageBox(LANG_F24 );
          }
        }
        if (remove(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/new.lst"))) {
          AfxMessageBox(LANG_F24 );
        }
        if (fexist(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.zip"))) {
          if (remove(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/new.zip"))) {
            AfxMessageBox(LANG_F24 );
          }
        }
        remove(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/new.txt"));
        rename(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.zip"),fconcat(catbuff2,sizeof(catbuff2),pathlog,"hts-cache/new.zip"));
        rename(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.dat"),fconcat(catbuff2,sizeof(catbuff2),pathlog,"hts-cache/new.dat"));
        rename(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.ndx"),fconcat(catbuff2,sizeof(catbuff2),pathlog,"hts-cache/new.ndx"));
        rename(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.lst"),fconcat(catbuff2,sizeof(catbuff2),pathlog,"hts-cache/new.lst"));
        rename(fconcat(catbuff,sizeof(catbuff),pathlog,"hts-cache/old.txt"),fconcat(catbuff2,sizeof(catbuff2),pathlog,"hts-cache/new.txt"));
      }
    }
  } else if (hts_is_exiting(global_opt) == 2) {     /* No connection! */
    AfxMessageBox(LANG_F22c );
  }
  return S_OK;
}
BOOL SetDlgItemTextCP(CWnd* wnd, int nIDDlgItem, LPCSTR lpString) {
  return SetDlgItemTextCP(wnd->m_hWnd, nIDDlgItem, lpString);
}
Esempio n. 24
0
void CNewProj::OnChangeprojpath() 
{
  CWaitCursor wait;
  CString st;
  CString old_name;
  char tempo[HTS_URLMAXSIZE*2];

  GetDlgItemText(IDC_projname,old_name);
  GetDlgItemText(IDC_projpath,st);
  if (st.GetLength() > MAX_PATH) {
    SetDlgItemText(IDC_projpath, "");
    return;
  }

  tempo[0] = '\0';
  strcatbuff(tempo, st);
  if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\')) {
    tempo[strlen(tempo)-1]='\0';
    //SetDlgItemTextCP(this, IDC_projpath,tempo);
  }
  strcatbuff(tempo,"\\");

  TStamp t_start = mtime_local();

  // chargement de la liste
  m_ctl_projname.ResetContent();
  m_ctl_projcateg.ResetContent();
  WIN32_FIND_DATA find;
  char  pth[MAX_PATH + 32];
  strcpybuff(pth,tempo);
  strcatbuff(pth,"*.*");
  HANDLE h = FindFirstFile(pth,&find);
  if (h != INVALID_HANDLE_VALUE) {
    do {
      if (find.dwFileAttributes  & FILE_ATTRIBUTE_DIRECTORY )
      if (!(find.dwFileAttributes  & (FILE_ATTRIBUTE_SYSTEM|FILE_ATTRIBUTE_HIDDEN) ))
      if (strcmp(find.cFileName,".."))
        if (strcmp(find.cFileName,".")) {
          CString st;
          st=tempo;
          st=st+find.cFileName;
          st=st+"\\hts-cache";
          
          WIN32_FIND_DATA find2;
          HANDLE h2 = FindFirstFile(st,&find2);
          if (h2 != INVALID_HANDLE_VALUE) {
            FindClose(h2);
            m_ctl_projname.AddString(find.cFileName);
            
            // Read category
            st += "\\winprofile.ini";
            CString strSection       = "OptionsValues";
            CString categ = MyGetProfileString(st, strSection, "Category");
            if (categ.GetLength() > 0 && m_ctl_projcateg.FindStringExact(0, categ) < 0) {
              m_ctl_projcateg.AddString(categ);
            }
          }
        }
    } while(FindNextFile(h,&find));
    FindClose(h);
  }

  // nouveau nom!
  SetDlgItemTextCP(this, IDC_projname,old_name);

  TStamp t_proj = mtime_local();

  OnChangeprojname();

  TStamp t_end = mtime_local();
  TStamp l_dir = t_proj - t_start;
  TStamp l_proj = t_end - t_proj;
  //CString a;
  //a.Format("%s: build=%dms proj=%dms", __FUNCTION__, (int)l_dir, (int)l_proj);
  //(void) AfxMessageBox(a, MB_OK);
}
Esempio n. 25
0
LRESULT CNewProj::OnWizardNext() {
  CString st,stp="";
  char tempo[8192];

  GetDlgItemText(IDC_projpath,stp);
  if (st.GetLength() > MAX_PATH) {
    return -1;
  }
  strcpybuff(tempo,stp);
  if ((tempo[strlen(tempo)-1]=='/') || (tempo[strlen(tempo)-1]=='\\'))
    tempo[strlen(tempo)-1]='\0';
  stp=tempo;

  // ecrire
  CString strSection       = "DefaultValues";    
  CWinApp* pApp = AfxGetApp();
  pApp->WriteProfileString(strSection,"BasePath",stp);

  GetDlgItemText(IDC_projname,st);
  if (st.GetLength() > MAX_PATH) {
    return -1;
  }
  st.TrimLeft();
  st.TrimRight();
  strcpybuff(tempo,st);
  // caractères interdits
  {
    int i;
    char* a=NULL;
    for(i=0;i<9;i++)
      while(a=strchr(tempo,("\\/:*?\"<>|")[i])) 
        *a=' ';
  }
  //
  //while(a=strchr(tempo,' ')) *a='_';      // PAS de _
  SetDlgItemTextCP(this, IDC_projname,tempo);

  // Modifié et sauvable
  GetDlgItemText(IDC_projpath,stp);
  if (stp.GetLength() > MAX_PATH) {
    return -1;
  }
  if ((stp.Right(1)!="\\") && (stp.Right(1)!="/"))    // ajouter /
    stp+="\\";
  GetDlgItemText(IDC_projname,st);
  if (st.GetLength() > MAX_PATH) {
    return -1;
  }
  this_CSplitterFrame->SetNewName(stp+st+".whtt");
  //GetDlgItemText(IDC_projpath,st);
  //this_CSplitterFrame->GetActiveDocument()->SetPathName(st);

  // Hack
  {
    CString st;
    GetDlgItemText(IDC_projcateg, st);
    if (st.GetLength() > MAX_PATH) {
      return -1;
    }
    this_CSplitterFrame->SetCurrentCategory(st);
  }

  if (can_click_next)
    return 0;
  else
    return -1;
}