Author: damoxc
Revision: 5034
Log:
begin the preferences window
Diff:
Modified: trunk/deluge/ui/web/css/deluge.css
===================================================================
--- trunk/deluge/ui/web/css/deluge.css 2009-04-07 19:54:40 UTC (rev 5033)
+++ trunk/deluge/ui/web/css/deluge.css 2009-04-07 20:25:49 UTC (rev 5034)
@@ -39,6 +39,7 @@
.x-deluge-error, .deluge-torrents .error { background-image:
url('/icons/alert.png'); }
.x-deluge-checking, .deluge-torrents .checking { background-image:
url('/icons/checking.png'); }
.x-deluge-dht, .x-btn .x-deluge-dht { background-image: url('/icons/dht.png');
}
+.x-deluge-preferences, .x-btn .x-deluge-preferences { background-image:
url('/icons/preferences.png') }
.x-deluge-connections, .x-btn .x-deluge-connections { background-image:
url('/icons/connections.png') }
.x-deluge-traffic, .x-btn .x-deluge-traffic { background-image:
url('/icons/traffic.png') }
.x-deluge-edit-trackers, .x-btn .x-deluge-edit-trackers {background-image:
url('/icons/edit_trackers.png'); }
Modified: trunk/deluge/ui/web/index.html
===================================================================
--- trunk/deluge/ui/web/index.html 2009-04-07 19:54:40 UTC (rev 5033)
+++ trunk/deluge/ui/web/index.html 2009-04-07 20:25:49 UTC (rev 5034)
@@ -32,6 +32,7 @@
<script type="text/javascript" src="/js/deluge-torrents.js"></script>
<script type="text/javascript" src="/js/deluge-details.js"></script>
<script type="text/javascript" src="/js/deluge-add.js"></script>
+ <script type="text/javascript"
src="/js/deluge-preferences.js"></script>
<script type="text/javascript" src="/js/deluge-ui.js"></script>
</head>
<body></body>
Added: trunk/deluge/ui/web/js/deluge-preferences.js
===================================================================
--- trunk/deluge/ui/web/js/deluge-preferences.js
(rev 0)
+++ trunk/deluge/ui/web/js/deluge-preferences.js 2009-04-07 20:25:49 UTC
(rev 5034)
@@ -0,0 +1,108 @@
+/*
+Script: deluge-preferences.js
+ Contains the preferences window.
+
+Copyright:
+ (C) Damien Churchill 2009 <[email protected]>
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, write to:
+ The Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor
+ Boston, MA 02110-1301, USA.
+*/
+
+(function() {
+ PreferencesWindow = Ext.extend(Ext.Window, {
+ layout: 'border',
+ width: 450,
+ height: 450,
+ buttonAlign: 'right',
+ closeAction: 'hide',
+ closable: true,
+ iconCls: 'x-deluge-preferences',
+ plain: true,
+ resizable: false,
+ title: _('Preferences'),
+ buttons: [{
+ text: _('Close')
+ },{
+ text: _('Apply')
+ },{
+ text: _('Ok')
+ }],
+
+ initComponent: function() {
+ PreferencesWindow.superclass.initComponent.call(this);
+
+ this.categoriesGrid = this.add({
+ xtype: 'grid',
+ region: 'west',
+ title: _('Categories'),
+ store: new Ext.data.SimpleStore({
+ fields: [{name: 'name', mapping: 0}]
+ }),
+ columns: [{id: 'name', renderer: fplain,
dataIndex: 'name'}],
+ /*selModel: new Ext.grid.RowSelectionModel({
+ singleSelect: true,
+ listeners: {'rowselect': {fn:
this.onPageSelect, scope: this}}
+ }),*/
+ hideHeaders: true,
+ autoExpandColumn: 'name',
+ margins: '5 0 5 5',
+ cmargins: '5 0 5 5',
+ width: 120,
+ collapsible: true
+ });
+
+ this.configPanel = this.add({
+ region: 'center',
+ title: 'Test',
+ margins: '5 5 5 5',
+ cmargins: '5 5 5 5'
+ });
+
+ this.currentPage = null;
+ },
+
+ addPage: function(name, page) {
+ var store = this.categoriesGrid.getStore();
+ store.loadData([[name]], true);
+
+ if (this.currentPage == null) {
+ this.configPanel.setTitle(name);
+ this.currentPage = 0;
+ }
+ },
+
+ onPageSelect: function(selModel, rowIndex, r) {
+ this.configPanel.setTitle(r.get('name'));
+ },
+
+ onRender: function(ct, position) {
+ PreferencesWindow.superclass.onRender.call(this, ct,
position);
+
//this.categoriesGrid.getSelectionModel().selectFirstRow();
+ }
+ });
+
+ Deluge.Preferences = new PreferencesWindow();
+})();
+Deluge.Preferences.addPage('Downloads', {});
+Deluge.Preferences.addPage('Network', {});
+Deluge.Preferences.addPage('Bandwidth', {});
+Deluge.Preferences.addPage('Interface', {});
+Deluge.Preferences.addPage('Other', {});
+Deluge.Preferences.addPage('Daemon', {});
+Deluge.Preferences.addPage('Queue', {});
+Deluge.Preferences.addPage('Proxy', {});
+Deluge.Preferences.addPage('Notification', {});
+Deluge.Preferences.addPage('Plugins', {});
\ No newline at end of file
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---