rem: if (gFilter.actionList.Count() <= 0) { if (gPromptService) gPromptService.alert(window, null, gFilterBundle.getString("mustSelectAction"));   gFilter = null; return false; }  
context: function saveFilter() {  var isNewFilter;  var filterAction;   var filterName= gFilterNameElement.value;  if (!filterName || filterName == "")   {    if (gPromptService)      gPromptService.alert(window, null,                           gFilterBundle.getString("mustEnterName"));    gFilterNameElement.focus();    return false;  }  if (!gFilter)   {    gFilter = gFilterList.createFilter(gFilterNameElement.value);    isNewFilter = true;    gFilter.enabled=true;  }   else   {    gFilter.filterName = gFilterNameElement.value;    //Prefilter is treated as a new filter.    if (gPreFillName)     {      isNewFilter = true;      gFilter.enabled=true;    }    else     {      isNewFilter = false;      gFilter.clearActionList();    }  }  if (gMoveToFolderCheckbox.checked)  {    var targetUri;    if (gActionTargetElement)      targetUri = gActionTargetElement.getAttribute("uri");    if (!targetUri || targetUri == "")     {      if (gPromptService)        gPromptService.alert(window, null,                             gFilterBundle.getString("mustSelectFolder"));      return false;    }          filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.MoveToFolder;    filterAction.targetFolderUri = targetUri;    gFilter.appendAction(filterAction);  }      if (gChangePriorityCheckbox.checked)    {    if (!gActionPriority.selectedItem)     {      if (gPromptService)        gPromptService.alert(window, null,                             gFilterBundle.getString("mustSelectPriority"));      return false;    }    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.ChangePriority;    filterAction.priority = gActionPriority.selectedItem.getAttribute("value");    gFilter.appendAction(filterAction);  }  if (gLabelCheckbox.checked)   {    if (!gActionLabel.selectedItem)     {      if (gPromptService)        gPromptService.alert(window, null,                             gFilterBundle.getString("mustSelectLabel"));      return false;    }    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.Label;    filterAction.label = gActionLabel.selectedItem.getAttribute("value");    gFilter.appendAction(filterAction);  }  if (gJunkScoreCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.JunkScore;    filterAction.junkScore = gActionJunkScore.selectedItem.getAttribute("value");    gFilter.appendAction(filterAction);  }  if (gMarkReadCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.MarkRead;    gFilter.appendAction(filterAction);  }  if (gMarkFlaggedCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.MarkFlagged;    gFilter.appendAction(filterAction);  }  if (gDeleteCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.Delete;    gFilter.appendAction(filterAction);  }  if (gWatchCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.WatchThread;    gFilter.appendAction(filterAction);  }    if (gKillCheckbox.checked)   {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.KillThread;    gFilter.appendAction(filterAction);  }  if (gDeleteFromServerCheckbox.checked)  {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.DeleteFromPop3Server;    gFilter.appendAction(filterAction);  }  if (gFetchBodyFromServerCheckbox.checked)  {    filterAction = gFilter.createAction();    filterAction.type = nsMsgFilterAction.FetchBodyFromPop3Server;    gFilter.appendAction(filterAction);  }  if (gFilter.actionList.Count() <= 0)  {    if (gPromptService)      gPromptService.alert(window, null,                           gFilterBundle.getString("mustSelectAction"));    // reset gFilter so that filter is still saved next time around    // see bug #186217    gFilter = null;    return false;  }  if (getScope(gFilter) == Components.interfaces.nsMsgSearchScope.newsFilter)    gFilter.filterType = Components.interfaces.nsMsgFilterType.NewsRule;  else    gFilter.filterType = Components.interfaces.nsMsgFilterType.InboxRule;  saveSearchTerms(gFilter.searchTerms, gFilter);  if (isNewFilter)   {    // new filter - insert into gFilterList    gFilterList.insertFilterAt(0, gFilter);  }  // success!  return true;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/fa53f5853374c5af2ab31f3a46052f3bda40f6c9/FilterEditor.js/buggy/mailnews/base/search/resources/content/FilterEditor.js