summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Brachold <vdr07@deltab.de>2009-12-26 19:49:04 +0000
committerAndreas Brachold <vdr07@deltab.de>2009-12-26 19:49:04 +0000
commitccc0c57ebdd27d99969e31d755f0beda9fbf509f (patch)
treea39a5731ad93f8f200faa3000824585825e4ac52
parent50ef3da000689beb9146291ebe052a9a1a0bd2e4 (diff)
downloadxxv-ccc0c57ebdd27d99969e31d755f0beda9fbf509f.tar.gz
xxv-ccc0c57ebdd27d99969e31d755f0beda9fbf509f.tar.bz2
* xxvd: update dbversion
* jason: allow deletion of timer from program guide
-rw-r--r--skins/jason/jason.css2
-rw-r--r--skins/jason/locale/lang-de.js1
-rw-r--r--skins/jason/locale/lang-en.js1
-rwxr-xr-xskins/jason/locale/lang-it.js1
-rw-r--r--skins/jason/now.js97
-rw-r--r--skins/jason/program.js46
-rw-r--r--skins/jason/search.js46
-rw-r--r--skins/jason/timers.js6
8 files changed, 184 insertions, 16 deletions
diff --git a/skins/jason/jason.css b/skins/jason/jason.css
index 2925f56..3b11764 100644
--- a/skins/jason/jason.css
+++ b/skins/jason/jason.css
@@ -126,6 +126,7 @@ background-repeat:no-repeat;
.xxv-icon-cut { background-position:-88px -48px;}
.xxv-icon-recover { background-position:-104px -48px;}
.xxv-icon-delete { background-position:-120px -48px;}
+.xxv-timer-icon-delete { background-position:-120px -48px;}
.xxv-icon-playing-music { background-position:0 -64px;}
.xxv-icon-music { background-position:-16px -64px;}
@@ -156,6 +157,7 @@ background-repeat:no-repeat;
.logout-icon { background-image:url(pic/logout.png) !important; }
.audio-icon { background-image:url(pic/audio.png) !important; }
.delete-icon { background-image:url(pic/delete.png) !important; }
+.timer-delete-icon { background-image:url(pic/delete.png) !important; }
.play-icon { background-image:url(pic/remote-playback.png) !important; }
.record-icon { background-image:url(pic/record.png) !important; }
.recover-icon { background-image:url(pic/recover.png) !important; }
diff --git a/skins/jason/locale/lang-de.js b/skins/jason/locale/lang-de.js
index e2f11dd..804b2e4 100644
--- a/skins/jason/locale/lang-de.js
+++ b/skins/jason/locale/lang-de.js
@@ -108,6 +108,7 @@ Ext.xxv.NowGrid.prototype.szFindReRun = "Suche Wiederholung";
Ext.xxv.NowGrid.prototype.szProgram = "Zeige Programm";
Ext.xxv.NowGrid.prototype.szRecord = "Aufnehmen";
Ext.xxv.NowGrid.prototype.szEditTimer = "Timer bearbeiten";
+Ext.xxv.NowGrid.prototype.szDeleteTimer = "Timer löschen";
Ext.xxv.NowGrid.prototype.szColPosition = "Position des Kanal";
Ext.xxv.NowGrid.prototype.szColTitle = "Titel";
Ext.xxv.NowGrid.prototype.szColChannel = "Kanal";
diff --git a/skins/jason/locale/lang-en.js b/skins/jason/locale/lang-en.js
index c5da2bd..e785517 100644
--- a/skins/jason/locale/lang-en.js
+++ b/skins/jason/locale/lang-en.js
@@ -108,6 +108,7 @@ Ext.xxv.NowGrid.prototype.szFindReRun = "Find rerun";
Ext.xxv.NowGrid.prototype.szProgram = "Show program";
Ext.xxv.NowGrid.prototype.szRecord = "Record";
Ext.xxv.NowGrid.prototype.szEditTimer = "Edit timer";
+Ext.xxv.NowGrid.prototype.szDeleteTimer = "Delete timer";
Ext.xxv.NowGrid.prototype.szColPosition = "Channel position";
Ext.xxv.NowGrid.prototype.szColTitle = "Title";
Ext.xxv.NowGrid.prototype.szColChannel = "Channel";
diff --git a/skins/jason/locale/lang-it.js b/skins/jason/locale/lang-it.js
index 9c9212e..29a0665 100755
--- a/skins/jason/locale/lang-it.js
+++ b/skins/jason/locale/lang-it.js
@@ -108,6 +108,7 @@ Ext.xxv.NowGrid.prototype.szFindReRun = "Cerca repliche";
Ext.xxv.NowGrid.prototype.szProgram = "Mostra programma";
Ext.xxv.NowGrid.prototype.szRecord = "Registra";
Ext.xxv.NowGrid.prototype.szEditTimer = "Modifica timer";
+Ext.xxv.NowGrid.prototype.szDeleteTimer = "Elimina timer";
Ext.xxv.NowGrid.prototype.szColPosition = "Posizione canale";
Ext.xxv.NowGrid.prototype.szColTitle = "Titolo";
Ext.xxv.NowGrid.prototype.szColChannel = "Canale";
diff --git a/skins/jason/now.js b/skins/jason/now.js
index 442c760..82d970f 100644
--- a/skins/jason/now.js
+++ b/skins/jason/now.js
@@ -159,6 +159,7 @@ Ext.extend(Ext.xxv.NowGrid, Ext.grid.GridPanel, {
,szProgram : "Show program"
,szRecord : "Record"
,szEditTimer : "Edit timer"
+ ,szDeleteTimer : "Delete timer"
,szColPosition : "Channel position"
,szColTitle : "Title"
,szColChannel : "Channel"
@@ -168,6 +169,8 @@ Ext.extend(Ext.xxv.NowGrid, Ext.grid.GridPanel, {
,szLoadException : "Couldn't get data!\r\n{0}"
,szRecordSuccess : "Successful created timer.\r\n{0}"
,szRecordFailure : "Couldn't create timer!\r\n{0}"
+ ,szDeleteSuccess : "Timer deleted successful.\r\n{0}"
+ ,szDeleteFailure : "Couldn't delete timer!\r\n{0}"
,onLoadException : function( scope, o, arg, e) {
new Ext.xxv.MessageBox().msgFailure(this.szLoadException, e.message);
@@ -256,6 +259,13 @@ Ext.extend(Ext.xxv.NowGrid, Ext.grid.GridPanel, {
,scope:this
,disabled: true
,handler: function() { this.EditTimer(this.ctxRecord, this.store); }
+ },{
+ itemId:'td'
+ ,text: this.szDeleteTimer
+ ,iconCls: 'timer-delete-icon'
+ ,scope:this
+ ,disabled: true
+ ,handler: function() { this.DeleteTimer(this.ctxRecord, this.store); }
},'-',{
itemId:'lst'
,iconCls:'stream-icon'
@@ -295,7 +305,8 @@ Ext.extend(Ext.xxv.NowGrid, Ext.grid.GridPanel, {
return;
}
if(f.itemId == 'tn') { if(timerid) f.hide(); else f.show(); }
- if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'td') { if(timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(f.itemId))
f.enable();
},items);
@@ -379,6 +390,76 @@ Ext.extend(Ext.xxv.NowGrid, Ext.grid.GridPanel, {
}
this.viewer.formwin = new Ext.xxv.Question(item,store);
}
+ /******************************************************************************/
+ ,onDeleteSuccess : function( response,options )
+ {
+ this.viewer.loadMask.hide();
+
+ var o = eval("("+response.responseText+")");
+
+ if(o && o.data && typeof(o.data) == 'string'
+ && o.success) {
+ new Ext.xxv.MessageBox().msgSuccess(this.szDeleteSuccess, o.data);
+
+ var items = options.params.data.split(",");
+ for (var j = 0, jlen = options.store.getCount(); j < jlen; j++) {
+ var record = options.store.getAt(j);
+ for(var i = 0, len = items.length; i < len; i++){
+ if(!record || record.data.timerid != items[i]) {
+ continue;
+ }
+ record.data.timerid = 0;
+ record.commit();
+ }
+ }
+ this.updateTimer();
+ } else {
+ var msg = '';
+ if(o && o.data && typeof(o.data) == 'string') {
+ msg = o.data;
+ }
+ new Ext.xxv.MessageBox().msgFailure(this.szDeleteFailure, msg);
+ }
+ }
+ ,onDeleteFailure : function( response,options )
+ {
+ this.viewer.loadMask.hide();
+ new Ext.xxv.MessageBox().msgFailure(this.szDeleteFailure, response.statusText);
+ }
+ ,DeleteTimer : function(record) {
+ var gsm = this.getSelectionModel();
+ var sel = gsm.getSelections()
+ if(sel.length <= 0) {
+ gsm.selectRecords([record]);
+ sel.push(record);
+ }
+ var items = "";
+ for(var i = 0, len = sel.length; i < len; i++){
+ if(i != 0)
+ items += ',';
+ if(sel[i].data.timerid == 0) {
+ continue;
+ }
+ items += sel[i].data.timerid;
+ }
+ this.DeleteTimerId(items, this.store);
+ }
+ ,DeleteTimerId : function( items,store ) {
+ if(items.length <= 0)
+ return;
+ this.viewer.loadMask.show();
+
+ Ext.Ajax.request({
+ scope: this
+ ,url: XXV.help.cmdAJAX('td')
+ ,timeout: 15000
+ ,success: this.onDeleteSuccess
+ ,failure: this.onDeleteFailure
+ ,store: store
+ ,params:{ data: items }
+ });
+ }
+
,formatTitle: function(value, p, record) {
var style = "";
@@ -430,6 +511,15 @@ Ext.xxv.NowPreview = function(viewer) {
handler: function(){
this.gridNow.EditTimer(this.gridNow.getSelectionModel().getSelected());
}
+ },{
+ id:'td',
+ tooltip: Ext.xxv.NowGrid.prototype.szDeleteTimer,
+ iconCls: 'timer-delete-icon',
+ disabled:true,
+ scope: viewer,
+ handler: function(){
+ this.gridNow.DeleteTimer(this.gridNow.getSelectionModel().getSelected());
+ }
} ]
});
};
@@ -443,8 +533,9 @@ Ext.extend(Ext.xxv.NowPreview, Ext.Panel, {
var items = this.topToolbar.items;
if(items) {
items.eachKey(function(key, f) {
- if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
- if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
+ else if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ else if(f.id == 'td') { if(record.data.timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(key)) f.enable();
},items);
}
diff --git a/skins/jason/program.js b/skins/jason/program.js
index 8f44883..add763a 100644
--- a/skins/jason/program.js
+++ b/skins/jason/program.js
@@ -163,6 +163,13 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, {
,scope:this
,disabled: true
,handler: function() { this.EditTimer(this.ctxRecord); }
+ },{
+ itemId:'td'
+ ,text: this.viewer.gridNow.szDeleteTimer
+ ,iconCls: 'timer-delete-icon'
+ ,scope:this
+ ,disabled: true
+ ,handler: function() { this.DeleteTimer(this.ctxRecord); }
}
]
});
@@ -180,7 +187,8 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, {
var items = this.menu.items;
if(items) { items.eachKey(function(key, f) {
if(f.itemId == 'tn') { if(timerid) f.hide(); else f.show(); }
- if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'td') { if(timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(f.itemId))
f.enable();
},items);
@@ -230,6 +238,24 @@ Ext.extend(Ext.xxv.programGrid, Ext.grid.GridPanel, {
,EditTimer : function(record) {
this.viewer.gridNow.EditTimer(record, this.store);
}
+ ,DeleteTimer : function(record) {
+ var gsm = this.getSelectionModel();
+ var sel = gsm.getSelections()
+ if(sel.length <= 0) {
+ gsm.selectRecords([record]);
+ sel.push(record);
+ }
+ var items = "";
+ for(var i = 0, len = sel.length; i < len; i++){
+ if(i != 0)
+ items += ',';
+ if(sel[i].data.timerid == 0) {
+ continue;
+ }
+ items += sel[i].data.timerid;
+ }
+ this.viewer.gridNow.DeleteTimerId(items, this.store);
+ }
,select : function(sm, index, record){
this.preview.select(record, this.filter.getValue());
}
@@ -252,20 +278,29 @@ Ext.xxv.programPreview = function(viewer) {
handler: function(){ this.searchTab(this.gridProgram.getSelectionModel().getSelected()); }
} ,{
id:'tn',
- tooltip: Ext.xxv.NowGrid.prototype.szRecord,
+ tooltip: this.viewer.gridNow.szRecord,
iconCls: 'record-icon',
disabled:true,
scope: this.viewer,
handler: function(){ this.Record(this.gridProgram.getSelectionModel().getSelected()); }
},{
id:'te',
- tooltip: Ext.xxv.NowGrid.prototype.szEditTimer,
+ tooltip: this.viewer.gridNow.szEditTimer,
iconCls: 'timer-edit-icon',
disabled:true,
scope: viewer,
handler: function(){
this.gridProgram.EditTimer(this.gridProgram.getSelectionModel().getSelected());
}
+ },{
+ id:'td',
+ tooltip: this.viewer.gridNow.szDeleteTimer,
+ iconCls: 'timer-delete-icon',
+ disabled:true,
+ scope: viewer,
+ handler: function(){
+ this.gridProgram.DeleteTimer(this.gridProgram.getSelectionModel().getSelected());
+ }
} ]
});
};
@@ -282,8 +317,9 @@ Ext.extend(Ext.xxv.programPreview, Ext.Panel, {
var items = this.topToolbar.items;
if(items) {
items.eachKey(function(key, f) {
- if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
- if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
+ else if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ else if(f.id == 'td') { if(record.data.timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(key)) f.enable();
},items);
}
diff --git a/skins/jason/search.js b/skins/jason/search.js
index 3a7d154..24ce57a 100644
--- a/skins/jason/search.js
+++ b/skins/jason/search.js
@@ -157,6 +157,13 @@ Ext.extend(Ext.xxv.searchGrid, Ext.grid.GridPanel, {
,scope:this
,disabled: true
,handler: function() { this.EditTimer(this.ctxRecord); }
+ },{
+ itemId:'td'
+ ,text: this.viewer.gridNow.szDeleteTimer
+ ,iconCls: 'timer-delete-icon'
+ ,scope:this
+ ,disabled: true
+ ,handler: function() { this.DeleteTimer(this.ctxRecord); }
}
]
});
@@ -175,7 +182,8 @@ Ext.extend(Ext.xxv.searchGrid, Ext.grid.GridPanel, {
var items = this.menu.items;
if(items) { items.eachKey(function(key, f) {
if(f.itemId == 'tn') { if(timerid) f.hide(); else f.show(); }
- if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'te') { if(timerid) f.show(); else f.hide(); }
+ else if(f.itemId == 'td') { if(timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(f.itemId))
f.enable();
},items);
@@ -218,6 +226,24 @@ Ext.extend(Ext.xxv.searchGrid, Ext.grid.GridPanel, {
,EditTimer : function(record) {
this.viewer.gridNow.EditTimer(record, this.store);
}
+ ,DeleteTimer : function(record) {
+ var gsm = this.getSelectionModel();
+ var sel = gsm.getSelections()
+ if(sel.length <= 0) {
+ gsm.selectRecords([record]);
+ sel.push(record);
+ }
+ var items = "";
+ for(var i = 0, len = sel.length; i < len; i++){
+ if(i != 0)
+ items += ',';
+ if(sel[i].data.timerid == 0) {
+ continue;
+ }
+ items += sel[i].data.timerid;
+ }
+ this.viewer.gridNow.DeleteTimerId(items, this.store);
+ }
,select : function(sm, index, record){
this.preview.select(record,this.store.baseParams.data);
}
@@ -240,20 +266,29 @@ Ext.xxv.searchPreview = function(viewer) {
handler: function(){ this.searchTab(this.gridSearch.getSelectionModel().getSelected()); }
} ,{
id:'tn',
- tooltip: Ext.xxv.NowGrid.prototype.szRecord,
+ tooltip: this.viewer.gridNow.szRecord,
iconCls: 'record-icon',
disabled:true,
scope: viewer,
handler: function(){ this.Record(this.gridSearch.getSelectionModel().getSelected()); }
},{
id:'te',
- tooltip: Ext.xxv.NowGrid.prototype.szEditTimer,
+ tooltip: this.viewer.gridNow.szEditTimer,
iconCls: 'timer-edit-icon',
disabled:true,
scope: viewer,
handler: function(){
this.gridSearch.EditTimer(this.gridSearch.getSelectionModel().getSelected());
}
+ },{
+ id:'td',
+ tooltip: this.viewer.gridNow.szDeleteTimer,
+ iconCls: 'timer-delete-icon',
+ disabled:true,
+ scope: viewer,
+ handler: function(){
+ this.gridSearch.DeleteTimer(this.gridSearch.getSelectionModel().getSelected());
+ }
} ]
});
};
@@ -268,8 +303,9 @@ Ext.extend(Ext.xxv.searchPreview, Ext.Panel, {
var items = this.topToolbar.items;
if(items) {
items.eachKey(function(key, f) {
- if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
- if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ if(f.id == 'tn') { if(record.data.timerid) f.hide(); else f.show(); }
+ else if(f.id == 'te') { if(record.data.timerid) f.show(); else f.hide(); }
+ else if(f.id == 'td') { if(record.data.timerid) f.show(); else f.hide(); }
if(XXV.help.cmdAllowed(key)) f.enable();
},items);
}
diff --git a/skins/jason/timers.js b/skins/jason/timers.js
index 41eed8d..6c98a40 100644
--- a/skins/jason/timers.js
+++ b/skins/jason/timers.js
@@ -258,7 +258,7 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel
},{
itemId:'td'
,text: this.szDelete
- ,iconCls: 'delete-icon'
+ ,iconCls: 'timer-delete-icon'
,scope:this
,disabled: true
,handler: function() { this.DeleteItem(this.ctxRecord); }
@@ -364,8 +364,8 @@ Ext.extend(Ext.xxv.timerGrid, Ext.grid.GridPanel, { // Ext.grid.EditorGridPanel
else
record.data.running = 0;
record.data.collision = x[3];
+ record.commit();
}
- this.view.refresh();
} else {
var msg = '';
if(o && o.data && typeof(o.data) == 'string') {
@@ -538,7 +538,7 @@ Ext.xxv.timerPreview = function(viewer) {
}
,{
id:'td'
- ,iconCls: 'delete-icon'
+ ,iconCls: 'timer-delete-icon'
,tooltip: this.szDelete
,scope: viewer
,disabled:true