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/static/mooui.js" type="text/javascript"></script>
<script src="$base/gettext.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.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-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-add.js" type="text/javascript"></script>
<script src="$base/template/static/js/deluge-bars.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> <legend>$_('Bandwidth')</legend>
<label>$_('Max Down Speed'):</label> <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> <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> <label>$_('Max Connections'):</label>
<input type="text" class="moouiSpinner" /><br/> <input type="text" name="max_connections" class="moouiSpinner" /><br/>
<label>$_('Max Upload Slots'):</label> <label>$_('Max Upload Slots'):</label>
<input type="text" class="moouiSpinner" /> <input type="text" name="max_upload_slots" class="moouiSpinner" />
</fieldset> </fieldset>
<fieldset> <fieldset>
<legend>$_('General')</legend> <legend>$_('General')</legend>
<label class="fluid"> <label class="fluid">
<input type="checkbox" /> <input type="checkbox" name="add_paused" />
$_('Add in Paused State') $_('Add in Paused State')
</label><br/> </label><br/>
<label class="fluid"> <label class="fluid">

View File

@ -23,11 +23,13 @@ Deluge.Widgets.AddWindow = new Class({
this.bound = { this.bound = {
onLoad: this.onLoad.bindWithEvent(this), onLoad: this.onLoad.bindWithEvent(this),
onAdd: this.onAdd.bindWithEvent(this), onAdd: this.onAdd.bindWithEvent(this),
onShow: this.onShow.bindWithEvent(this),
onCancel: this.onCancel.bindWithEvent(this), onCancel: this.onCancel.bindWithEvent(this),
onTorrentAdded: this.onTorrentAdded.bindWithEvent(this), onTorrentAdded: this.onTorrentAdded.bindWithEvent(this),
onTorrentChanged: this.onTorrentChanged.bindWithEvent(this) onTorrentChanged: this.onTorrentChanged.bindWithEvent(this)
} }
this.addEvent('loaded', this.bound.onLoad); this.addEvent('loaded', this.bound.onLoad);
this.addEvent('show', this.bound.onShow);
}, },
onLoad: function(e) { onLoad: function(e) {
@ -37,10 +39,9 @@ Deluge.Widgets.AddWindow = new Class({
this.torrentInfo = new Hash(); this.torrentInfo = new Hash();
this.tabs = new Widgets.Tabs(this.content.getElement('div.moouiTabs')); this.tabs = new Widgets.Tabs(this.content.getElement('div.moouiTabs'));
this.filesTab = new Deluge.Widgets.AddTorrent.FilesTab(); this.filesTab = new Deluge.Widgets.AddTorrent.FilesTab();
this.optionsTab = new Deluge.Widgets.AddTorrent.OptionsTab();
this.tabs.addPage(this.filesTab); this.tabs.addPage(this.filesTab);
this.tabs.addPage(new Widgets.TabPage('Options', { this.tabs.addPage(this.optionsTab);
url: '/template/render/html/add_torrent_options.html'
}));
this.fileWindow = new Deluge.Widgets.AddTorrent.File(); this.fileWindow = new Deluge.Widgets.AddTorrent.File();
this.fileWindow.addEvent('torrentAdded', this.bound.onTorrentAdded); this.fileWindow.addEvent('torrentAdded', this.bound.onTorrentAdded);
@ -86,6 +87,10 @@ Deluge.Widgets.AddWindow = new Class({
this.onCancel() this.onCancel()
}, },
onShow: function(e) {
this.optionsTab.getDefaults();
},
onCancel: function(e) { onCancel: function(e) {
this.hide(); this.hide();
this.torrents.empty(); 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({ Deluge.Widgets.CreateTorrent = new Class({
Extends: Widgets.Window, Extends: Widgets.Window,

View File

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