add stub for filepicker to trunk

start implementing the options dialog
add another not implemented alert to edit trackers
update changelog
This commit is contained in:
Damien Churchill 2009-01-07 01:28:19 +00:00
parent 08855ef9d7
commit 69e5fe1d3d
4 changed files with 53 additions and 8 deletions

View File

@ -12,6 +12,7 @@
<script src="$base/static/mooui.js" type="text/javascript"></script>
<script src="$base/gettext.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge-filepicker.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge-menus.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge-add.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge-bars.js" type="text/javascript"></script>

View File

@ -14,21 +14,21 @@
<legend>$_('Bandwidth')</legend>
<label>$_('Max Down Speed'):</label>
<input type="text" class="moouiSpinner" /><br/>
<input type="text" name="max_download_speed" class="moouiSpinner" /><br/>
<label>$_('Max Up Speed'):</label>
<input type="text" class="moouiSpinner" /><br/>
<input type="text" name="max_upload_speed" class="moouiSpinner" /><br/>
<label>$_('Max Connections'):</label>
<input type="text" class="moouiSpinner" /><br/>
<input type="text" name="max_connections" class="moouiSpinner" /><br/>
<label>$_('Max Upload Slots'):</label>
<input type="text" class="moouiSpinner" />
<input type="text" name="max_upload_slots" class="moouiSpinner" />
</fieldset>
<fieldset>
<legend>$_('General')</legend>
<label class="fluid">
<input type="checkbox" />
<input type="checkbox" name="add_paused" />
$_('Add in Paused State')
</label><br/>
<label class="fluid">

View File

@ -23,11 +23,13 @@ Deluge.Widgets.AddWindow = new Class({
this.bound = {
onLoad: this.onLoad.bindWithEvent(this),
onAdd: this.onAdd.bindWithEvent(this),
onShow: this.onShow.bindWithEvent(this),
onCancel: this.onCancel.bindWithEvent(this),
onTorrentAdded: this.onTorrentAdded.bindWithEvent(this),
onTorrentChanged: this.onTorrentChanged.bindWithEvent(this)
}
this.addEvent('loaded', this.bound.onLoad);
this.addEvent('show', this.bound.onShow);
},
onLoad: function(e) {
@ -37,10 +39,9 @@ Deluge.Widgets.AddWindow = new Class({
this.torrentInfo = new Hash();
this.tabs = new Widgets.Tabs(this.content.getElement('div.moouiTabs'));
this.filesTab = new Deluge.Widgets.AddTorrent.FilesTab();
this.optionsTab = new Deluge.Widgets.AddTorrent.OptionsTab();
this.tabs.addPage(this.filesTab);
this.tabs.addPage(new Widgets.TabPage('Options', {
url: '/template/render/html/add_torrent_options.html'
}));
this.tabs.addPage(this.optionsTab);
this.fileWindow = new Deluge.Widgets.AddTorrent.File();
this.fileWindow.addEvent('torrentAdded', this.bound.onTorrentAdded);
@ -86,6 +87,10 @@ Deluge.Widgets.AddWindow = new Class({
this.onCancel()
},
onShow: function(e) {
this.optionsTab.getDefaults();
},
onCancel: function(e) {
this.hide();
this.torrents.empty();
@ -268,6 +273,41 @@ Deluge.Widgets.AddTorrent.FilesTab = new Class({
}
});
Deluge.Widgets.AddTorrent.OptionsTab = new Class({
Extends: Widgets.TabPage,
options: {
url: '/template/render/html/add_torrent_options.html'
},
initialize: function() {
this.parent('Options');
this.addEvent('loaded', this.onLoad.bindWithEvent(this));
},
onLoad: function(e) {
this.form = this.element.getElement('form');
},
getDefaults: function() {
var keys = [
'add_paused',
'compact_allocation',
'download_location',
'max_connections_per_torrent',
'max_download_speed_per_torrent',
'max_upload_slots_per_torrent',
'max_upload_speed_per_torrent',
'prioritize_first_last_pieces'
]
Deluge.Client.get_config_values(keys, {
onSuccess: function(config) {
alert(JSON.encode(config));
}
});
}
});
Deluge.Widgets.CreateTorrent = new Class({
Extends: Widgets.Window,

View File

@ -404,6 +404,10 @@ Deluge.UI = {
break;
case 'connections':
alert('Sorry, this hasn\'t been implemented yet.');
break;
case 'edit_trackers':
alert('Sorry, this hasn\'t been implemented yet.');
break;
default:
break;
}