diff --git a/web/index.html b/web/index.html
index 09d3d609d..647ac7236 100755
--- a/web/index.html
+++ b/web/index.html
@@ -30,6 +30,7 @@
+
-
@@ -347,6 +348,7 @@
- Pause Selected
- Resume Selected
- Remove From List...
+ - Delete Data And Remove From List...
- Show Inspector
- Select All
diff --git a/web/javascript/menu.js b/web/javascript/menu.js
index c6ddc0fd5..4a78682b6 100644
--- a/web/javascript/menu.js
+++ b/web/javascript/menu.js
@@ -11,7 +11,7 @@ Menu = {
context: {
menu_style: {
- width: '210px',
+ width: '310px',
backgroundColor: '#fff',
border: 'none',
padding: '5px 0',
diff --git a/web/javascript/transmission.js b/web/javascript/transmission.js
index d7cb9bd86..57ffc7b88 100644
--- a/web/javascript/transmission.js
+++ b/web/javascript/transmission.js
@@ -46,6 +46,7 @@ Transmission.prototype =
$('#pause_selected_link').bind('click', this.stopSelectedClicked );
$('#resume_selected_link').bind('click', this.startSelectedClicked);
$('#remove_link').bind('click', this.removeClicked);
+ $('#removedata_link').bind('click', this.removeDataClicked);
$('#filter_all_link').parent().bind('click', this.showAllClicked);
$('#filter_downloading_link').parent().bind('click', this.showDownloadingClicked);
$('#filter_seeding_link').parent().bind('click', this.showSeedingClicked);
@@ -197,6 +198,9 @@ Transmission.prototype =
contextRemoveSelected: function( ) {
transmission.removeSelectedTorrents( );
},
+ contextRemoveDataSelected: function( ) {
+ transmission.removeSelectedTorrentsAndData( );
+ },
contextToggleInspector: function( ) {
transmission.toggleInspector( );
},
@@ -216,6 +220,7 @@ Transmission.prototype =
context_pause_selected: this.contextStopSelected,
context_resume_selected: this.contextStartSelected,
context_remove: this.contextRemoveSelected,
+ context_removedata: this.contextRemoveDataSelected,
context_toggle_inspector: this.contextToggleInspector,
context_select_all: this.contextSelectAll,
context_deselect_all: this.contextDeselectAll
@@ -547,6 +552,14 @@ Transmission.prototype =
}
},
+ removeDataClicked: function( event ) {
+ var tr = transmission;
+ if( tr.isButtonEnabled( event ) ) {
+ tr.removeSelectedTorrentsAndData( );
+ tr.hideiPhoneAddressbar( );
+ }
+ },
+
toggleInspectorClicked: function( event ) {
var tr = transmission;
if( tr.isButtonEnabled( event ) )
@@ -1187,6 +1200,12 @@ Transmission.prototype =
this.promptToRemoveTorrents( torrents );
},
+ removeSelectedTorrentsAndData: function() {
+ var torrents = this.getSelectedTorrents( );
+ if( torrents.length )
+ this.promptToRemoveTorrentsAndData( torrents );
+ },
+
promptToRemoveTorrents:function( torrents )
{
if( torrents.length == 1 )
@@ -1204,10 +1223,31 @@ Transmission.prototype =
}
},
+ promptToRemoveTorrentsAndData:function( torrents )
+ {
+ if( torrents.length == 1 )
+ {
+ var torrent = torrents[0],
+ header = 'Remove ' + torrent.name() + ' and delete data?',
+ message = 'All data downloaded for this torrent will be deleted. Are you sure you want to remove it?';
+ dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents );
+ }
+ else
+ {
+ var header = 'Remove ' + torrents.length + ' transfers and delete data?',
+ message = 'All data downloaded for these torrents will be deleted. Are you sure you want to remove them?';
+ dialog.confirm( header, message, 'Remove', 'transmission.removeTorrentsAndData', torrents );
+ }
+ },
+
removeTorrents: function( torrents ) {
this.remote.removeTorrents( torrents );
},
+ removeTorrentsAndData: function( torrents ) {
+ this.remote.removeTorrentsAndData( torrents );
+ },
+
startSelectedTorrents: function( ) {
this.startTorrents( this.getSelectedTorrents( ) );
},
@@ -1336,6 +1376,7 @@ Transmission.prototype =
this.setEnabled( 'li#resume_selected', havePausedSelection );
this.setEnabled( 'li.context_resume_selected', havePausedSelection );
this.setEnabled( 'li#remove', haveSelection );
+ this.setEnabled( 'li#removedata', haveSelection );
this.setEnabled( 'li#pause_all', haveActive );
this.setEnabled( 'li#resume_all', havePaused );
}
diff --git a/web/javascript/transmission.remote.js b/web/javascript/transmission.remote.js
index 37bd34804..b8f3283d7 100644
--- a/web/javascript/transmission.remote.js
+++ b/web/javascript/transmission.remote.js
@@ -121,6 +121,20 @@ TransmissionRemote.prototype =
removeTorrents: function( torrents ) {
this.sendTorrentCommand( 'torrent-remove', torrents );
},
+ removeTorrentsAndData: function( torrents ) {
+ var remote = this,
+ o = { };
+ o.method = 'torrent-remove';
+ o.arguments = { };
+ o.arguments['delete-local-data'] = true;
+ o.arguments.ids = [ ];
+ if( torrents != null )
+ for( var i=0, len=torrents.length; i