Bug 295542 Add New -> Saved Search in mail window file menu

p=me r=mnyromyr sr=bienvenu a=asa
This commit is contained in:
bugzilla%arlen.demon.co.uk 2005-06-07 23:26:57 +00:00
parent 1ae73e62e8
commit 3fdb31428a
16 changed files with 24 additions and 228 deletions

View File

@ -63,8 +63,6 @@ messenger.jar:
content/messenger/msgFolderPickerOverlay.xul (/mailnews/base/resources/content/msgFolderPickerOverlay.xul)
content/messenger/renameFolderDialog.xul (/mailnews/base/resources/content/renameFolderDialog.xul)
content/messenger/renameFolderDialog.js (/mailnews/base/resources/content/renameFolderDialog.js)
content/messenger/virtualFolderName.xul (/mailnews/base/resources/content/virtualFolderName.xul)
content/messenger/virtualFolderName.js (/mailnews/base/resources/content/virtualFolderName.js)
content/messenger/virtualFolderProperties.xul (/mailnews/base/resources/content/virtualFolderProperties.xul)
content/messenger/virtualFolderProperties.js (/mailnews/base/resources/content/virtualFolderProperties.js)
content/messenger/virtualFolderListDialog.xul (/mailnews/base/resources/content/virtualFolderListDialog.xul)

View File

@ -38,7 +38,4 @@
<!ENTITY renameFolderDialog.title "Rename Folder">
<!ENTITY rename.label "Enter the new name for your folder:">
<!ENTITY rename.accesskey "e">
<!ENTITY createVFDialog.title "Create Virtual Folder">
<!ENTITY virtualFolder.label "Enter the name for your virtual folder:">
<!ENTITY virtualFolder.accesskey "E">
<!ENTITY rename.accesskey "E">

View File

@ -39,7 +39,6 @@
locale/@AB_CD@/messenger/folderpane.dtd (%chrome/messenger/folderpane.dtd)
locale/@AB_CD@/messenger/newFolderDialog.dtd (%chrome/messenger/newFolderDialog.dtd)
locale/@AB_CD@/messenger/renameFolderDialog.dtd (%chrome/messenger/renameFolderDialog.dtd)
locale/@AB_CD@/messenger/virtualFolderName.dtd (%chrome/messenger/virtualFolderName.dtd)
locale/@AB_CD@/messenger/folderProps.dtd (%chrome/messenger/folderProps.dtd)
locale/@AB_CD@/messenger/subscribe.dtd (%chrome/messenger/subscribe.dtd)
locale/@AB_CD@/messenger/subscribe.properties (%chrome/messenger/subscribe.properties)

View File

@ -1035,21 +1035,6 @@ function RemoveMailOfflineObserver()
observerService.removeObserver(mailOfflineObserver,"network:offline-status-changed");
}
function getViewName(okCallbackFunc, defaultViewName)
{
var preselectedURI = GetSelectedFolderURI();
var folderTree = GetFolderTree();
var name = GetFolderNameFromUri(preselectedURI, folderTree);
name += defaultViewName + "-view";
var dialog = window.openDialog(
"chrome://messenger/content/virtualFolderName.xul",
"newFolder",
"chrome,titlebar,modal",
{siblingFolderURI: preselectedURI, searchFolderURIs: preselectedURI,
okCallback: okCallbackFunc, name: name});
}
function getSearchTermString(searchTerms)
{
var searchIndex;

View File

@ -110,16 +110,11 @@ function menu_new_init()
.getService(Components.interfaces.nsIIOService);
var showNew = ((serverType != 'nntp') && canCreateNew) || isInbox;
ShowMenuItem("menu_newFolder", showNew);
ShowMenuItem("menu_newVirtualFolder", showNew);
EnableMenuItem("menu_newFolder", !isIMAPFolder || !ioService.offline);
EnableMenuItem("menu_newVirtualFolder", true);
if (showNew)
{
if (isServer || isInbox)
SetMenuItemLabel("menu_NewFolder",
gMessengerBundle.getString("newFolder"));
else
SetMenuItemLabel("menu_NewFolder",
gMessengerBundle.getString("newSubfolder"));
}
SetMenuItemLabel("menu_newFolder", gMessengerBundle.getString((isServer || isInbox) ? "newFolderMenuItem" : "newSubfolderMenuItem"));
}
function goUpdateMailMenuItems(commandset)

View File

@ -1041,6 +1041,9 @@
<menuitem id="menu_newFolder" label="&newFolderCmd.label;"
oncommand="MsgNewFolder(NewFolder);"
accesskey="&newFolderCmd.accesskey;"/>
<menuitem id="menu_newVirtualFolder" label="&newVirtualFolderCmd.label;"
oncommand="MsgVirtualFolderProperties(false);"
accesskey="&newVirtualFolderCmd.accesskey;"/>
<menuitem id="newAccountMenuItem" label="&newAccountCmd.label;"
accesskey="&newAccountCmd.accesskey;"
oncommand="MsgAccountWizard();"/>

View File

@ -259,16 +259,13 @@ var folderListener = {
else if (gVirtualFolderTerms)
{
gDefaultSearchViewTerms = null;
ViewChangeByValue(-1); // override current view
viewDebug("searching gVirtualFolderTerms\n");
Search("");
// gVirtualFolderTerms = null;
loadVirtualFolder();
}
else if (gMsgFolderSelected.flags & MSG_FOLDER_FLAG_VIRTUAL)
{
viewDebug("selected folder is virtual\n");
gDefaultSearchViewTerms = null;
ViewChangeByValue(-1); // override current view
}
else
{

View File

@ -540,15 +540,18 @@ function Search(str)
function saveViewAsVirtualFolder()
{
// prompt for view name - create virtual folder in ok callback.
getViewName(CreateView, gSearchInput.value);
openNewVirtualFolderDialogWithArgs(gSearchInput.value, gSearchSession.searchTerms);
}
function CreateView(newName, origFolderURI)
// When the front end has finished loading a virtual folder, it calls openVirtualFolder
// to actually perform the folder search. We use this method instead of calling Search("") directly
// from FolderLoaded in order to avoid moving focus into the search bar.
function loadVirtualFolder()
{
var selectedFolder = GetResourceFromUri(origFolderURI);
var folderToSearch = selectedFolder.QueryInterface(Components.interfaces.nsIMsgFolder);
CreateVirtualFolder(newName, folderToSearch.parent, origFolderURI, gSearchSession.searchTerms);
// bit of a hack...if the underlying real folder is loaded with the same view value
// as the value for the virtual folder being searched, then ViewChangeByValue
// fails to change the view because it thinks the view is already correctly loaded.
// so set gCurrentViewValue back to All.
gCurrentViewValue = 0;
onEnterInSearchBar();
}

View File

@ -1,82 +0,0 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla.org code
*
* The Initial Developer of the Original Code is
* David Bienvenu.
* Portions created by the Initial Developer are Copyright (C) 2004
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* David Bienvenu <bienvenu@nventure.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
var dialog;
function onLoad()
{
var arguments = window.arguments[0];
dialog = {};
dialog.OKButton = document.documentElement.getButton("accept");
dialog.nameField = document.getElementById("name");
dialog.nameField.value = arguments.name;
dialog.nameField.select();
dialog.nameField.focus();
// call this when OK is pressed
dialog.okCallback = arguments.okCallback;
// pre select the folderPicker, based on what they selected in the folder pane
dialog.siblingFolderURI = arguments.siblingFolderURI;
dialog.searchFolderURIs = arguments.searchFolderURIs
moveToAlertPosition();
doEnabling();
}
function onOK()
{
dialog.okCallback(dialog.nameField.value, dialog.siblingFolderURI, dialog.searchFolderURIs);
return true;
}
function doEnabling()
{
if (dialog.nameField.value) {
if (dialog.OKButton.disabled)
dialog.OKButton.disabled = false;
} else {
if (!dialog.OKButton.disabled)
dialog.OKButton.disabled = true;
}
}

View File

@ -1,56 +0,0 @@
<?xml version="1.0"?> <!-- -*- Mode: xml; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- -->
<!--
- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is mozilla.org code.
-
- The Initial Developer of the Original Code is
- David Bienvenu.
- Portions created by the Initial Developer are Copyright (C) 2004
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- David Bienvenu <bienvenu@nventure.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either of the GNU General Public License Version 2 or later (the "GPL"),
- or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<?xml-stylesheet href="chrome://messenger/skin/dialogs.css" type="text/css"?>
<!DOCTYPE dialog SYSTEM "chrome://messenger/locale/virtualFolderName.dtd">
<dialog xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="&createVFDialog.title;"
ondialogaccept="return onOK();"
onload="onLoad();">
<stringbundleset id="stringbundleset"/>
<script type="application/x-javascript" src="chrome://messenger/content/mailCommands.js"/>
<script type="application/x-javascript" src="chrome://messenger/content/virtualFolderName.js"/>
<label value="&virtualFolder.label;" accesskey="&virtualFolder.accesskey;" control="name"/>
<textbox id="name" oninput="doEnabling();"/>
</dialog>

View File

@ -46,6 +46,8 @@
<!ENTITY newMessage.accesskey "N">
<!ENTITY newFolderCmd.label "Folder...">
<!ENTITY newFolderCmd.accesskey "F">
<!ENTITY newVirtualFolderCmd.label "Saved Search...">
<!ENTITY newVirtualFolderCmd.accesskey "S">
<!ENTITY newAccountCmd.label "Account...">
<!ENTITY newAccountCmd.accesskey "A">
<!ENTITY openMessageMenu.label "Open">
@ -566,7 +568,6 @@
<!ENTITY SearchNameOrEmail.accesskey "N">
<!ENTITY advancedButton.label "Advanced...">
<!ENTITY advancedButton.accesskey "A">
<!ENTITY saveAsVirtualFolderMenu.label "Save as Virtual Folder">
<!ENTITY clearButton.label "Clear">
<!ENTITY clearButton.accesskey "C">

View File

@ -46,6 +46,8 @@ compactFolder=Compact This Folder
removeAccount=Delete Account...
removeNewsAccount=Delete News Account...
removeFolder=Delete Folder
newFolderMenuItem=Folder...
newSubfolderMenuItem=Subfolder...
newFolder=New Folder...
newSubfolder=New Subfolder...
folderProperties=Folder Properties

View File

@ -1,6 +1,3 @@
<!ENTITY renameFolderDialog.title "Rename Folder">
<!ENTITY rename.label "Enter the new name for your folder:">
<!ENTITY rename.accesskey "E">
<!ENTITY createVFDialog.title "Create Virtual Folder">
<!ENTITY virtualFolder.label "Enter the name for your virtual folder:">
<!ENTITY virtualFolder.accesskey "E">

View File

@ -1,40 +0,0 @@
<!-- ***** BEGIN LICENSE BLOCK *****
- Version: MPL 1.1/GPL 2.0/LGPL 2.1
-
- The contents of this file are subject to the Mozilla Public License Version
- 1.1 (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS" basis,
- WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- for the specific language governing rights and limitations under the
- License.
-
- The Original Code is Mozilla.org code.
-
- The Initial Developer of the Original Code is
- David Bienvenu.
- Portions created by the Initial Developer are Copyright (C) 2004
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
- David Bienvenu <bienvenu@nventure.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
- the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- in which case the provisions of the GPL or the LGPL are applicable instead
- of those above. If you wish to allow use of your version of this file only
- under the terms of either the GPL or the LGPL, and not to allow others to
- use your version of this file under the terms of the MPL, indicate your
- decision by deleting the provisions above and replace them with the notice
- and other provisions required by the GPL or the LGPL. If you do not delete
- the provisions above, a recipient may use your version of this file under
- the terms of any one of the MPL, the GPL or the LGPL.
-
- ***** END LICENSE BLOCK ***** -->
<!ENTITY createVFDialog.title "Save Search">
<!ENTITY virtualFolder.label "Enter the name for your saved search folder: ">
<!ENTITY virtualFolder.accesskey "E">

View File

@ -7,7 +7,7 @@
<!ENTITY searchCriteriaButton.label "Search Criteria...">
<!ENTITY searchCriteriaButton.accesskey "S">
<!ENTITY searchTermCaption.label "Configure the search criteria used for this virtual folder: ">
<!ENTITY searchTermCaption.label "Configure the search criteria used for this saved search folder: ">
<!ENTITY folderSelectionCaption.label "Select the folders to search: ">
<!ENTITY chooseFoldersButton.label "Choose...">

View File

@ -125,13 +125,11 @@ messenger.jar:
content/messenger/msgFolderPickerOverlay.xul (base/resources/content/msgFolderPickerOverlay.xul)
content/messenger/renameFolderDialog.xul (base/resources/content/renameFolderDialog.xul)
content/messenger/renameFolderDialog.js (base/resources/content/renameFolderDialog.js)
content/messenger/virtualFolderName.xul (base/resources/content/virtualFolderName.xul)
content/messenger/virtualFolderProperties.xul (base/resources/content/virtualFolderProperties.xul)
content/messenger/virtualFolderProperties.js (base/resources/content/virtualFolderProperties.js)
content/messenger/virtualFolderListDialog.xul (base/resources/content/virtualFolderListDialog.xul)
content/messenger/virtualFolderListDialog.js (base/resources/content/virtualFolderListDialog.js)
content/messenger/messengerdnd.js (base/resources/content/messengerdnd.js)
content/messenger/virtualFolderName.js (base/resources/content/virtualFolderName.js)
content/messenger/mailContextMenus.js (base/resources/content/mailContextMenus.js)
content/messenger/msgPrintEngine.js (base/resources/content/msgPrintEngine.js)
content/messenger/msgPrintEngine.xul (base/resources/content/msgPrintEngine.xul)
@ -208,7 +206,6 @@ en-US.jar:
locale/en-US/messenger/folderpane.dtd (base/resources/locale/en-US/folderpane.dtd)
locale/en-US/messenger/newFolderDialog.dtd (base/resources/locale/en-US/newFolderDialog.dtd)
locale/en-US/messenger/renameFolderDialog.dtd (base/resources/locale/en-US/renameFolderDialog.dtd)
locale/en-US/messenger/virtualFolderName.dtd (base/resources/locale/en-US/virtualFolderName.dtd)
locale/en-US/messenger/virtualFolderProperties.dtd (base/resources/locale/en-US/virtualFolderProperties.dtd)
locale/en-US/messenger/virtualFolderListDialog.dtd (base/resources/locale/en-US/virtualFolderListDialog.dtd)
locale/en-US/messenger/folderProps.dtd (base/resources/locale/en-US/folderProps.dtd)