Default columns in saved searches?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Default columns in saved searches?

Nathan Huffheim
Any one know how to have it so that when I save a search,
the columns that will be displayed in that search folder
will be pre-defined by myself?

In other words, when I click a search folder, I don't want
the Junk Status column displayed.  And I want the Junk Status
column not displayed automatically at the time that I save any
searches.  And the Junk Status column is just one of several
columns I want to do this with.

I'm looking for programmatic ways to do this or existing
add-ons.  Thanks
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Default columns in saved searches?

Andrew Sutherland-3
On 05/19/2012 11:07 AM, Nathan Huffheim wrote:
> Any one know how to have it so that when I save a search,
> the columns that will be displayed in that search folder
> will be pre-defined by myself?

FolderDisplayWidget manages this and stores things on the db folder
info.  Check out getColumnStates and persistColumnStates:

http://mxr.mozilla.org/comm-central/source/mail/base/content/folderDisplay.js#657
http://mxr.mozilla.org/comm-central/source/mail/base/content/folderDisplay.js#468

You can just manually set that representation to the dbfolderinfo's
property yourself.  While the persisted representation has no guarantee
that it won't change, it's not super likely to change and would very
likely end up with migration logic if it does change.

(The alternative is to simulate user activity to the
FolderDisplayWidget, but I think that would be more likely to break if
we fix the tabs implementation, not to mention be confusing to the user
and otherwise a giant hack.)

Andrew
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird
Reply | Threaded
Open this post in threaded view
|

Re: Default columns in saved searches?

Andrew Sutherland-3
In reply to this post by Nathan Huffheim
On 05/19/2012 11:07 AM, Nathan Huffheim wrote:
> In other words, when I click a search folder, I don't want
> the Junk Status column displayed. And I want the Junk Status
> column not displayed automatically at the time that I save any
> searches. And the Junk Status column is just one of several
> columns I want to do this with.

Er, it's also worth noting that the other alternative is to change our
heuristics for picking the default columns to display for a folder that
did not have persisted settings.

This is the logic that actually makes the decisions and it can be
decorated/monkey-patched:
http://mxr.mozilla.org/comm-central/source/mail/base/content/folderDisplay.js#518

It is informed by the list of DEFAULT_COLUMNS and
COLUMN_DEFAULT_TESTERS, which you can augment/manipulate in an overlay:
http://mxr.mozilla.org/comm-central/source/mail/base/content/folderDisplay.js#390

We have limited default heuristics, and if you have a proposal that you
think would be broadly useful to the user-base, enhancement patches
would be considered if they pass ux-review by bwinton (Blake Winton).
Either a bug or the tb-planning mailing list is probably the right place
for that.  There may already be some bugs requesting such changes...

Andrew
_______________________________________________
dev-apps-thunderbird mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-apps-thunderbird