Bug #256545 --> Add a new quick search term for searching for To or Cc.

Patch by Mark Peek <mark@peek.org>

sr=mscott
This commit is contained in:
scott%scott-macgregor.org 2005-06-21 00:38:32 +00:00
parent 223a59ef98
commit 88f41b3c4c
3 changed files with 21 additions and 4 deletions

View File

@ -1196,7 +1196,7 @@
#ifdef XP_UNIX
#ifndef XP_MACOSX
<menuitem id="menu_accountmgr" label="&accountManagerCmd.label;" accesskey="&accountManagerCmdUnix.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog()"/>
#endif
#endif
</menupopup>
@ -1667,12 +1667,12 @@
#ifndef XP_UNIX
<menuseparator id="prefSep"/>
<menuitem id="menu_accountmgr" label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog()"/>
#else
#ifdef XP_MACOSX
<menuseparator id="prefSep"/>
<menuitem id="menu_accountmgr" label="&accountManagerCmd.label;" accesskey="&accountManagerCmd.accesskey;" oncommand="MsgAccountManager(null);"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog('mailnews', 'chrome://messenger/content/pref-mailnews.xul','mailnews')"/>
<menuitem id="menu_preferences" oncommand="openOptionsDialog()"/>
#endif
#endif
</menupopup>
@ -1931,6 +1931,8 @@
oncommand="changeQuickSearchMode(this)" />
<menuitem value="2" label="&searchSubjectOrSenderMenu.label;" type="radio"
checked="true" oncommand="changeQuickSearchMode(this)"/>
<menuitem value="5" label="&searchRecipient.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/>
<menuitem value="3" label="&searchMessageBody.label;" type="radio"
oncommand="changeQuickSearchMode(this)"/>
<menuitem value="4" label="&findInMessageMenu.label;" type="radio"

View File

@ -65,6 +65,7 @@ const kQuickSearchSender = 1;
const kQuickSearchSenderOrSubject = 2;
const kQuickSearchBody = 3;
const kQuickSearchHighlight = 4;
const kQuickSearchRecipient = 5;
var gFinder = Components.classes["@mozilla.org/embedcomp/rangefind;1"].createInstance()
.QueryInterface(Components.interfaces.nsIFind);
@ -470,6 +471,19 @@ function createSearchTerms()
term.booleanAnd = false;
searchTermsArray.AppendElement(term);
}
// create, fill, and append the recipient
if (gSearchInput.searchMode == kQuickSearchRecipient)
{
term = gSearchSession.createTerm();
value = term.value;
value.str = termList[i];
term.value = value;
term.attrib = nsMsgSearchAttrib.ToOrCC;
term.op = nsMsgSearchOp.Contains;
term.booleanAnd = false;
searchTermsArray.AppendElement(term);
}
}
}

View File

@ -508,7 +508,8 @@
<!-- Quick Search Menu Bar -->
<!ENTITY searchSubjectMenu.label "Subject">
<!ENTITY searchSenderMenu.label "Sender">
<!ENTITY searchSubjectOrSenderMenu.label "Subject Or Sender">
<!ENTITY searchSubjectOrSenderMenu.label "Subject or Sender">
<!ENTITY searchRecipient.label "To or Cc">
<!ENTITY searchMessageBody.label "Entire Message">
<!ENTITY findInMessageMenu.label "Find In Message">
<!ENTITY saveAsVirtualFolderMenu.label "Save Search as a Folder...">