Closed Bug 17230 Opened 25 years ago Closed 21 years ago

Missing address book property menu item - can't rename AB name

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect, P2)

defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.4alpha

People

(Reporter: pmock, Assigned: cavin)

References

Details

(Keywords: polish, Whiteboard: [adt2], nab-ab, custrtm-, [ue1])

Attachments

(2 files, 4 obsolete files)

Build Date & Platform Bug Found:
 Win32 commercial seamonkey build 1999-10-25-16-m11 installed on P166 Win98
 Linux commercial seamonkey build 1999-10-25-16-m11 installed on P200 RedHat 6.1
 MacOS mozilla seamonkey build 1999-10-25-16-m11 installed on G3/400 OS 8.5.1

Overview Description:
 There is no way (that I can find) to be able to edit the Address Book name.  I
highlight the address book name and tried clicking on the toolbar edit button.
Nothing happen.  I select the edit menu looking for the property menu item.
It's not there.

Steps to Reproduce:
1) Start Messenger
2) From the task menu select 'address book'
   The address book opens
3) Select the File menu and choose New->Address Book
   The new address book dialog will appear
4) Enter a name and press OK
5) Highlight the newly created address book
6) Click on the Edit button
    Nothing happens
7) Select the Edit menu...
   Note, there is no property menu

Actual Results:

There's no menu item to edit the address book property

Expected Results:

There should be a way to change the address book name.

Additional Builds and Platforms Tested On:


Additional Information:
 I can not tell if the feature has been implemented to edit the Address Book.
Blocks: 10839
Status: NEW → ASSIGNED
Target Milestone: M13
This bug found trying to verify bug 10839 [FEATURE] New/Edit Address Book dialog
Target Milestone: M13 → M16
OS: Windows 98 → All
QA Contact: lchiang → esther
Not beta2 stopper.  Marking M18.  Please let me know if you disagree.
Target Milestone: M16 → M18
Mass move mailnews bugs to Putterman.  Ouch.
Assignee: hangas → putterman
Status: ASSIGNED → NEW
Luis - can you try to reproduce this on all platforms?
build 2000-07-18-11-m17
win98, mac8.6 and linux5.2
when push edit button nothappends.
there's currently no way to rename an address book in the ui.  Moving to future 
milestone.
Target Milestone: M18 → Future
QA Contact: esther → pmock
*** Bug 61578 has been marked as a duplicate of this bug. ***
Assign to myself.
QA Contact: pmock → fenella
QA Contact: fenella → nbaca
reassigning to racham
Assignee: putterman → racham
Component: Mail Window Front End → Address Book
*** Bug 32021 has been marked as a duplicate of this bug. ***
*** Bug 60370 has been marked as a duplicate of this bug. ***
*** Bug 108434 has been marked as a duplicate of this bug. ***
Marking nsbeta1 because you should be able to change the name of your address
book. Also, when importing address books they are automatically given a name
(i.e. "Outlook Addresses") and this often is not meaninful to the user.
Keywords: nsbeta1
Whiteboard: nab-ab
Summary: Missing address book property menu item - can't change AB name → Missing address book property menu item - can't rename AB name
Status: NEW → ASSIGNED
Keywords: nsbeta1nsbeta1+
Priority: P3 → P2
Target Milestone: Future → ---
*** Bug 116127 has been marked as a duplicate of this bug. ***
Target Milestone: --- → mozilla1.0
Discussed at 2/19/02 bug meeting w/ Eng/PjctMg/Marketing: decided to move to
1.2, and change nsbeta+ to nsbeta-
Depends on: 122274
Keywords: nsbeta1+nsbeta1-
Target Milestone: mozilla1.0 → mozilla1.2
Please reconsider minusing this bug. This bug has 5 dups so far. The Address 
Book has really improved for MachV. Users can add/edit/delete, including rename, 
LDAP directories now. They should be able to rename local ABs as well, a basic 
feature. Currently the "Properties" button and menu items are enabled when a 
local AB has focus, but nothing happens when user selects the button/menu item. 
This is bad. Also as nbaca wrote in comment #13, we can now import ABs from 
other apps; not letting users rename those imported ABs is bad.
Keywords: nsbeta1-nsbeta1
reassigning to srilatha.  Seth mentioned that you are working near that code for
the ldap properties dialog.
Assignee: racham → srilatha
Status: ASSIGNED → NEW
No longer depends on: 122274
Keywords: nsbeta1nsbeta1+
Target Milestone: mozilla1.2 → mozilla1.0
Blocks: 128661
nsbeta1-, because it isn't a high priority
Keywords: nsbeta1+nsbeta1-
marked as per ADT
Target Milestone: mozilla1.0 → mozilla1.2
Removing minus so this bug might be considered for rtm.
Keywords: nsbeta1-nsbeta1
reassigning. UI team wants this bug fixed for rtm. 
Assignee: srilatha → shliang
Keywords: nsbeta1nsbeta1+, polish
Whiteboard: nab-ab → nab-ab, [adt2 rtm]reassigning. UI team wants this bug fixed for rtm.
This only one bug in a set of related bugs.

In order to complete UI for the address book we also need

1. Enable/disable Edit|Copy, Edit|Paste and Edit|Cut depending on card selection.
2. In the menu and toolbar buttons tips indicate that the selected operation
   will be applied to the card or book.
3. There also should be a context menu for both panes: "Address Books"
   and card list.
*** Bug 144974 has been marked as a duplicate of this bug. ***
Whiteboard: nab-ab, [adt2 rtm]reassigning. UI team wants this bug fixed for rtm. → nab-ab, [adt2 rtm]
some comments:

At this time, certain addressbooks can't be renamed (or for that matter, 
deleted):  Personal Addressbook, Collected Addressbook.

shuehan, if you get to this after 
http://bugzilla.mozilla.org/show_bug.cgi?id=124007 (fix dir pane sorting), we 
might need make sure we do the right thing so that on rename causes the 
addressbook to update and change position immediately (instead of upon restart).


Also, don't forget about LDAP addressbooks.

Are we going to allow the user to rename mailing lists in the same way?  or 
should that be spun off to another bug?
>Are we going to allow the user to rename mailing lists in the same way?  or 
>should that be spun off to another bug?

Mailing Lists can already be renamed. Selected the mailing list and double click 
or select Properties. Mailing List dialog opens and lets you rename it.
Whiteboard: nab-ab, [adt2 rtm] → nab-ab, [adt2 rtm], custrtm-
Attached patch patch (obsolete) — Splinter Review
Comment on attachment 85304 [details] [diff] [review]
patch

1)

+	// the id of the directory used in prefs
+	attribute wstring dirId;

This should be:

attribute ACString dirId;

one, it will allow us to avoid allocations.  two, the pref ID is a const char
*, not a PRUnichar *,
and that will allow us to avoid conversions.

2)

-	   var directory = GetDirectoryFromURI(selectedDir);
-	   if ((directory.isMailList) || 
-	       (!(directory.operations & directory.opWrite)))
+	 if (selectedDir && 
+	    (selectedDir != kPersonalAddressbookURI) &&
+	    (selectedDir != kCollectedAddressbookURI)) {

There must be a problem with our addressbook xul or js.  Because looking at the
existing code,
button_edit (Properties Button) should be disabled when the dir tree has focus
and we've selected a mailing list, or an ldap addressbook.  but right now, that
button is always enabled.

I think we actually want the properties button (button_edit) to always be
enabled.  If we click it for the pab or the cab, it should just come up with
the name field disabled.  

we should really have:

case "button_edit":
  return true;

3)

+    else {
+      window.okCallback = sortDirectories;
+     
window.openDialog("chrome://messenger/content/addressbook/abEditAddressbook.xul
",
+			 "", 
+			 "chrome,modal=yes,resizable=no,centerscreen", 
+			 {abURI:mailingListUri, okCallback:okCallback});

I had to read the code to figure out that mailingListUri really isn't a mailing
list uri, it's the uri for the selected addressbook.

AbEditSelectedDirectory() needs some cleanup.  now that we're adding a
properties dialog for local addressbooks, the existing variable name is poorly
chosen.

var mailingListUri = GetSelectedDirectory();

that should be something like:

var selectedURI = GetSelectedDirectory();

can you clean up AbEditSelectedDirectory() since you are in it?

4)

+function sortDirectories()
+{
+  var xulSortService =
Components.classes["@mozilla.org/xul/xul-sort-service;1"].getService(Components
.interfaces.nsIXULSortService);
+  xulSortService.Sort(dirTree,
"http://home.netscape.com/NC-rdf#AddressbookSort", "ascending");
+}
+

How come we have to sort the tree manually, when the name of the mailing list
or addressbook changes?
Shouldn't our dir datasource be notifying listeners of a change?

5)

+	 style="width:28em;"> 

we should not have inline style.  this value probably looks great for en-US,
not other languages.
I think the prefered way of doing this is:

on the dialog tag, do this:

width="&dialog.width;"

and then in abEditAddressbook.dtd, define that entity as 28em

6)

since we are now allowing this properties dialog to come up for the pab and
cab, see my comment #2,
you'll have to add code that disables the textbox if the uri is one of those
two well know uris
kPersonalAddressbookURI and kCollectedAddressbookURI.

we may end up adding more to the properties dialog, so it should work for those
abs.

7)

once you make the idl change I suggested in #1, you'll have to fix these two.

+NS_IMETHODIMP nsAbDirProperty::GetDirId(PRUnichar **_retval)
+{
+  *_retval = ToNewUnicode(m_DirId);
+  return NS_OK;
+}
+
+NS_IMETHODIMP nsAbDirProperty::SetDirId(const PRUnichar *aDirId)
+{
+  m_DirId.Assign(aDirId);
+  return NS_OK;
+}

for example,

NS_IMETHODIMP nsAbDirProperty::GetDirId(nsACString & aDirId)
{
  aDirId = m_DirId;
  return NS_OK;
}


8)

+  nsString m_DirId;

this will now be nsCString m_DirId;

9)

+    rv = directory->SetDirId(ToNewUnicode(prefName));
     NS_ENSURE_SUCCESS(rv, rv);

yikes, this leaks.  ToNewUnicode() and ToNewCString() allocate.

after my other suggested fixes, I think this should become

+    rv = directory->SetDirId(prefName);
     NS_ENSURE_SUCCESS(rv, rv);

10)

+  SetDirName(aDirName);

you should check the rv of this method.

11)

+  PRUnichar *prefName;
+  GetDirId(&prefName);

you should check the rv of this.  note, this code leaks, since in your patch
GetDirId() allocates.
That will change once you make the other fixes I suggested, but you should
watch out for this.

12)

+    rv = prefs->GetBranch(nsnull, getter_AddRefs(prefBranch));

I'd add NS_ENSURE_SUCCESS(rv,rv); after this call.

13)

+  rv = prefBranch->SetCharPref(ToNewCString(nsDependentString(prefName) +
NS_LITERAL_STRING(".description")),
+				ToNewCString(nsDependentString(aDirName)));

I'd add NS_ENSURE_SUCCESS(rv,rv); after this call.

And, both of those calls to ToNewCString leak.
And, the second call to ToNewCString() will cause
you to lose any non-US-ASCII data.  (the dir name is a wstring, remember)

You should find out how we store the UCS2 (PRUnichar *) directory name is
prefs.
I think you need to use setComplextValue() [instead of SetCharPref].
Attachment #85304 - Flags: needs-work+
for #13, look at pref-directory.js, to see how srilatha (or dmose?) did it in 
js.
Attached patch patch (obsolete) — Splinter Review
Attachment #85304 - Attachment is obsolete: true
Attached file my preliminary review notes (obsolete) —
here are some preliminary review notes.  

I call them preliminary because as I'm not sure what we want to do about the
issues and this bug in general.  All I do know is we want to allow users to
rename local addressbooks.

But I haven't fully thought out what the right fix should be.  Ugh, I hate the
addressbook.

We know we need to give the user a way to rename local addressbooks, we just
need to figure out the right way.
Comment on attachment 86540 [details] [diff] [review]
patch

needs work.  I'll be out until 6-24.  either we'll resume this then, or another
reviewer can take over.

given how nasty the addressbook code is, I fear this will be waiting for me on
6-24
Attachment #86540 - Flags: needs-work+
Whiteboard: nab-ab, [adt2 rtm], custrtm- → nab-ab, [adt2 rtm], custrtm-, [ue1]
Blocks: 156960
fyi, bug 76382 can be dumped once this is fixed.
Whiteboard: nab-ab, [adt2 rtm], custrtm-, [ue1] → nab-ab, [adt2], custrtm-, [ue1]
*** Bug 174376 has been marked as a duplicate of this bug. ***
Blocks: Import
over to cavin.
Assignee: shliang → cavin
Whiteboard: nab-ab, [adt2], custrtm-, [ue1] → [adt2], nab-ab, custrtm-, [ue1]
The backend fix is in bug #124059. The modifyAddressBook() method works for 
normal address books as well.
the reason for that second patch (not really a patch) is that for something 
cavin is doing (see bug #124059), he needs some of shuehan's changes.

but we don't want all of shuehan's last patch yet.

the fix for rename (once cavin lands #124059) will be to use the 
modifyAddressbook().

once #124059 lands, we can finish up this bug.
Target Milestone: mozilla1.2alpha → mozilla1.4alpha
cavin should be able to fix this now that 124069 has landed.

he's got a partial patch in his tree now.
Status: NEW → ASSIGNED
UI patch of the bug. The backend patch/fix is in bug 124069.
Comment on attachment 116369 [details] [diff] [review]
Proposed patch, v1

r/sr=sspitzer
Attachment #116369 - Flags: superreview+
Attachment #116369 - Flags: review+
cavin, when you land your fix, can you log the spin off issue about the 
enabling/disabling of rename/delete/properties menu items/buttons?
> cavin, when you land your fix, can you log the spin off issue about the 
> enabling/disabling of rename/delete/properties menu items/buttons?
>
It is bug 196123.
UI fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attached patch supplimental fixSplinter Review
cavin, see the attached supplimental fix.

I was running into the "can't rename" alert too frequently for the PAB and CAB
(on double click of addressbooks, on Edit | Properties, on the Properties
toolbar button.

Instead of "Rename Address Book", I made the title "Address Book Properties"
(For LDAP, the dialog is "Directory Server Properties")

if the dialog is opened for PAB and CAB, the text field is disabled.

I think this is a better experience. 

can you review, and if you agree, land the patch for me?

some open issues:

1)  Do we really need a "Rename Address Book..." menu item, if there are
already several ways to get to this dialog?  (maybe, we have "File | Rename
Folder" in mail).  (spin off bug)

2)  double clicking on a PAB with mailing lists opens the properties (rename)
dialog, and expands (or collapses) the twisty.	I was hoping that
event.preventBubble() would fix this, but it doesn't seem to do the trick. 
(spin off bug)
3)  if we keep "Rename Address Book...", should be disable for PAB and CAB. 
(like "File | Rename Folder" is for special folders, like Inbox.  (spin off bug)
Comment on attachment 116394 [details] [diff] [review]
supplimental fix

r=cavin.
Attachment #116394 - Flags: review+
cavin has (or is) going to log some spin off bugs.
> 2)  double clicking on a PAB with mailing lists opens the properties (rename)
> dialog, and expands (or collapses) the twisty.	I was hoping that
> event.preventBubble() would fix this, but it doesn't seem to do the trick. 
> (spin off bug)
>
It's bug 196135.
Trunk build 2003-03-06: Mac 10.1.5, WinXP
Verified Fixed, since the basics are working. 

There is a problem renaming imported address books (bug# 19622).
Status: RESOLVED → VERIFIED
>I was running into the "can't rename" alert too frequently for the PAB and CAB
>(on double click of addressbooks, on Edit | Properties, on the Properties
>toolbar button. Instead of "Rename Address Book", I made the title "Address
>Book Properties" (For LDAP, the dialog is "Directory Server Properties"). If
>the dialog is opened for PAB and CAB, the text field is disabled.
>I think this is a better experience. 

I agree. Is this what is currently checked in?

>Do we really need a "Rename Address Book..." menu item, if there are
>already several ways to get to this dialog? 

I Agree. Please remove File: Rename Address Book.

Since the CAB isn't a special AB anymore (we don't even create it for new
profiles) why can't the user rename it?
>Since the CAB isn't a special AB anymore (we don't even create it for new
>profiles) why can't the user rename or delete it?
I filed bug 196926 for this.
*** Bug 138983 has been marked as a duplicate of this bug. ***
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: