Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: cosmetic changes for the stream edit tabs
  • Loading branch information
perexg committed Oct 9, 2014
1 parent 3860305 commit 3a6f6af
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 23 deletions.
7 changes: 6 additions & 1 deletion src/api/api_idnode.c
Expand Up @@ -29,6 +29,11 @@ api_idnode_flist_conf( htsmsg_t *args, const char *name )
htsmsg_t *m = NULL;
const char *s = htsmsg_get_str(args, name);
char *r, *saveptr = NULL;
int use = 1;
if (s && s[0] == '-') {
use = 0;
s++;
}
if (s && s[0] != '\0') {
s = r = strdup(s);
r = strtok_r(r, ",;:", &saveptr);
Expand All @@ -38,7 +43,7 @@ api_idnode_flist_conf( htsmsg_t *args, const char *name )
if (*r != '\0') {
if (m == NULL)
m = htsmsg_create_map();
htsmsg_add_bool(m, r, 1);
htsmsg_add_bool(m, r, use);
}
r = strtok_r(NULL, ",;:", &saveptr);
}
Expand Down
37 changes: 31 additions & 6 deletions src/prop.c
Expand Up @@ -344,12 +344,26 @@ prop_read_values
} else {
const property_t *p;
htsmsg_field_t *f;
int b;
int b, total = 0, count = 0;

HTSMSG_FOREACH(f, list) {
if (!htsmsg_field_get_bool(f, &b) && b > 0) {
p = prop_find(pl, f->hmf_name);
if (p)
prop_read_value(obj, p, m, p->id, optmask);
total++;
if (!htsmsg_field_get_bool(f, &b)) {
if (b > 0) {
p = prop_find(pl, f->hmf_name);
if (p)
prop_read_value(obj, p, m, p->id, optmask);
count++;
}
}
}
if (total && !count) {
for (; pl->id; pl++) {
HTSMSG_FOREACH(f, list)
if (!strcmp(pl->id, f->hmf_name))
break;
if (f == NULL)
prop_read_value(obj, pl, m, pl->id, optmask);
}
}
}
Expand Down Expand Up @@ -490,12 +504,23 @@ prop_serialize
} else {
const property_t *p;
htsmsg_field_t *f;
int b;
int b, total = 0, count = 0;
HTSMSG_FOREACH(f, list) {
total++;
if (!htsmsg_field_get_bool(f, &b) && b > 0) {
p = prop_find(pl, f->hmf_name);
if (p)
prop_serialize_value(obj, p, msg, optmask);
count++;
}
}
if (total && !count) {
for (; pl->id; pl++) {
HTSMSG_FOREACH(f, list)
if (!strcmp(pl->id, f->hmf_name))
break;
if (f == NULL)
prop_serialize_value(obj, pl, msg, optmask);
}
}
}
Expand Down
26 changes: 23 additions & 3 deletions src/webui/static/app/esfilter.js
Expand Up @@ -12,14 +12,17 @@ tvheadend.caclient_builders = new Ext.data.JsonStore({

tvheadend.esfilter_tab = function(panel)
{
var list = '-class';

tvheadend.idnode_form_grid(panel, {
url: 'api/profile',
clazz: 'profile',
comet: 'profile',
titleS: 'Stream Profile',
titleP: 'Stream Profiles',
titleC: 'Stream Profile Name',
iconCls: 'stream_profile',
iconCls: 'film',
edit: { params: { list: list } },
add: {
url: 'api/profile',
titleS: 'Stream Profile',
Expand All @@ -28,7 +31,8 @@ tvheadend.esfilter_tab = function(panel)
store: tvheadend.caclient_builders,
displayField: 'caption',
valueField: 'class',
propField: 'props'
propField: 'props',
list: list,
},
create: { },
},
Expand All @@ -38,14 +42,19 @@ tvheadend.esfilter_tab = function(panel)
}
});

var eslist = '-class,index';

tvheadend.idnode_grid(panel, {
url: 'api/esfilter/video',
titleS: 'Video Stream Filter',
titleP: 'Video Stream Filters',
iconCls: 'film_edit',
tabIndex: 1,
edit: { params: { list: eslist } },
add: {
params: { list: eslist },
url: 'api/esfilter/video',
create: {}
create: { }
},
del: true,
move: true,
Expand All @@ -58,8 +67,11 @@ tvheadend.esfilter_tab = function(panel)
url: 'api/esfilter/audio',
titleS: 'Audio Stream Filter',
titleP: 'Audio Stream Filters',
iconCls: 'control_volume',
tabIndex: 2,
edit: { params: { list: eslist } },
add: {
params: { list: eslist },
url: 'api/esfilter/audio',
create: {}
},
Expand All @@ -75,7 +87,9 @@ tvheadend.esfilter_tab = function(panel)
titleS: 'Teletext Stream Filter',
titleP: 'Teletext Stream Filters',
tabIndex: 3,
edit: { params: { list: eslist } },
add: {
params: { list: eslist },
url: 'api/esfilter/teletext',
create: {}
},
Expand All @@ -91,7 +105,9 @@ tvheadend.esfilter_tab = function(panel)
titleS: 'Subtitle Stream Filter',
titleP: 'Subtitle Stream Filters',
tabIndex: 4,
edit: { params: { list: eslist } },
add: {
params: { list: eslist },
url: 'api/esfilter/subtit',
create: {}
},
Expand All @@ -106,8 +122,10 @@ tvheadend.esfilter_tab = function(panel)
url: 'api/esfilter/ca',
titleS: 'CA Stream Filter',
titleP: 'CA Stream Filters',
iconCls: 'film_key',
tabIndex: 5,
add: {
params: { list: eslist },
url: 'api/esfilter/ca',
create: {}
},
Expand All @@ -123,7 +141,9 @@ tvheadend.esfilter_tab = function(panel)
titleS: 'Other Stream Filter',
titleP: 'Other Stream Filters',
tabIndex: 6,
edit: { params: { list: eslist } },
add: {
params: { list: eslist },
url: 'api/esfilter/other',
create: {}
},
Expand Down
10 changes: 9 additions & 1 deletion src/webui/static/app/ext.css
Expand Up @@ -318,10 +318,18 @@
background-image: url(../icons/arrow_switch.png) !important;
}

.stream_config {
.film {
background-image: url(../icons/film.png) !important;
}

.film_edit {
background-image: url(../icons/film_edit.png) !important;
}

.film_key {
background-image: url(../icons/film_key.png) !important;
}

.caclientNone {
background-image: url(../icons/stop.png) !important;
}
Expand Down
32 changes: 21 additions & 11 deletions src/webui/static/app/idnode.js
Expand Up @@ -116,17 +116,27 @@ tvheadend.idnode_enum_store = function(f)

tvheadend.idnode_filter_fields = function(d, list)
{
if (!list)
return d;
var o = list.split(',');
var r = [];
for (var i = 0; i < o.length; i++)
for (var j = 0; j < d.length; j++)
if (d[j].id === o[i]) {
r.push(d[j]);
break;
}
return r;
if (!list)
return d;
var r = [];
if (list.charAt(0) === '-') {
var o = list.substring(1).split(',');
r = d.slice();
for (var i = 0; i < o.length; i++)
for (var j = 0; j < r.length; j++)
if (r[j].id === o[i]) {
r.splice(i, 1);
break;
}
} else {
for (var i = 0; i < o.length; i++)
for (var j = 0; j < d.length; j++)
if (d[j].id === o[i]) {
r.push(d[j]);
break;
}
}
return r;
}

Ext.ux.grid.filter.IntsplitFilter = Ext.extend(Ext.ux.grid.filter.NumericFilter, {
Expand Down
2 changes: 1 addition & 1 deletion src/webui/static/app/tvheadend.js
Expand Up @@ -383,7 +383,7 @@ function accessUpdate(o) {
activeTab: 0,
autoScroll: true,
title: 'Stream',
iconCls: 'stream_config',
iconCls: 'film_edit',
items: []
});
tvheadend.esfilter_tab(stream);
Expand Down
1 change: 1 addition & 0 deletions src/webui/static/icons/film.png
1 change: 1 addition & 0 deletions src/webui/static/icons/film_key.png

0 comments on commit 3a6f6af

Please sign in to comment.