Closes #296, Delete from collection doesn't need warning

Still need #292, "Delete From Library" context menu option in collections

This may or may not help people understand that deleting from a collection doesn't by design delete from the library, but, regardless, this is the same behavior as iTunes.
This commit is contained in:
Dan Stillman 2006-09-22 08:26:54 +00:00
parent 237db5ed58
commit f5e55d21bf
2 changed files with 11 additions and 3 deletions

View File

@ -264,6 +264,14 @@ var ScholarPane = new function()
{
if(itemsView && itemsView.selection.count > 0)
{
if (itemsView._itemGroup.isCollection()){
var noPrompt = true;
}
// Do nothing in search view
else if (itemsView._itemGroup.isSearch()){
return;
}
var eraseChildren = {value: true};
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
.getService(Components.interfaces.nsIPromptService);
@ -284,8 +292,8 @@ var ScholarPane = new function()
}
}
}
if (promptService.confirmCheck(
if (noPrompt || promptService.confirmCheck(
window,
Scholar.getString('pane.items.delete.title'),
Scholar.getString('pane.items.delete' + (itemsView.selection.count>1 ? '.multiple' : '')),

View File

@ -562,7 +562,7 @@ Scholar.ItemTreeView.prototype.deleteSelection = function(eraseChildren)
this._treebox.beginUpdateBatch();
for (var i=0; i<items.length; i++)
{
if(this._itemGroup.isLibrary() || !items[i].isRegularItem()) //erase item from DB
if(this._itemGroup.isLibrary()) //erase item from DB
items[i].ref.erase(eraseChildren);
else if(this._itemGroup.isCollection())
this._itemGroup.ref.removeItem(items[i].ref.getID());