From f5e55d21bfc57aad6f0dcd3621a862dbf01bcb01 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 22 Sep 2006 08:26:54 +0000 Subject: [PATCH] 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. --- chrome/chromeFiles/content/scholar/overlay.js | 12 ++++++++++-- .../content/scholar/xpcom/itemTreeView.js | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/chrome/chromeFiles/content/scholar/overlay.js b/chrome/chromeFiles/content/scholar/overlay.js index ef6c6ec74..33e99c40c 100644 --- a/chrome/chromeFiles/content/scholar/overlay.js +++ b/chrome/chromeFiles/content/scholar/overlay.js @@ -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' : '')), diff --git a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js index 254bec658..4309b4172 100644 --- a/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js +++ b/chrome/chromeFiles/content/scholar/xpcom/itemTreeView.js @@ -562,7 +562,7 @@ Scholar.ItemTreeView.prototype.deleteSelection = function(eraseChildren) this._treebox.beginUpdateBatch(); for (var i=0; i