Bug 512110 - "Per-folder filters on newsgroups cannot be edited" [r+sr=bienvenu]
authorKent James <kent@caspia.com>
Mon, 24 Aug 2009 13:43:22 +0100
changeset 3388 c34080e699eac528b14d82346ede41acf5b3f55f
parent 3387 a23c5d7a07668ceeda1ae09efec4b06a6961e863
child 3389 dfe67096c8d89e1860b67c2129c2c28e61302a26
push idunknown
push userunknown
push dateunknown
bugs512110
Bug 512110 - "Per-folder filters on newsgroups cannot be edited" [r+sr=bienvenu]
mailnews/base/content/folderWidgets.xml
mailnews/news/src/nsNewsFolder.cpp
mailnews/news/src/nsNewsFolder.h
--- a/mailnews/base/content/folderWidgets.xml
+++ b/mailnews/base/content/folderWidgets.xml
@@ -666,16 +666,17 @@
         <body><![CDATA[
           for (var i in this.childNodes) {
             var child = this.childNodes[i];
             if (!child || !child._folder)
               continue;
             if (child._folder.URI == aFolder.URI) {
               // Making an assumption about our DOM positioning here.
               this.parentNode.selectedIndex = i;
+              this.parentNode.setAttribute("label", aFolder.name);
               return;
             }
             // Is this a subfolder (that we expect to see)?
             if (child.tagName == "menu" && child._folder.isAncestorOf(aFolder)) {
               // If this is a subfolder of what's in question, we merely appear
               // to select this node.
               this.parentNode.setAttribute("label", aFolder.name);
               return;
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -1941,16 +1941,29 @@ nsMsgNewsFolder::GetFilterList(nsIMsgWin
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   NS_IF_ADDREF(*aResult = mFilterList);
   return NS_OK;
 }
 
 NS_IMETHODIMP
+nsMsgNewsFolder::GetEditableFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList **aResult)
+{
+  // We don't support pluggable filter list types for news.
+  return GetFilterList(aMsgWindow, aResult);
+}
+
+NS_IMETHODIMP
+nsMsgNewsFolder::SetEditableFilterList(nsIMsgFilterList *aFilterList)
+{
+  return SetFilterList(aFilterList);
+}
+
+NS_IMETHODIMP
 nsMsgNewsFolder::OnStopRunningUrl(nsIURI *aUrl, nsresult aExitCode)
 {
  if (m_tempMessageStream)
   {
     m_tempMessageStream->Close();
     m_tempMessageStream = nsnull;
   }
   m_downloadingMultipleMessages = PR_FALSE;
--- a/mailnews/news/src/nsNewsFolder.h
+++ b/mailnews/news/src/nsNewsFolder.h
@@ -104,17 +104,19 @@ public:
   NS_IMETHOD Compact(nsIUrlListener *aListener, nsIMsgWindow *aMsgWindow);
   NS_IMETHOD DownloadAllForOffline(nsIUrlListener *listener, nsIMsgWindow *msgWindow);
   NS_IMETHOD GetSortOrder(PRInt32 *order);
   NS_IMETHOD SetSortOrder(PRInt32 order);
 
   NS_IMETHOD Shutdown(PRBool shutdownChildren);
 
   NS_IMETHOD GetFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList **aFilterList);
+  NS_IMETHOD GetEditableFilterList(nsIMsgWindow *aMsgWindow, nsIMsgFilterList **aFilterList);
   NS_IMETHOD SetFilterList(nsIMsgFilterList *aFilterList);
+  NS_IMETHOD SetEditableFilterList(nsIMsgFilterList *aFilterList);
   NS_IMETHOD ApplyRetentionSettings();
 
 protected:
   // helper routine to parse the URI and update member variables
   nsresult AbbreviatePrettyName(nsAString& prettyName, PRInt32 fullwords);
   nsresult ParseFolder(nsILocalFile *path);
   nsresult CreateSubFolders(nsILocalFile *path);
   nsresult AddDirectorySeparator(nsILocalFile *path);