Print Contact and Print Contact Preview menu items in SeaMonkey address book always active

RESOLVED FIXED in Future

Status

defect
--
minor
RESOLVED FIXED
10 months ago
8 months ago

People

(Reporter: frg, Assigned: frg)

Tracking

(Blocks 1 bug)

SeaMonkey 2.54 Branch
Future
Dependency tree / graph

SeaMonkey Tracking Flags

(seamonkey2.57esr fixed, seamonkey2.63 fixed)

Details

Attachments

(1 attachment)

Print and Print Preview in the adress book should be unavailable if no contact is selcted. This got fixed in TB/mailnews in Bug 1320475. As far as I see it this never worked or was available in SeaMonkey. If you didn't select a contact the commands would do nothing.

+++ This bug was initially created as a clone of Bug #1320475 +++

+++ This bug was initially created as a clone of Bug #1319409 +++

(In reply to Thomas D. (needinfo?me) from Bug 1319409 comment #15)
> ::: mail/components/addrbook/content/addressbook.js
> @@ +336,1 @@
> >      return;
> 
> Right, but I wonder why we need the check for selected directory at all.
> There's no way you can select a contact without prior selection of a
> directory, so this can getSelectedDirectory can never fail. So I think we
> can just drop the check for selected directory, uri isn't otherwise used in
> this function.
> Even the check for selected cards does not belong here; ironically, they
> never bothered to disable the menuitems/command so you can still click print
> contact or print contact preview even without a contact selected, which will
> silently fail on our condition here.

STR

1) In main AB, deselect all contacts by Ctrl+clicking
2) Press Ctrl+P or File > Print Contact | Print Preview Contact

Actual result

- Keyboard shortcut / Menus are enabled, but do nothing.

Expected result

- Where we do nothing, menus and keyboard shortcut must be disabled. 

Implementation:
- Technically, we want to disable the respective commands using their controllers' isCommandEnabled function.
- Turns out that these twins commands are only half implemented; for starters, there's nothing on the resultspane controller.
- Then we have to look into the logics and see which scenarios we want to enable or not.

I've got this working on my local installation by adding the missing cases on the controller switch cases, and massaging conditions for isCommandEnabled a bit, plus actually adding the respective goUpdateCommand(...) to the CommandUpdate_AddressBook() function. Btw that function seems to run at least twice for every selection change, not sure if that's really needed.
Summary: Print and Print preview menu items in SeaMonkey address book always active. → Print Contact and Print Contact Preview menu items in SeaMonkey address book always active.
Summary: Print Contact and Print Contact Preview menu items in SeaMonkey address book always active. → Print Contact and Print Contact Preview menu items in SeaMonkey address book always active
Tested in 2.53 with backport of bug 1320475.

We used different ids from Thunderbird. Aligning them with mailnews should cause no problems in the base product and add-ons would imho need to be changed for 2.57 anyway if they really use the ids directly.
Attachment #9022462 - Flags: review?(iann_bugzilla)
Attachment #9022462 - Flags: approval-comm-esr60?
Comment on attachment 9022462 [details] [diff] [review]
1504543-printpreview.patch

The reference to bug 1319409 confused me to start with
r/a=me
Attachment #9022462 - Flags: review?(iann_bugzilla)
Attachment #9022462 - Flags: review+
Attachment #9022462 - Flags: approval-comm-esr60?
Attachment #9022462 - Flags: approval-comm-esr60+
Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/4020b651ce70
Port Bug 1320475 [Fix broken controllers for cmd_printcard and cmd_printcardpreview] to SeaMonkey. r=IanN
Status: ASSIGNED → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.