[Pkg-mozext-commits] [nostalgy] 71/235: *** empty log message ***

David Prévot taffit at alioth.debian.org
Tue Oct 8 20:41:42 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository nostalgy.

commit ab1194c8ca6ec7a97edae3752202dada5c94828b
Author: frisch <frisch at 56b81dcf-5a2f-0410-9db0-014be2e416ff>
Date:   Thu May 3 14:52:28 2007 +0000

    *** empty log message ***
    
    
    git-svn-id: http://nostalgy.googlecode.com/svn/trunk@71 56b81dcf-5a2f-0410-9db0-014be2e416ff
---
 CHANGES                        |    7 +++++
 content/about.xhtml            |   27 +++++++++++++++++++-
 content/folders.js             |   25 +++++++++++++++++-
 content/messageOverlay.xul     |    4 +--
 content/nostalgy.js            |   55 ++++++++++++++++++++++++++++++++--------
 content/thunderbirdOverlay.xul |    6 ++---
 6 files changed, 107 insertions(+), 17 deletions(-)

diff --git a/CHANGES b/CHANGES
index 0f2bf3e..c7554cb 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Since 0.2.6
+  - does not show Saved Search Folders for Copy/Move commands completion
+  - makes it possible to add/remove tags with the Copy/Move commands
+  - makes it possible to "go" to a tag (i.e. select the corresponding view)
+  - Esc-Esc-Esc selects the "All" view (in addition to clearing the Quick
+    Search box)
+
 0.2.6
   - allow the user to configure shortcuts
 
diff --git a/content/about.xhtml b/content/about.xhtml
index b67c3d0..2a0a722 100644
--- a/content/about.xhtml
+++ b/content/about.xhtml
@@ -93,7 +93,7 @@ uppercase, you don't need to press Shift.</p>
     <tr><td>Esc-F</td><td>Focus the folder pane</td></tr>
     <tr><td>Esc-M</td><td>Focus the message pane</td></tr>
     <tr><td>Esc-Esc</td><td>Focus the thread pane</td></tr>
-    <tr><td>Esc-Esc-Esc</td><td>Focus the thread pane, clear quick search box</td></tr>
+    <tr><td>Esc-Esc-Esc</td><td>Focus the thread pane, clear quick search box, select the "All" view</td></tr>
     <tr><td>Esc-I</td><td>Focus the quick search box</td></tr>
     <tr><td>Ctrl-Left/Right</td>
          <td>Scroll the message from the thread pane</td></tr>
@@ -152,6 +152,31 @@ uppercase, you don't need to press Shift.</p>
 	header)	instead.</li>
    </ul>
 
+   <h3>Tags</h3>
+
+   <p>
+   Starting from version 2.0, Thunderbird supports so-called tags, which
+   are a generalization of former labels. Tags can be defined by the
+   user and several tags can be attached to a message.
+   </p>
+
+   <p>
+   Nostalgy helps you use tags. In the completion box for Go/Save/Copy 
+   commands, existing tags will appear prefixed with a semi-colon.
+   A "Go" command applied to a tag will restrict the current folder view
+   to show only the messages that have this tag. A "Save" or a "Copy"
+   command applied to a tag will toggle this tag for the selected
+   messages (the first selected message is used to determine if the
+   tag has to be added or removed). Note that Save and Copy have the same
+   behavior when a tag is selected.
+   </p>
+
+   <p>
+   It is possible to use a tag instead of a folder as a target for
+   Nostalgy's rules.
+   </p>
+
+
    <h3>In the Composer</h3>
 
    <p>Nostalgy adds some support for keyboard operations to the Composer window.</p>
diff --git a/content/folders.js b/content/folders.js
index 80ed382..f3d20a0 100644
--- a/content/folders.js
+++ b/content/folders.js
@@ -21,6 +21,7 @@ function mayLowerCase(s) {
 }
 
 function full_folder_name(folder) {
+  if (folder.tag) return (":" + folder.tag);
   var uri = folder.prettyName;
   while (!folder.isServer) {
     folder = folder.parent;
@@ -30,6 +31,7 @@ function full_folder_name(folder) {
 }
 
 function short_folder_name(folder) {
+  if (folder.tag) return folder.tag;
   var uri = folder.prettyName;
   if (folder.isServer) { return uri; }
   folder = folder.parent;
@@ -261,6 +263,8 @@ function FindFolderCropped(uri) {
 /** Folder traversal **/
 
 function IterateFoldersAllServers(f) {
+ IterateTags(f);
+
  var amService = 
     Components.classes["@mozilla.org/messenger/account-manager;1"]
               .getService(Components.interfaces.nsIMsgAccountManager);
@@ -291,12 +295,22 @@ function CompareFolderNames(a,b) {
 
 var sorted_subfolders = new Array();
 
+// ugly: should be passed as argument to IterateFolders-like functions
+var nostalgy_search_folder_options = {
+   require_file: true  // do we want only folder to which we can copy/move
+                       // messages to? (excludes saved search folder)
+     
+};
+
 function ClearNostalgyCache() {
   sorted_subfolders = new Array();
 }
 
 function IterateSubfolders(folder,f) {
- if (!folder.isServer || !restrict_to_current_server) { 
+ if ((!folder.isServer || !restrict_to_current_server)
+     && (folder.canFileMessages || 
+         !nostalgy_search_folder_options.require_file))
+ { 
   try { f(folder); }
   catch (ex) { if (ex == 1) { return; } else { throw ex; } }
  }
@@ -328,10 +342,19 @@ function IterateSubfolders(folder,f) {
 }  
 
 function IterateFoldersCurrentServer(f) {
+ IterateTags(f);
  var server = gDBView.msgFolder.server;
  IterateSubfolders(server.rootMsgFolder,f);
 }
 
+function IterateTags(f) {
+ var tagService = 
+  Components.classes["@mozilla.org/messenger/tagservice;1"]
+            .getService(Components.interfaces.nsIMsgTagService);
+ var tagArray = tagService.getAllTags({});
+ for (var i = 0; i < tagArray.length; i++) f(tagArray[i]);
+}
+
 function IterateFolders(f) {
  if (restrict_to_current_server) { IterateFoldersCurrentServer(f); }
  else { IterateFoldersAllServers(f); }
diff --git a/content/messageOverlay.xul b/content/messageOverlay.xul
index 77a4cc6..4b1228a 100644
--- a/content/messageOverlay.xul
+++ b/content/messageOverlay.xul
@@ -8,11 +8,11 @@
 
  <keyset id="mailKeys">
   <key key="S" 
-       oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, '');"/>
+       oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, true);"/>
   <key key="S" modifiers="shift" 
        oncommand="NostalgySuggested('&nostalgy.move-memo;',MoveToFolder);"/>
   <key key="C" 
-       oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
+       oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, true);"/>
   <key key="C" modifiers="shift" 
        oncommand="NostalgySuggested('&nostalgy.copy-memo;',CopyToFolder);"/>
  </keyset>
diff --git a/content/nostalgy.js b/content/nostalgy.js
index c5cac15..e8765f7 100644
--- a/content/nostalgy.js
+++ b/content/nostalgy.js
@@ -8,6 +8,11 @@ var nostalgy_label = null;
 var nostalgy_th_statusBar = null;
 var nostalgy_cmdLabel = null;
 
+
+//function NostalgyMessageTag(key, addKey) {
+//  alert("NostalgyMessageTag(key=" + key + ", addKey=" + addKey + ")");
+//}
+
 /** Keys **/
 
 function NostalgySetKey(s,k) {
@@ -149,6 +154,7 @@ var NostalgyRules =
     var rules = this.rules;
     var i = 0;
     var current_folder = full_folder_name(gDBView.msgFolder);
+    nostalgy_search_folder_options.require_file = true;
     for (i = 0; (i < rules.length) && (!folder); i++) {
       var r = rules[i];
       if (((r.subject && match_contains(subject,r.contains))
@@ -169,7 +175,7 @@ NostalgyRules.register();
 
 var default_label = "";
 var focus_saved = null;
-var command = null;
+var nostalgy_command = null;
 //var last_folder_author = new Array();
 //var last_folder_subject = new Array();
 var last_folder_server = new Array();
@@ -191,7 +197,16 @@ var NostalgyFolderListener = {
  OnItemEvent: function(folder, event) { }
 }
 
+function debug(aText)
+{
+  var csClass = Components.classes['@mozilla.org/consoleservice;1'];
+  var cs = csClass.getService(Components.interfaces.nsIConsoleService);
+  cs.logStringMessage(aText);
+}
+
 function onNostalgyLoad() {
+// ToggleMessageTag = NostalgyMessageTag;
+
  NostalgyRules.register_keys();
 
  nostalgy_folderBox = gEBI("nostalgy-folderbox");
@@ -274,16 +289,17 @@ function NostalgyCollapseFolderPane() {
 
 
 
-function NostalgyCmd(lab,cmd,init) {
+function NostalgyCmd(lab,cmd,require_file) {
  focus_saved = document.commandDispatcher.focusedElement;
  if (!focus_saved) { focus_saved = gEBI("messagepane").contentWindow; }
 
+ nostalgy_search_folder_options.require_file = require_file;
  nostalgy_cmdLabel.value = lab;
- command = cmd;
+ nostalgy_command = cmd;
  nostalgy_th_statusBar.hidden = true;
  nostalgy_folderBox.shell_completion = false;
  nostalgy_statusBar.hidden = false;
- nostalgy_folderBox.value = init;
+ nostalgy_folderBox.value = "";
 
  setTimeout(function() { 
     nostalgy_folderBox.focus();  
@@ -296,8 +312,8 @@ function NostalgyCmd(lab,cmd,init) {
 
 function NostalgyRunCommand() {
   var f = NostalgyResolveFolder(nostalgy_folderBox.value);
-  if (f) { command(f); }
-  else { alert("No folder " + nostalgy_folderBox.value); }
+  if (f) nostalgy_command(f); 
+  else alert("No folder " + nostalgy_folderBox.value);
   NostalgyHide();
 }
 
@@ -411,6 +427,11 @@ function NostalgySelectLastMsg() {
 }
 
 function ShowFolder(folder) {
+  if (folder.tag) {
+    ViewChange(kViewTagMarker + folder.key, folder.tag);
+    return;
+  }
+
   var folderTree = GetFolderTree();
   var totry = 1;
   var savedFolderView;
@@ -440,15 +461,28 @@ function ShowFolder(folder) {
   }
 }
 
+function NostalgyToggleMessageTag(tag) {
+  if (GetNumSelectedMessages() < 1) return;
+
+  var msgHdr = gDBView.hdrForFirstSelectedMessage;
+  var curKeys = msgHdr.getStringProperty("keywords");
+  if (msgHdr.label) curKeys += " $label" + msgHdr.label;
+  var addKey  = (" " + curKeys + " ").indexOf(" " + tag.key + " ") < 0;
+
+  ToggleMessageTag(tag.key,addKey);
+}
+
 function MoveToFolder(folder) {
  register_folder(folder);
- gDBView.doCommandWithFolder(nsMsgViewCommandType.moveMessages,folder);
+ if (folder.tag) NostalgyToggleMessageTag(folder);
+ else gDBView.doCommandWithFolder(nsMsgViewCommandType.moveMessages,folder);
  SetNextMessageAfterDelete();
 }
 
 function CopyToFolder(folder) {
  register_folder(folder);
- gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages,folder);
+ if (folder.tag) NostalgyToggleMessageTag(folder);
+ else gDBView.doCommandWithFolder(nsMsgViewCommandType.copyMessages,folder);
 }
 
 function NostalgySuggested(lab,cmd) {
@@ -486,8 +520,9 @@ function NostalgyEscape(ev) {
     function(){ if (NostalgyEscapePressed==i) NostalgyEscapePressed = 0; },
     300);
   if (NostalgyEscapePressed == 3) { 
-	onClearSearch();
-	setTimeout(NostalgyFocusThreadPane,100);
+    onClearSearch();
+    ViewChange(kViewItemAll, "All");  // TODO: localized string
+    setTimeout(NostalgyFocusThreadPane,100);
   }
   if (NostalgyEscapePressed == 2) NostalgyFocusThreadPane();
 }
diff --git a/content/thunderbirdOverlay.xul b/content/thunderbirdOverlay.xul
index f799d3e..0b2a031 100644
--- a/content/thunderbirdOverlay.xul
+++ b/content/thunderbirdOverlay.xul
@@ -20,16 +20,16 @@
  <keyset id="mailKeys">
   <key id="nostalgy_key_go"
        key="G" 
-       oncommand="NostalgyCmd('&nostalgy.go-memo;', ShowFolder, '');"/>
+       oncommand="NostalgyCmd('&nostalgy.go-memo;', ShowFolder, false);"/>
   <key id = "nostalgy_key_save"
        key="S" 
-       oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, '');"/>
+       oncommand="NostalgyCmd('&nostalgy.move-memo;', MoveToFolder, true);"/>
   <key id = "nostalgy_key_save_suggest"
        key="S" modifiers="shift" 
        oncommand="NostalgySuggested('&nostalgy.move-memo;',MoveToFolder);"/>
   <key id = "nostalgy_key_copy"
        key="C" 
-       oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, '');"/>
+       oncommand="NostalgyCmd('&nostalgy.copy-memo;', CopyToFolder, true);"/>
   <key id = "nostalgy_key_copy_suggest"
        key="C" modifiers="shift" 
        oncommand="NostalgySuggested('&nostalgy.copy-memo;',CopyToFolder);"/>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/nostalgy.git



More information about the Pkg-mozext-commits mailing list