Closed Bug 1635458 Opened 4 years ago Closed 4 years ago

Add print context menu items and print button to address book toolbar

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, enhancement)

enhancement

Tracking

(seamonkey2.49esr unaffected, seamonkey2.53+ fixed, seamonkey2.57esr? affected)

RESOLVED FIXED
seamonkey 2.75
Tracking Status
seamonkey2.49esr --- unaffected
seamonkey2.53 + fixed
seamonkey2.57esr ? affected

People

(Reporter: iannbugzilla, Assigned: iannbugzilla)

References

Details

(Whiteboard: SM2.53.3)

Attachments

(2 files, 4 obsolete files)

Add print context menu by porting the relevant parts of the following bug to SeaMonkey:

  • Bug 364133 - Print command added to address book's context menu

Reorganise the File menu by porting the relevant parts of the following bug to SeaMonkey:

  • Bug 485371 - New gnomestripe icons for address book

Also add print button to address book toolbar

Attached patch Addressbook print patch (obsolete) — Splinter Review

[Approval Request Comment]
Regression caused by (bug #): n/a
User impact if declined: no print in context menu, no option to add print button to toolbar
Testing completed (on m-c, etc.): 2.53.3
Risk to taking this patch (and alternatives if risky): none
String changes made by this patch: 3 new strings

Attachment #9145864 - Flags: review?(frgrahl)
Attachment #9145864 - Flags: approval-comm-release?
Attachment #9145864 - Flags: approval-comm-esr60?

The one thing I've not done is add the print button as a default to the toolbar, fairly simple to tweak the patch to do that though.

Blocks: 1636098

The mailnews part would TB. Could you take a look for comm-central.

Flags: needinfo?(iann_bugzilla)
Attached patch Addressbook print patch v1.1 (obsolete) — Splinter Review

Disables print button when card pane has focus but nothing selected.

Attachment #9145864 - Attachment is obsolete: true
Attachment #9145864 - Flags: review?(frgrahl)
Attachment #9145864 - Flags: approval-comm-release?
Attachment #9145864 - Flags: approval-comm-esr60?
Flags: needinfo?(iann_bugzilla)
Attachment #9151330 - Flags: review?(frgrahl)
Attachment #9151330 - Flags: approval-comm-release?
Attachment #9151330 - Flags: approval-comm-esr60?

For comm-central, TB doesn't use cmd_print or cmd_printpreview in their addressbook so adding these should make no difference to them. Once other ab patches have landed on c-c, I'll create a c-c version of this patch.

Patch for comm-central. Potentially could use if (AppConstants.MOZ_APP_NAME == "seamonkey") around the code but I think that would add to the complexity and seeing only SeaMonkey would be calling with cmd_print or cmd_printpreview is unnecessary.

Attachment #9151343 - Flags: review?(frgrahl)
Comment on attachment 9151343 [details] [diff] [review]
Addressbook print patch v1.1 for cc

LGTM
Attachment #9151343 - Flags: review?(frgrahl) → review+
Comment on attachment 9151330 [details] [diff] [review]
Addressbook print patch v1.1

LGTM r/a+ for our release branches.
Attachment #9151330 - Flags: review?(frgrahl)
Attachment #9151330 - Flags: review+
Attachment #9151330 - Flags: approval-comm-release?
Attachment #9151330 - Flags: approval-comm-release+
Attachment #9151330 - Flags: approval-comm-esr60?
Attachment #9151330 - Flags: approval-comm-esr60+
Comment on attachment 9151343 [details] [diff] [review]
Addressbook print patch v1.1 for cc

For mailnews js changes - as TB doesn't use cmd_print or cmd_printpreview in it's addressbook, it should never call this code, but thought it was best to check no issues with putting it in.
Attachment #9151343 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9151343 [details] [diff] [review]
Addressbook print patch v1.1 for cc

Review of attachment 9151343 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/addrbook/content/abResultsPane.js
@@ +442,5 @@
>          return enabled;
>        }
> +      case "cmd_printpreview":
> +      case "cmd_print":
> +        var enabled = (GetNumSelectedCards() > 0);

I'm not sure why you're not using cmd_printcard?
Anyway, why not querySelectorAll like above to make it clear what's happening and also protecting against the case where the button is not there. Not sure that would happen in practice

::: suite/locales/en-US/chrome/mailnews/addressbook/abMainWindow.dtd
@@ +80,5 @@
>  <!ENTITY deleteItemButton.accesskey                     "D">
>  <!ENTITY newimButton.label                              "Instant Message">
>  <!ENTITY newimButton.accesskey                          "I">
> +<!ENTITY printButton.label                              "Print">
> +<!ENTITY printButton.accesskey                          "r">

at least in tb, r is taken for Redo
Attachment #9151343 - Flags: review?(mkmelin+mozilla)

(In reply to Magnus Melin [:mkmelin] from comment #10)

Comment on attachment 9151343 [details] [diff] [review]
Addressbook print patch v1.1 for cc

Review of attachment 9151343 [details] [diff] [review]:

::: mailnews/addrbook/content/abResultsPane.js
@@ +442,5 @@

     return enabled;
   }
  •  case "cmd_printpreview":
    
  •  case "cmd_print":
    
  •    var enabled = (GetNumSelectedCards() > 0);
    

I'm not sure why you're not using cmd_printcard?
Anyway, why not querySelectorAll like above to make it clear what's
happening and also protecting against the case where the button is not
there. Not sure that would happen in practice
I am using cmd_print as that means that it works for both cards and addressbooks depending on which pane has focus. Happy to use querySelectorAll to keep it consistent with other parts of the code.

::: suite/locales/en-US/chrome/mailnews/addressbook/abMainWindow.dtd
@@ +80,5 @@

<!ENTITY deleteItemButton.accesskey "D">
<!ENTITY newimButton.label "Instant Message">
<!ENTITY newimButton.accesskey "I">
+<!ENTITY printButton.label "Print">
+<!ENTITY printButton.accesskey "r">

at least in tb, r is taken for Redo
As far as I am aware printButton.label is only used in the results pane tree context menu whereas redo is in the edit menu, so no clash currently.

Attachment #9151343 - Attachment is obsolete: true
Attachment #9151451 - Flags: review?(mkmelin+mozilla)

[Triage Comment]
Carrying forward r/a for SM repos

Attachment #9151330 - Attachment is obsolete: true
Attachment #9151452 - Flags: review+
Attachment #9151452 - Flags: approval-comm-release+
Attachment #9151452 - Flags: approval-comm-esr60+
Comment on attachment 9151451 [details] [diff] [review]
Addressbook print patch v1.2 for cc

Review of attachment 9151451 [details] [diff] [review]:
-----------------------------------------------------------------

::: mailnews/addrbook/content/abResultsPane.js
@@ +439,5 @@
>              e.setAttribute("label", e.getAttribute(labelAttr));
>            }
>          });
>          return enabled;
>        }

Maybe add a comment
// "cmd_printpreview" and "cmd_print" are only used in SeaMonkey.
Attachment #9151451 - Flags: review?(mkmelin+mozilla) → review+

Added comments.
Carrying forward r+ from frg and mkmelin

Attachment #9151451 - Attachment is obsolete: true
Attachment #9151454 - Flags: review+

Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/a172c7754d7d
Add print context menu items and print button to address book toolbar. r=frg r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED

taskcluster seems to dislike the suite/mailnews patch and didn't even start a TB job:
https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=a172c7754d7d9721ab93c80fd4d0def59f395563

Target Milestone: --- → seamonkey 2.75

Bug 1640382 - not specific to that.

Whiteboard: SM2.53.3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: