]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Add support for assign icon to tags (and forward this over HTSP)
authorAndreas Öman <andreas@lonelycoder.com>
Sun, 28 Sep 2008 08:20:30 +0000 (08:20 +0000)
committerAndreas Öman <andreas@lonelycoder.com>
Sun, 28 Sep 2008 08:20:30 +0000 (08:20 +0000)
channels.c
channels.h
htsp.c
webui/static/app/cteditor.js

index 05f64d447b043260c89972125a71d136cd015719..7f04fe8ada234db041dff7953ab3a05c0bad9a48 100644 (file)
@@ -643,6 +643,7 @@ channel_tag_find(const char *id, int create)
   ct->ct_identifier = strdup(id);
   ct->ct_name = strdup("New tag");
   ct->ct_comment = strdup("");
+  ct->ct_icon = strdup("");
   TAILQ_INSERT_TAIL(&channel_tags, ct, ct_link);
   return ct;
 }
@@ -683,6 +684,7 @@ channel_tag_destroy(channel_tag_t *ct)
   free(ct->ct_identifier);
   free(ct->ct_name);
   free(ct->ct_comment);
+  free(ct->ct_icon);
   TAILQ_REMOVE(&channel_tags, ct, ct_link);
   free(ct);
 }
@@ -697,9 +699,11 @@ channel_tag_record_build(channel_tag_t *ct)
   htsmsg_t *e = htsmsg_create();
   htsmsg_add_u32(e, "enabled",  !!ct->ct_enabled);
   htsmsg_add_u32(e, "internal",  !!ct->ct_internal);
+  htsmsg_add_u32(e, "titledIcon",  !!ct->ct_titled_icon);
 
   htsmsg_add_str(e, "name", ct->ct_name);
   htsmsg_add_str(e, "comment", ct->ct_comment);
+  htsmsg_add_str(e, "icon", ct->ct_icon);
   htsmsg_add_str(e, "id", ct->ct_identifier);
   return e;
 }
@@ -761,6 +765,10 @@ channel_tag_record_update(void *opaque, const char *id, htsmsg_t *values,
 
   tvh_str_update(&ct->ct_name,    htsmsg_get_str(values, "name"));
   tvh_str_update(&ct->ct_comment, htsmsg_get_str(values, "comment"));
+  tvh_str_update(&ct->ct_icon,    htsmsg_get_str(values, "icon"));
+
+  if(!htsmsg_get_u32(values, "titledIcon", &u32))
+    ct->ct_titled_icon = u32;
 
   was_exposed = ct->ct_enabled && !ct->ct_internal;
 
index 6f37dfb59b95d64037aee271c509287565be64b3..9aa22ebbd25e3838e94feafcd4d1a693b92df834 100644 (file)
@@ -78,8 +78,10 @@ typedef struct channel_tag {
   TAILQ_ENTRY(channel_tag) ct_link;
   int ct_enabled;
   int ct_internal;
+  int ct_titled_icon;
   char *ct_name;
   char *ct_comment;
+  char *ct_icon;
   char *ct_identifier;
   struct channel_tag_mapping_list ct_ctms;
 
diff --git a/htsp.c b/htsp.c
index 386ec44c1902eaa7ae6029d61173161148211059..f37dc533efc278a7409717b24fb74dcfcf9e884f 100644 (file)
--- a/htsp.c
+++ b/htsp.c
@@ -252,6 +252,8 @@ htsp_build_tag(channel_tag_t *ct, const char *method)
   htsmsg_add_str(out, "tagId", ct->ct_identifier);
 
   htsmsg_add_str(out, "tagName", ct->ct_name);
+  htsmsg_add_str(out, "tagIcon", ct->ct_icon);
+  htsmsg_add_u32(out, "tagTitledIcon", ct->ct_titled_icon);
 
   LIST_FOREACH(ctm, &ct->ct_ctms, ctm_tag_link)
     htsmsg_add_u32(members, NULL, ctm->ctm_channel->ch_id);
index 1ff1908b491aa40b64c41eb64dc03705bd6400ff..8f914adc590b57dfeff643cbbd4111701d7b4fb8 100644 (file)
@@ -14,6 +14,15 @@ tvheadend.cteditor = function() {
        width: 100
     });
 
+    var titledIconColumn = new Ext.grid.CheckColumn({
+       header: "Icon has title",
+       dataIndex: 'titledIcon',
+       width: 100,
+       tooltip: 'Set this if the supplied icon has a title embedded. ' +
+           'This will tell displaying application not to superimpose title '+
+           'on top of logo.'
+    });
+
 
     var cm = new Ext.grid.ColumnModel([
        enabledColumn,
@@ -23,6 +32,13 @@ tvheadend.cteditor = function() {
            editor: new fm.TextField({allowBlank: false})
        },
        internalColumn,
+       {
+           header: "Icon (full URL)",
+           dataIndex: 'icon',
+           width: 400,
+           editor: new fm.TextField({})
+       },
+       titledIconColumn,
        {
            header: "Comment",
            dataIndex: 'comment',
@@ -32,10 +48,11 @@ tvheadend.cteditor = function() {
     ]);
     
     var ChannelTagRecord = Ext.data.Record.create([
-       'enabled','name','internal','comment'
+       'enabled','name','internal','icon','comment','titledIcon'
     ]);
     
     return new tvheadend.tableEditor('Channel Tags', 'channeltags', cm,
                                     ChannelTagRecord,
-                                    [enabledColumn, internalColumn]);
+                                    [enabledColumn, internalColumn,
+                                    titledIconColumn]);
 }