-add eligible logo dir

git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@996 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
satbaby
2011-01-03 10:41:58 +00:00
parent ff7d5c50cf
commit 8f02a26307
8 changed files with 34 additions and 12 deletions

View File

@@ -664,6 +664,7 @@ ledcontroler.on.all LED1 & LED2 an
ledcontroler.on.led1 LED1 an ledcontroler.on.led1 LED1 an
ledcontroler.on.led2 LED2 an ledcontroler.on.led2 LED2 an
ledcontroler.blink Blinke im Deep-Standby, wenn Timer aktiv ledcontroler.blink Blinke im Deep-Standby, wenn Timer aktiv
logo_hdd_dir Logo Verz.
mainmenu.audioplayer Audioplayer mainmenu.audioplayer Audioplayer
mainmenu.clearsectionsd Lösche EPG Cache mainmenu.clearsectionsd Lösche EPG Cache
mainmenu.games Spiele mainmenu.games Spiele

View File

@@ -479,6 +479,7 @@ ledcontroler.on.all Led1 & Led2 on
ledcontroler.on.led1 Led1 on ledcontroler.on.led1 Led1 on
ledcontroler.on.led2 Led2 on ledcontroler.on.led2 Led2 on
ledcontroler.blink Blink in deep standby, if timer set ledcontroler.blink Blink in deep standby, if timer set
logo_hdd_dir Logo dir
mainmenu.audioplayer Audioplayer mainmenu.audioplayer Audioplayer
mainmenu.games Games mainmenu.games Games
mainmenu.head Main Menu mainmenu.head Main Menu

View File

@@ -439,7 +439,6 @@ void CPictureViewer::getSize(const char* name, int* width, int *height)
} }
#define LOGO_DIR1 "/share/tuxbox/neutrino/icons/logo" #define LOGO_DIR1 "/share/tuxbox/neutrino/icons/logo"
#define LOGO_DIR2 "/var/share/icons/logo"
#define LOGO_FMT ".jpg" #define LOGO_FMT ".jpg"
bool CPictureViewer::GetLogoName(uint64_t channel_id, std::string ChannelName, std::string & name, int *width, int *height) bool CPictureViewer::GetLogoName(uint64_t channel_id, std::string ChannelName, std::string & name, int *width, int *height)
@@ -457,7 +456,7 @@ bool CPictureViewer::GetLogoName(uint64_t channel_id, std::string ChannelName, s
{ {
for (j = 0; j < 2; j++) for (j = 0; j < 2; j++)
{ {
std::string tmp(LOGO_DIR2 "/" + strLogoName[i] + strLogoExt[j]); std::string tmp(g_settings.logo_hdd_dir + "/" + strLogoName[i] + strLogoExt[j]);
if (access(tmp.c_str(), R_OK) != -1) if (access(tmp.c_str(), R_OK) != -1)
{ {
if(width && height) if(width && height)
@@ -489,10 +488,10 @@ bool CPictureViewer::DisplayLogo (uint64_t channel_id, int posx, int posy, int w
char fname[255]; char fname[255];
bool ret = false; bool ret = false;
sprintf(fname, "%s/%llx.jpg", LOGO_DIR2, channel_id & 0xFFFFFFFFFFFFULL); sprintf(fname, "%s/%llx.jpg", g_settings.logo_hdd_dir.c_str(), channel_id & 0xFFFFFFFFFFFFULL);
printf("logo file: %s\n", fname); printf("logo file: %s\n", fname);
if(access(fname, F_OK)) if(access(fname, F_OK))
sprintf(fname, "%s/%llx.gif", LOGO_DIR2, channel_id & 0xFFFFFFFFFFFFULL); sprintf(fname, "%s/%llx.gif", g_settings.logo_hdd_dir.c_str(), channel_id & 0xFFFFFFFFFFFFULL);
if(!access(fname, F_OK)) { if(!access(fname, F_OK)) {
ret = DisplayImage(fname, posx, posy, width, height); ret = DisplayImage(fname, posx, posy, width, height);

View File

@@ -670,7 +670,7 @@ printf("***************************** rec dir %s timeshift dir %s\n", g_settings
g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" ); g_settings.movieplayer_plugin = configfile.getString( "movieplayer_plugin", "Teletext" );
g_settings.onekey_plugin = configfile.getString( "onekey_plugin", "noplugin" ); g_settings.onekey_plugin = configfile.getString( "onekey_plugin", "noplugin" );
g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/hdd/tuxbox/plugins" ); g_settings.plugin_hdd_dir = configfile.getString( "plugin_hdd_dir", "/hdd/tuxbox/plugins" );
g_settings.logo_hdd_dir = configfile.getString( "logo_hdd_dir", "/var/share/icons/logo" );
//rc-key configuration //rc-key configuration
g_settings.key_tvradio_mode = configfile.getInt32( "key_tvradio_mode", CRCInput::RC_nokey ); g_settings.key_tvradio_mode = configfile.getInt32( "key_tvradio_mode", CRCInput::RC_nokey );
g_settings.key_power_off = configfile.getInt32( "key_power_off", CRCInput::RC_standby ); g_settings.key_power_off = configfile.getInt32( "key_power_off", CRCInput::RC_standby );
@@ -1193,7 +1193,7 @@ void CNeutrinoApp::saveSetup(const char * fname)
configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin ); configfile.setString ( "movieplayer_plugin", g_settings.movieplayer_plugin );
configfile.setString ( "onekey_plugin", g_settings.onekey_plugin ); configfile.setString ( "onekey_plugin", g_settings.onekey_plugin );
configfile.setString ( "plugin_hdd_dir", g_settings.plugin_hdd_dir ); configfile.setString ( "plugin_hdd_dir", g_settings.plugin_hdd_dir );
configfile.setString ( "logo_hdd_dir", g_settings.logo_hdd_dir );
configfile.setInt32 ( "streaming_resolution", g_settings.streaming_resolution ); configfile.setInt32 ( "streaming_resolution", g_settings.streaming_resolution );
configfile.setInt32( "rf_subcarrier", g_settings.rf_subcarrier); configfile.setInt32( "rf_subcarrier", g_settings.rf_subcarrier);
@@ -4050,6 +4050,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
{ {
// printf("ac: %s\n", actionKey.c_str()); // printf("ac: %s\n", actionKey.c_str());
int returnval = menu_return::RETURN_REPAINT; int returnval = menu_return::RETURN_REPAINT;
const char *wrong_str = "Wrong/unsupported";
if(actionKey == "help_recording") { if(actionKey == "help_recording") {
ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack); ShowLocalizedMessage(LOCALE_SETTINGS_HELP, LOCALE_RECORDINGMENU_HELP, CMessageBox::mbrBack, CMessageBox::mbBack);
@@ -4200,7 +4201,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
if (fileBrowser.exec(g_settings.update_dir) == true) { if (fileBrowser.exec(g_settings.update_dir) == true) {
const char * newdir = fileBrowser.getSelectedFile()->Name.c_str(); const char * newdir = fileBrowser.getSelectedFile()->Name.c_str();
if(check_dir(newdir)) if(check_dir(newdir))
printf("Wrong/unsupported recording dir %s\n", newdir); printf("%s recording dir %s\n",wrong_str , newdir);
else { else {
strcpy(g_settings.update_dir, fileBrowser.getSelectedFile()->Name.c_str()); strcpy(g_settings.update_dir, fileBrowser.getSelectedFile()->Name.c_str());
printf("[neutrino] new update dir %s\n", fileBrowser.getSelectedFile()->Name.c_str()); printf("[neutrino] new update dir %s\n", fileBrowser.getSelectedFile()->Name.c_str());
@@ -4215,7 +4216,7 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
if (b.exec(g_settings.epg_dir.c_str())) { if (b.exec(g_settings.epg_dir.c_str())) {
const char * newdir = b.getSelectedFile()->Name.c_str(); const char * newdir = b.getSelectedFile()->Name.c_str();
if(check_dir(newdir)) if(check_dir(newdir))
printf("Wrong/unsupported epg dir %s\n", newdir); printf("%s epg dir %s\n",wrong_str , newdir);
else { else {
g_settings.epg_dir = b.getSelectedFile()->Name; g_settings.epg_dir = b.getSelectedFile()->Name;
SendSectionsdConfig(); SendSectionsdConfig();
@@ -4224,23 +4225,37 @@ int CNeutrinoApp::exec(CMenuTarget* parent, const std::string & actionKey)
return menu_return::RETURN_REPAINT; return menu_return::RETURN_REPAINT;
} }
else if(actionKey == "pluginhdddir") { else if(actionKey == "plugin_dir") {
parent->hide(); parent->hide();
CFileBrowser b; CFileBrowser b;
b.Dir_Mode=true; b.Dir_Mode=true;
if (b.exec(g_settings.plugin_hdd_dir.c_str())) { if (b.exec(g_settings.plugin_hdd_dir.c_str())) {
const char * newdir = b.getSelectedFile()->Name.c_str(); const char * newdir = b.getSelectedFile()->Name.c_str();
if(check_dir(newdir)) if(check_dir(newdir))
printf("Wrong/unsupported plugin dir %s\n", newdir); printf("%s plugin dir %s\n",wrong_str , newdir);
else { else {
g_settings.plugin_hdd_dir = b.getSelectedFile()->Name; g_settings.plugin_hdd_dir = b.getSelectedFile()->Name;
SendSectionsdConfig();
g_PluginList->loadPlugins(); g_PluginList->loadPlugins();
} }
} }
return menu_return::RETURN_REPAINT; return menu_return::RETURN_REPAINT;
} }
else if(actionKey == "logo_dir") {
parent->hide();
CFileBrowser b;
b.Dir_Mode=true;
if (b.exec(g_settings.logo_hdd_dir.c_str())) {
const char * newdir = b.getSelectedFile()->Name.c_str();
if(check_dir(newdir))
printf("%s logo dir %s\n",wrong_str , newdir);
else {
g_settings.logo_hdd_dir = b.getSelectedFile()->Name;
}
}
return menu_return::RETURN_REPAINT;
}
else if(actionKey == "movieplugin") { else if(actionKey == "movieplugin") {
parent->hide(); parent->hide();
CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES); CMenuWidget MoviePluginSelector(LOCALE_MOVIEPLAYER_DEFPLUGIN, NEUTRINO_ICON_FEATURES);

View File

@@ -1321,7 +1321,8 @@ void CNeutrinoApp::InitMiscSettings(CMenuWidget &miscSettings)
if (g_info.delivery_system == DVB_S) { if (g_info.delivery_system == DVB_S) {
miscSettingsGeneral->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ROTORSWAP, &g_settings.rotor_swap, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); miscSettingsGeneral->addItem(new CMenuOptionChooser(LOCALE_EXTRA_ROTORSWAP, &g_settings.rotor_swap, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true));
} }
miscSettingsGeneral->addItem(new CMenuForwarder(LOCALE_PLUGINS_HDD_DIR, true, g_settings.plugin_hdd_dir, this, "pluginhdddir")); miscSettingsGeneral->addItem(new CMenuForwarder(LOCALE_PLUGINS_HDD_DIR, true, g_settings.plugin_hdd_dir, this, "plugin_dir"));
miscSettingsGeneral->addItem(new CMenuForwarder(LOCALE_LOGO_HDD_DIR, true, g_settings.logo_hdd_dir, this, "logo_dir"));
if(cs_get_revision() > 7){ if(cs_get_revision() > 7){

View File

@@ -509,6 +509,7 @@ typedef enum {
LOCALE_LEDCONTROLER_ON_LED1, LOCALE_LEDCONTROLER_ON_LED1,
LOCALE_LEDCONTROLER_ON_LED2, LOCALE_LEDCONTROLER_ON_LED2,
LOCALE_LEDCONTROLER_BLINK, LOCALE_LEDCONTROLER_BLINK,
LOCALE_LOGO_HDD_DIR,
LOCALE_MAINMENU_AUDIOPLAYER, LOCALE_MAINMENU_AUDIOPLAYER,
LOCALE_MAINMENU_CLEARSECTIONSD, LOCALE_MAINMENU_CLEARSECTIONSD,
LOCALE_MAINMENU_GAMES, LOCALE_MAINMENU_GAMES,

View File

@@ -509,6 +509,7 @@ const char *locale_real_names[] = {
"ledcontroler.on.led1", "ledcontroler.on.led1",
"ledcontroler.on.led2", "ledcontroler.on.led2",
"ledcontroler.blink", "ledcontroler.blink",
"logo_hdd_dir",
"mainmenu.audioplayer", "mainmenu.audioplayer",
"mainmenu.clearsectionsd", "mainmenu.clearsectionsd",
"mainmenu.games", "mainmenu.games",

View File

@@ -256,6 +256,9 @@ struct SNeutrinoSettings
std::string movieplayer_plugin; std::string movieplayer_plugin;
std::string onekey_plugin; std::string onekey_plugin;
std::string plugin_hdd_dir; std::string plugin_hdd_dir;
std::string logo_hdd_dir;
//key configuration //key configuration
int key_tvradio_mode; int key_tvradio_mode;