var  appTitle = '桌面整理箱 for 鱼鱼2';


function imgDropOnMouseDown()
{
  Open( GetSetting("folder") );
}

function widgetOnDropFile(fileNameList)
{
  if(txthint.Visible)
    return;

  var fso = new ActiveXObject("Scripting.FileSystemObject");
  
  var sl = fileNameList.split("|");
  
  txthint.Visible = true;
  
  for(i=0;i<sl.length;i++)
  {
    Print( sl[i] );
    try
    {
      fso.MoveFile( sl[i] ,GetSetting("folder")  );
    }
    catch(e)
    {
    
      try
      {
        fso.MoveFolder( sl[i] ,GetSetting("folder")  );
      }
      catch(e)
      {
        showPopHint(appTitle,'移动文件(夹) "'+  sl[i] +'" 失败\n请检查是否存在重名文件(夹)');
      }
    }
  
  }

  txthint.Visible = false;
  
}

function widgetOnInit()
{
  imgDrop.tooltip = '打开文件夹" ' + GetSetting("folder") + ' "';
}

function OnAllSettingsSaved()
{
  widgetOnInit(); 
}

function widgetOnStart()
{
  if(GetSetting("folder")=="\\")
  {      
    showTrayHint(appTitle,'初次使用的时候请在"选项"中设置目标文件夹，留空则默认指向"我的文档"');
    ShowSetting;
  }
  
}