home *** CD-ROM | disk | FTP | other *** search
/ PC World 2007 November / PCWorld_2007-11_cd.bin / temacd / imtoodownyoutube / download-youtube-video.exe / script / settings.js < prev    next >
Text File  |  2007-07-25  |  3KB  |  138 lines

  1. var flvtemppath = new JSPathDialog();
  2. flvtemppath.SetDirBkColor(241,237,241);
  3.  
  4. var tmppath="c:\\";
  5. function gettmppath()
  6. {
  7.     tmppath=pathdlg.ShowDirDialog(GetTempFolder());
  8.     if(tmppath!="")
  9.     settings.tmpfilepath.SetText(tmppath);
  10. }
  11.  
  12. function onOpenTempFolder()
  13. {
  14.     helper.Helper_OpenFolder(GetTempFolder());
  15.     /*
  16.     if (helper.Helper_MsgErr(LanguageStr("_cleartemp_text"), "Xilisoft",4)==7)    //    ???
  17.         return 1;
  18.     var tmp=g_Config.GetValue("general", "flvtemppath");
  19.     
  20.     helper.Helper_RemoveDir(tmp);
  21.     */
  22. }
  23.  
  24. function settingsok()
  25. {
  26.     var minwindow = settings.minwindows.GetCheck();
  27.     var maxtask = settings.setting_spin.GetValue();
  28.     
  29.     if (maxtask<=0 || maxtask>10)
  30.     {
  31.         settings.ShowMessageBox(LanguageStr("_invalid_maxtask_number"), LanguageStr("_setting_error"), 1);
  32.     }
  33.     
  34.     var autodelete = settings.autodelfinishedtask.GetCheck();
  35.  
  36.     if(minwindow==true)
  37.     { 
  38.         minwindow=1;
  39.     }
  40.     else
  41.     {
  42.         minwindow=0;
  43.     }
  44.     
  45.     if(autodelete==true)
  46.     {
  47.         autodelete=1;
  48.     }
  49.     else
  50.     {
  51.         autodelete=0;
  52.     }
  53.  
  54.  
  55.     cfgSetInt("general", "minstartup", minwindow);
  56.     cfgSetInt("general", "autodelete", autodelete);
  57.  
  58.     cfgSetInt("general", "maxtask", maxtask);
  59.     
  60.  
  61.     TaskManager.MaxtTask = maxtask;
  62.     
  63.     settings.Close();
  64.  
  65.     var showdrop1 = settings.showdrop.GetCheck();
  66.     if(showdrop1==true)
  67.     cfgSetInt("general", "showdrop", 1);
  68.     else
  69.     cfgSetInt("general", "showdrop", 0);
  70.     
  71.     if(IsWindowVisible(popwin))
  72.     {
  73.         cfgSetInt("general","cx",popwin.GetWindowLeft());
  74.         cfgSetInt("general","cy",popwin.GetWindowTop());
  75.     }else if(IsWindowVisible(popupnotask))
  76.     {
  77.         cfgSetInt("general","cx",popupnotask.GetWindowLeft());
  78.         cfgSetInt("general","cy",popupnotask.GetWindowTop());
  79.     }
  80.     
  81.     
  82.     if(showdrop1&&(IsWindowVisible(popwin)||IsWindowVisible(popupnotask)))
  83.     return ;
  84.     else 
  85.     fudong_control();
  86.     
  87.         
  88.     
  89.  
  90. //    getisminwindow();
  91. }
  92.  
  93. function settingscancel()
  94. {
  95.     settings.Close();
  96. }
  97.  
  98.  
  99. function showsettings()
  100. {    
  101.     settings.ShowMessageBox = ShowMessageBox;
  102.     with (settings)
  103.     {
  104.         if (cfgGetInt("general", "minstartup", 0)!=0)
  105.         {
  106.             minwindows.SetCheck(true);    
  107.         }else
  108.         {
  109.             minwindows.SetCheck(false);    
  110.         }        
  111.     
  112.         if (cfgGetInt("general", "autodelete", 0)!=0)
  113.         {
  114.             autodelfinishedtask.SetCheck(true);
  115.         }else
  116.         {
  117.             autodelfinishedtask.SetCheck(false);
  118.         }
  119.         if (cfgGetInt("general", "showdrop", 0)==1)
  120.         {
  121.             showdrop.SetCheck(true);
  122.         }else
  123.         {
  124.             showdrop.SetCheck(false);
  125.         }
  126.         
  127.         
  128.         setting_spin.SetValue(TaskManager.MaxtTask);
  129.            
  130.         ShowModal();
  131.         SetForegroundWindow(MainWindow);
  132.         
  133.     }
  134. }
  135.  
  136. //
  137.  
  138.