- fix scart_osd_fix

Conflicts:
	src/gui/osd_setup.cpp
	src/system/setting_helpers.cpp

Signed-off-by: Thilo Graf <dbt@novatux.de>
This commit is contained in:
svenhoefer
2021-03-31 22:15:28 +02:00
committed by Thilo Graf
parent 3ec296ec60
commit d5a16ebba9
3 changed files with 86 additions and 6 deletions

View File

@@ -723,8 +723,8 @@ int COsdSetup::showOsdSetup()
mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET); mc->setHint("", LOCALE_MENU_HINT_OSD_PRESET);
osd_menu->addItem(mc); osd_menu->addItem(mc);
} }
#if 0
#if !defined BOXMODEL_CST_HD2 #if defined BOXMODEL_CST_HD1
int scart_osd_fix_exist = 0; int scart_osd_fix_exist = 0;
if (file_exists("/var/etc/.scart_osd_fix")) if (file_exists("/var/etc/.scart_osd_fix"))
scart_osd_fix_exist = 1; scart_osd_fix_exist = 1;
@@ -734,7 +734,7 @@ int COsdSetup::showOsdSetup()
mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_SCART_OSD_FIX); mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_SCART_OSD_FIX);
osd_menu->addItem(mc); osd_menu->addItem(mc);
#endif #endif
#endif
#if 0 #if 0
// round corners // round corners
mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.theme.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this); mc = new CMenuOptionChooser(LOCALE_EXTRA_ROUNDED_CORNERS, &g_settings.theme.rounded_corners, MENU_CORNERSETTINGS_TYPE_OPTIONS, MENU_CORNERSETTINGS_TYPE_OPTION_COUNT, true, this);
@@ -776,9 +776,9 @@ int COsdSetup::showOsdSetup()
CAudioMute::getInstance()->enableMuteIcon(true); CAudioMute::getInstance()->enableMuteIcon(true);
} }
// #if !defined BOXMODEL_CST_HD2 #if defined BOXMODEL_CST_HD1
// delete scartFileNotifier; delete scartFileNotifier;
// #endif #endif
delete colorInfoclockNotifier; delete colorInfoclockNotifier;
delete screensaverNotifier; delete screensaverNotifier;
delete channellistNotifier; delete channellistNotifier;

View File

@@ -137,6 +137,78 @@ bool CTouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
return true; return true;
} }
bool CFlagFileNotifier::changeNotify(const neutrino_locale_t, void * data)
{
std::string flagfile = FLAGDIR;
flagfile += "/.";
flagfile += filename;
if ((*(int *)data) != 0)
{
FILE * fd = fopen(flagfile.c_str(), "w");
if (fd)
{
fclose(fd);
if (strstr(filename, "scart_osd_fix"))
{
//change to scart-osd-fix values
g_settings.screen_StartX_b_0 = 30;
g_settings.screen_StartY_b_0 = 45;
g_settings.screen_EndX_b_0 = 690;
g_settings.screen_EndY_b_0 = 535;
g_settings.screen_preset = 1;
//set values
g_settings.screen_StartX = g_settings.screen_StartX_b_0;
g_settings.screen_StartY = g_settings.screen_StartY_b_0;
g_settings.screen_EndX = g_settings.screen_EndX_b_0;
g_settings.screen_EndY = g_settings.screen_EndY_b_0;
CFrameBuffer::getInstance()->Clear();
g_settings.font_scaling_x = 100;
g_settings.font_scaling_y = 100;
}
else
{
printf("[CFlagFileNotifier] executing \"service %s start\"\n", filename);
if (my_system(3, "service", filename, "start") != 0)
printf("[CFlagFileNotifier] executing failed\n");
}
}
}
else
{
if (strstr(filename, "scart_osd_fix"))
{
//reset to defaults
g_settings.screen_StartX_b_0 = 22;
g_settings.screen_StartY_b_0 = 12;
g_settings.screen_EndX_b_0 = 1259 - g_settings.screen_StartX_b_0 - 1;
g_settings.screen_EndY_b_0 = 708 - g_settings.screen_StartY_b_0 - 1;
//set values
g_settings.screen_StartX = g_settings.screen_preset ? g_settings.screen_StartX_b_0 : g_settings.screen_StartX_a_0;
g_settings.screen_StartY = g_settings.screen_preset ? g_settings.screen_StartY_b_0 : g_settings.screen_StartY_a_0;
g_settings.screen_EndX = g_settings.screen_preset ? g_settings.screen_EndX_b_0 : g_settings.screen_EndX_a_0;
g_settings.screen_EndY = g_settings.screen_preset ? g_settings.screen_EndY_b_0 : g_settings.screen_EndY_a_0;
CFrameBuffer::getInstance()->Clear();
g_settings.font_scaling_x = 105;
g_settings.font_scaling_y = 105;
}
else
{
printf("[CFlagFileNotifier] executing \"service %s stop\"\n", filename);
if (my_system(3, "service", filename, "stop") != 0)
printf("[CFlagFileNotifier] executing failed\n");
}
remove(flagfile.c_str());
}
return menu_return::RETURN_REPAINT;
}
void CColorSetupNotifier::setPalette() void CColorSetupNotifier::setPalette()
{ {
CFrameBuffer *frameBuffer = CFrameBuffer::getInstance(); CFrameBuffer *frameBuffer = CFrameBuffer::getInstance();

View File

@@ -82,6 +82,14 @@ class CTouchFileNotifier : public CChangeObserver
bool changeNotify(const neutrino_locale_t, void * data); bool changeNotify(const neutrino_locale_t, void * data);
}; };
class CFlagFileNotifier : public CChangeObserver
{
const char * filename;
public:
inline CFlagFileNotifier(const char * _filename) { filename = _filename; };
bool changeNotify(const neutrino_locale_t, void * data);
};
class CColorSetupNotifier : public CChangeObserver class CColorSetupNotifier : public CChangeObserver
{ {
public: public: