Project

General

Profile

Feature #329 » HideMainMenuEntry.diff

anbr, 07/17/2010 04:51 PM

View differences:

command/Makefile
CXX ?= g++
CXXFLAGS ?= -g -O2 -Wall -Wextra -Woverloaded-virtual -Wno-parentheses
PKG-CONFIG ?= pkg-config
BINDIR ?= /usr/local/bin
LOCDIR ?= /usr/local/share/locale
LOGODIR ?= /usr/local/share/markad
-include $(VDRDIR)/Make.config
#LOCALEDIR = $(LOCDIR)
### Includes and Defines (add further entries here):
......
DEFINES += -D_GNU_SOURCE
DEFINES += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
DEFINES += -DLOGODIR=\"$(DESTDIR)$(LOGODIR)\"
INCLUDES += $(shell $(PKG-CONFIG) --cflags $(PKG-INCLUDES))
LIBS += $(shell $(PKG-CONFIG) --libs $(PKG-LIBS))
......
### Internationalization (I18N):
PODIR = po
LOCALEDIR = $(DESTDIR)/usr/share/locale
LOCALEDIR = $(LOCDIR)
I18Npo = $(wildcard $(PODIR)/*.po)
I18Nmsgs = $(addprefix $(LOCALEDIR)/, $(addsuffix /LC_MESSAGES/markad.mo, $(notdir $(foreach file, $(I18Npo), $(basename $(file))))))
I18Npot = $(PODIR)/markad.pot
......
$(CXX) $(CXXFLAGS) $(OBJS) $(LIBS) -o $@
install: markad $(I18Nmsgs)
@cp --remove-destination markad $(DESTDIR)/usr/bin/markad
@strip $(DESTDIR)/usr/bin/markad
@mkdir -p $(DESTDIR)/var/lib/markad
@cp logos/* $(DESTDIR)/var/lib/markad
@strip markad
@cp --remove-destination markad $(DESTDIR)$(BINDIR)/markad
@mkdir -p $(DESTDIR)$(LOGODIR)
@cp logos/* $(DESTDIR)$(LOGODIR)
@echo markad installed
clean:
command/global.h
typedef struct MarkAdContext
{
char *LogoDir; // Logo Directory, default /var/lib/markad
char *LogoDir; // Logo Directory, see define LOGODIR
struct Options
{
command/markad-standalone.cpp
#include "markad-standalone.h"
#ifndef LOGODIR
#define LOGODIR "/var/lib/markad"
#endif
bool SYSLOG=false;
cMarkAdStandalone *cmasta=NULL;
int SysLogLevel=2;
......
" (options can be added together, e.g. 5 = ignore\n"
" audio and timer info)\n"
"-l --logocachedir\n"
" directory where logos stored, default /var/lib/markad\n"
" directory where logos stored, default %s\n"
"-p --priority level=<priority>\n"
" priority-level of markad when running in background\n"
" <-20...19> default 19\n"
......
"nice runs markad with nice(19)\n"
"\n<record> is the name of the directory where the recording\n"
" is stored\n\n",
LOGODIR,
LOGO_MAXWIDTH,LOGO_DEFWIDTH,LOGO_DEFHDWIDTH,
LOGO_MAXHEIGHT,LOGO_DEFHEIGHT
);
......
int tstop=0;
int online=0;
strcpy(logoDirectory,"/var/lib/markad");
strcpy(logoDirectory,LOGODIR);
while (1)
{
plugin/markad.cpp
setup.BackupMarks=false;
setup.Verbose=false;
setup.NoMargins=false;
setup.HideMainMenuEntry=false;
}
cPluginMarkAd::~cPluginMarkAd()
......
else if (!strcasecmp(Name,"BackupMarks")) setup.BackupMarks=atoi(Value);
else if (!strcasecmp(Name,"Verbose")) setup.Verbose=atoi(Value);
else if (!strcasecmp(Name,"IgnoreMargins")) setup.NoMargins=atoi(Value);
else if (!strcasecmp(Name,"HideMainMenuEntry")) setup.HideMainMenuEntry=atoi(Value)?true:false;
else return false;
return true;
}
......
return NULL;
}
const char *cPluginMarkAd::MainMenuEntry(void)
{
if(setup.HideMainMenuEntry)
return NULL;
else
return tr("State of mark advertisements");
}
VDRPLUGINCREATOR(cPluginMarkAd) // Don't touch this!
plugin/markad.h
#include "menu.h"
#include "setup.h"
#define DEF_BINDIR "/usr/bin"
#define DEF_LOGODIR "/var/lib/markad"
#define DEF_BINDIR "/usr/local/bin"
#define DEF_LOGODIR "/usr/local/share/markad"
extern const char *VERSION;
static const char *DESCRIPTION = trNOOP("Mark advertisements");
static const char *MAINMENUENTRY = trNOOP("markad status");
class cPluginMarkAd : public cPlugin
{
......
virtual void MainThreadHook(void);
virtual cString Active(void);
virtual time_t WakeupTime(void);
virtual const char *MainMenuEntry(void)
{
return tr(MAINMENUENTRY);
}
virtual const char *MainMenuEntry(void);
virtual cOsdObject *MainMenuAction(void);
virtual cMenuSetupPage *SetupMenu(void);
virtual bool SetupParse(const char *Name, const char *Value);
plugin/po/de_DE.po
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-04-26 13:57+0200\n"
"POT-Creation-Date: 2010-05-06 18:07+0200\n"
"PO-Revision-Date: 2009-08-27 14:18+0200\n"
"Last-Translator: Jochen Dolze <vdr@dolze.de>\n"
"Language-Team: <vdr@linuxtv.org>\n"
......
msgid "markad still running"
msgstr "markad läuft noch"
#, fuzzy
msgid "State of mark advertisements"
msgstr "Status des Werbemarkierung"
msgid "running"
msgstr "aktiv"
......
msgid "verbose logging"
msgstr "ausführliches Logging"
msgid "Hide Mainmenu Entry"
msgstr "Verberge Hauptmenüeintrag"
msgid "Mark advertisements"
msgstr "Markiere Werbung"
plugin/po/it_IT.po
msgstr ""
"Project-Id-Version: vdr\n"
"Report-Msgid-Bugs-To: <see README>\n"
"POT-Creation-Date: 2010-04-26 13:57+0200\n"
"POT-Creation-Date: 2010-05-06 18:07+0200\n"
"PO-Revision-Date: 2009-11-14 18:06+0100\n"
"Last-Translator: Diego Pierotto <vdr-italian@tiscali.it>\n"
"Language-Team: <vdr@linuxtv.org>\n"
......
msgid "markad still running"
msgstr ""
#, fuzzy
msgid "State of mark advertisements"
msgstr "Segna i marcatori della pubblicità"
msgid "running"
msgstr ""
......
msgid "verbose logging"
msgstr ""
msgid "Hide Mainmenu Entry"
msgstr ""
msgid "Mark advertisements"
msgstr "Segna i marcatori della pubblicità"
plugin/setup.cpp
verbose=setup->Verbose;
genindex=setup->GenIndex;
nomargins=setup->NoMargins;
HideMainMenuEntry=setup->HideMainMenuEntry;
processTexts[0]=tr("after");
processTexts[1]=tr("during");
......
Add(new cMenuEditBoolItem(tr("OSD message"),&osdmsg));
Add(new cMenuEditBoolItem(tr("backup marks"),&backupmarks));
Add(new cMenuEditBoolItem(tr("verbose logging"),&verbose));
Add(new cMenuEditBoolItem(tr("Hide Mainmenu Entry"),&HideMainMenuEntry));
Display();
}
......
SetupStore("GenIndex",genindex);
SetupStore("OSDMessage",osdmsg);
SetupStore("Verbose",verbose);
SetupStore("HideMainMenuEntry",HideMainMenuEntry);
setup->ProcessDuring=(bool) processduring;
setup->whileRecording=(bool) whilerecording;
setup->whileReplaying=(bool) whilereplaying;
......
setup->BackupMarks=(bool) backupmarks;
setup->Verbose=(bool) verbose;
setup->NoMargins=(bool) nomargins;
setup->HideMainMenuEntry=(bool) HideMainMenuEntry;
}
plugin/setup.h
bool Verbose;
bool GenIndex;
bool NoMargins;
bool HideMainMenuEntry;
};
class cSetupMarkAd : public cMenuSetupPage
......
int verbose;
int genindex;
int nomargins;
int HideMainMenuEntry;
void write(void);
protected:
virtual void Store(void);
(1-1/2)