File vdr-nordlichtsepg-0.9-test1-enigmaprogressbar.diff of Package vdr-plugin-nordlichtsepg

diff -NauwB nordlichtsepg-0.9/mywhatsonitem.c nordlichtsepg-0.9-enigma/mywhatsonitem.c
--- nordlichtsepg-0.9/mywhatsonitem.c	2008-03-30 19:54:33.000000000 +0200
+++ nordlichtsepg-0.9-enigma/mywhatsonitem.c	2008-05-02 18:45:24.000000000 +0200
@@ -86,6 +86,11 @@
   }
  }
 
+ char* event_channelnumbers = "%c\t%d\t%-10s\t %s\t%s";
+ char* event_nochannelnumbers = "%c\t%-10s\t %s\t%s";
+ char* noevent_channelnumbers = "%c\t%d\t%-10s\t \t(%s)";
+ char* noevent_nochannelnumbers = "%c\t%-10s\t \t(%s)";
+
  if(event)
  {
   // calculate progress bar
@@ -97,6 +102,16 @@
     progress=9;
   
   std::string ProgressBar;
+  if(enigmatheme){
+    ProgressBar = "[        ]";
+    for(i=1;i<progress-1;i++)ProgressBar[i]='|';
+    event_channelnumbers = "%c\t%d\t%-10s \t%s\t %s";
+    event_nochannelnumbers = "%c\t%-10s \t%s\t %s";
+    noevent_channelnumbers = "%c\t%d\t%-10s\t \t (%s)";
+    noevent_nochannelnumbers = "%c\t%-10s\t \t (%s)";
+  }
+  else
+  {
   for(i=0;i < 10;i++)
   {
     if(i == 0 && progress > 0)
@@ -117,18 +132,19 @@
     else
       ProgressBar+=Icons::ProgressEnd();
   }
+  }
     
   if(showchannelnumbers)
-    asprintf(&buffer,"%c\t%d\t%-10s\t %s\t%s",m,channel->Number(),channel->ShortName(true),(!(event->RunningStatus()==4)&&next)?*event->GetTimeString():ProgressBar.c_str(),event->Title());
+    asprintf(&buffer,event_channelnumbers,m,channel->Number(),channel->ShortName(true),(!(event->RunningStatus()==4)&&next)?*event->GetTimeString():ProgressBar.c_str(),event->Title());
   else
-    asprintf(&buffer,"%c\t%-10s\t %s\t%s",m,channel->ShortName(true),(!(event->RunningStatus()==4)&&next)?*event->GetTimeString():ProgressBar.c_str(),event->Title());
+    asprintf(&buffer,event_nochannelnumbers,m,channel->ShortName(true),(!(event->RunningStatus()==4)&&next)?*event->GetTimeString():ProgressBar.c_str(),event->Title());
  }
  else
  {
    if(showchannelnumbers)
-     asprintf(&buffer,"%c\t%d\t%-10s\t \t(%s)",m,channel->Number(),channel->ShortName(true),tr("no info"));
+     asprintf(&buffer,noevent_channelnumbers,m,channel->Number(),channel->ShortName(true),tr("no info"));
    else
-     asprintf(&buffer,"%c\t%-10s\t \t(%s)",m,channel->ShortName(true),tr("no info"));
+     asprintf(&buffer,noevent_nochannelnumbers,m,channel->ShortName(true),tr("no info"));
  }
 
  SetText(buffer,false);
diff -NauwB nordlichtsepg-0.9/mywhatsonitem.h nordlichtsepg-0.9-enigma/mywhatsonitem.h
--- nordlichtsepg-0.9/mywhatsonitem.h	2008-03-30 19:54:33.000000000 +0200
+++ nordlichtsepg-0.9-enigma/mywhatsonitem.h	2008-05-02 17:41:44.000000000 +0200
@@ -4,6 +4,7 @@
 
 extern int showchannelnumbers;
 extern time_t t;
+extern int enigmatheme;
 
 class myWhatsOnItem:public cOsdItem
 {
diff -NauwB nordlichtsepg-0.9/nordlichtsepg.c nordlichtsepg-0.9-enigma/nordlichtsepg.c
--- nordlichtsepg-0.9/nordlichtsepg.c	2008-03-30 19:58:17.000000000 +0200
+++ nordlichtsepg-0.9-enigma/nordlichtsepg.c	2008-05-02 19:07:06.000000000 +0200
@@ -18,6 +18,7 @@
 int keeposd=0;
 int showchannelgroups=0;
 int hideencryptedchannels=0;
+int enigmatheme=0;
 int showchannelnumbers=0;
 int hideradiochannels=0;
 int switchwithok=0;
@@ -37,6 +38,7 @@
    SetupStore("showchannelgroups",showchannelgroups);
    SetupStore("hideencryptedchannels",hideencryptedchannels);
    SetupStore("hideradiochannels",hideradiochannels);
+   SetupStore("enigmatheme",enigmatheme);
    SetupStore("showchannelnumbers",showchannelnumbers);
    SetupStore("switchwithok",switchwithok);
   }
@@ -53,6 +55,7 @@
    Add(new cMenuEditBoolItem(tr("Show channel groups"),&showchannelgroups));
    Add(new cMenuEditBoolItem(tr("Hide encrypted channels"),&hideencryptedchannels));
    Add(new cMenuEditBoolItem(tr("Hide radio channels"),&hideradiochannels));
+   Add(new cMenuEditBoolItem(tr("Is Enigma theme used"),&enigmatheme));
   }
 };
 
@@ -430,6 +433,8 @@
     showchannelgroups=atoi(Value);
   else if(!strcmp("hideencryptedchannels",Name))
     hideencryptedchannels=atoi(Value);
+  else if(!strcmp("enigmatheme",Name))
+    enigmatheme=atoi(Value);
   else if(!strcmp("showchannelnumbers",Name))
     showchannelnumbers=atoi(Value);
   else if(!strcmp("hideradiochannels",Name))
openSUSE Build Service is sponsored by