Last Comment Bug 59049 - Disable "Search subfolders" if no subfolders exist
: Disable "Search subfolders" if no subfolders exist
Status: RESOLVED FIXED
[see comment #11 for what todo][good ...
:
Product: SeaMonkey
Classification: Client Software
Component: MailNews: General (show other bugs)
: Trunk
: All All
: -- minor (vote)
: ---
Assigned To: Edmund Wong (:ewong)
:
Mentors:
Depends on:
Blocks: 943096
  Show dependency treegraph
 
Reported: 2000-11-03 14:57 PST by (not reading, please use seth@sspitzer.org instead)
Modified: 2013-11-25 14:59 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
Disable "Search subfolders" if no subfolders exist. (v1) (2.59 KB, patch)
2012-02-27 05:56 PST, Edmund Wong (:ewong)
mnyromyr: review-
Details | Diff | Splinter Review
Disable "Search subfolders" if no subfolders exist. (v2) (2.50 KB, patch)
2012-03-07 23:37 PST, Edmund Wong (:ewong)
mnyromyr: review-
Details | Diff | Splinter Review
Disable "Search subfolders" if no subfolders exist. (v3) (2.48 KB, patch)
2012-03-11 21:00 PDT, Edmund Wong (:ewong)
mnyromyr: review+
mnyromyr: superreview+
Details | Diff | Splinter Review

Description (not reading, please use seth@sspitzer.org instead) 2000-11-03 14:57:07 PST
here are some suggestions for the "Search subfolders" check box in search.

1)  based on the selection in the picker, we should:

a) if the selection is mail (server or folder) use "subfolders"
b) if the selection is news (server or group) use "subgroups"

if the selection is an object with out children, diable the check box (make it
greyed out.)

"subgroups" is better than "subfolders" but still sub optimal.

jglick, can you come up with a better one?
Comment 1 jglick 2000-11-06 09:54:47 PST
cc'ing Robin Foster for wording suggestion. "subgroups" seems ok to me. Robin, 
is that the correct spelling?
Comment 2 robinf 2000-11-06 10:47:03 PST
Yes, "subgroups" spelling is OK.
Comment 3 (not reading, please use seth@sspitzer.org instead) 2002-12-16 12:56:48 PST
taking all of varada's bugs.
Comment 4 Robert Kaiser 2009-06-14 07:39:52 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 5 Robert Kaiser 2009-06-14 07:43:12 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 6 Robert Kaiser 2009-06-14 07:49:28 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 7 Robert Kaiser 2009-06-14 08:32:49 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 8 Robert Kaiser 2009-06-14 08:44:59 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 9 Robert Kaiser 2009-06-14 14:52:00 PDT
This bug report is registered in the SeaMonkey product, but has been without a comment since the inception of the SeaMonkey project. This means that it was logged against the old Mozilla suite and we cannot determine that it's still valid for the current SeaMonkey suite. Because of this, we are setting it to an UNCONFIRMED state.

If you can confirm that this report still applies to current SeaMonkey 2.x nightly builds, please set it back to the NEW state along with a comment on how you reproduced it on what Build ID, or if it's an enhancement request, why it's still worth implementing and in what way.
If you can confirm that the report doesn't apply to current SeaMonkey 2.x nightly builds, please set it to the appropriate RESOLVED state (WORKSFORME, INVALID, WONTFIX, or similar).
If no action happens within the next few months, we move this bug report to an EXPIRED state.

Query tag for this change: mass-UNCONFIRM-20090614
Comment 10 Robert Kaiser 2010-04-28 12:59:34 PDT
MASS-CHANGE:
This bug report is registered in the SeaMonkey product, but still has no comment since the inception of the SeaMonkey project 5 years ago.

Because of this, we're resolving the bug as EXPIRED.

If you still can reproduce the bug on SeaMonkey 2 or otherwise think it's still valid, please REOPEN it and if it is a platform or toolkit issue, move it to the according component.

Query tag for this change: EXPIRED-20100420
Comment 11 Karsten Düsterloh 2011-10-30 14:59:07 PDT
Since we don't show "subgroups" as such, rewording that is useless.

But disabling the subfolder search if not needed still makes sense.
Comment 12 Edmund Wong (:ewong) 2012-02-27 05:56:49 PST
Created attachment 600879 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v1)
Comment 13 Karsten Düsterloh 2012-03-07 14:46:41 PST
Comment on attachment 600879 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v1)

Some nits:

>+  if (window.arguments && window.arguments[0]) {

Brace on its own line,please.

>+    selectFolder(window.arguments[0].folder);
>+    updateSubFolder(window.arguments[0].folder);

Probably worth putting window.arguments[0].folder in a variable first and using that then.

>+function updateSubFolder(folderSelect)

Function name should start with an uppercase letter, function parameters should have an a prefix, i.e. aFolderSelect.

>+  var folder = folderSelect;
>+  folder = GetMsgFolderFromUri(folder, true);

Why not just 
  var folder = GetMsgFolderFromUri(aFolderSelect, true);

>+  if (!folder)
>+  {
>+    folder = folderSelect;
>+  }

You're always passing an URI string as folderSelect, so what's the point of this?
If the URI is not tied to a folder, just disable the UI element.

>+  var subFolder = document.getElementById("checkSearchSubFolders");
>+  subFolder.disabled = ! folder.hasSubFolders;

No space after the !, please.
Comment 14 Edmund Wong (:ewong) 2012-03-07 23:37:08 PST
Created attachment 603983 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v2)
Comment 15 Karsten Düsterloh 2012-03-09 14:39:37 PST
Comment on attachment 603983 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v2)

>+    var winArgFolder = window.arguments[0].folder;
>+

Superfluous empty line.

>+function UpdateSubFolder(afolderSelect)

Should be aFolderSelect.

>+  var folder = GetMsgFolderFromUri(afolderSelect, true);
>+
>+  var subFolder = document.getElementById("checkSearchSubFolders");
>+  subFolder.disabled = !folder.hasSubFolders;

The empty line and the subFolder variable are not necessary, but the null check for folder is. 
What I meant was to disable the UI element if folder is null or hasn't any subfolders.
Sorry for being unclear.
Comment 16 Edmund Wong (:ewong) 2012-03-11 21:00:00 PDT
Created attachment 604828 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v3)
Comment 17 Karsten Düsterloh 2012-03-12 15:18:15 PDT
Comment on attachment 604828 [details] [diff] [review]
Disable "Search subfolders" if no subfolders exist. (v3)

Yep, that's it! :)
r/moa=me.
Comment 18 Edmund Wong (:ewong) 2012-03-12 18:10:07 PDT
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/4b5da7e5d068

Note You need to log in before you can comment on or make changes to this bug.