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:
parent
237db5ed58
commit
f5e55d21bf
|
@ -264,6 +264,14 @@ var ScholarPane = new function()
|
||||||
{
|
{
|
||||||
if(itemsView && itemsView.selection.count > 0)
|
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 eraseChildren = {value: true};
|
||||||
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
|
||||||
.getService(Components.interfaces.nsIPromptService);
|
.getService(Components.interfaces.nsIPromptService);
|
||||||
|
@ -284,8 +292,8 @@ var ScholarPane = new function()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (promptService.confirmCheck(
|
if (noPrompt || promptService.confirmCheck(
|
||||||
window,
|
window,
|
||||||
Scholar.getString('pane.items.delete.title'),
|
Scholar.getString('pane.items.delete.title'),
|
||||||
Scholar.getString('pane.items.delete' + (itemsView.selection.count>1 ? '.multiple' : '')),
|
Scholar.getString('pane.items.delete' + (itemsView.selection.count>1 ? '.multiple' : '')),
|
||||||
|
|
|
@ -562,7 +562,7 @@ Scholar.ItemTreeView.prototype.deleteSelection = function(eraseChildren)
|
||||||
this._treebox.beginUpdateBatch();
|
this._treebox.beginUpdateBatch();
|
||||||
for (var i=0; i<items.length; i++)
|
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);
|
items[i].ref.erase(eraseChildren);
|
||||||
else if(this._itemGroup.isCollection())
|
else if(this._itemGroup.isCollection())
|
||||||
this._itemGroup.ref.removeItem(items[i].ref.getID());
|
this._itemGroup.ref.removeItem(items[i].ref.getID());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user