mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-29 16:31:05 +02:00
move FLAGDIR definition to global.h; ...
... use CTouchFileNotifier to handle .hddpower flagfile
Origin commit data
------------------
Branch: ni/coolstream
Commit: 0cdacc196e
Author: vanhofen <vanhofen@gmx.de>
Date: 2016-05-25 (Wed, 25 May 2016)
Origin message was:
------------------
- move FLAGDIR definition to global.h; ...
... use CTouchFileNotifier to handle .hddpower flagfile
------------------
This commit was generated by Migit
This commit is contained in:
@@ -45,7 +45,6 @@
|
|||||||
#include "hdd_menu.h"
|
#include "hdd_menu.h"
|
||||||
|
|
||||||
#include <cs_api.h> //NI
|
#include <cs_api.h> //NI
|
||||||
#include <gui/ni_menu.h> //NI
|
|
||||||
#include <gui/widget/icons.h>
|
#include <gui/widget/icons.h>
|
||||||
#include <gui/widget/stringinput.h>
|
#include <gui/widget/stringinput.h>
|
||||||
#include <gui/widget/messagebox.h>
|
#include <gui/widget/messagebox.h>
|
||||||
@@ -736,10 +735,10 @@ _show_menu:
|
|||||||
hddmenu->addItem(new CMenuSeparator());
|
hddmenu->addItem(new CMenuSeparator());
|
||||||
if (cs_get_revision() < 8) {
|
if (cs_get_revision() < 8) {
|
||||||
//NI HDD power (HD1/BSE only)
|
//NI HDD power (HD1/BSE only)
|
||||||
int flag_hddpower = file_exists(FLAG_DIR ".hddpower");
|
const char *flag_hddpower = FLAGDIR "/.hddpower";
|
||||||
|
int fake_hddpower = file_exists(flag_hddpower);
|
||||||
CNITouchFileNotifier * hddpowerNotifier = new CNITouchFileNotifier("hddpower");
|
CTouchFileNotifier * hddpowerNotifier = new CTouchFileNotifier(flag_hddpower);
|
||||||
mc = new CMenuOptionChooser(LOCALE_HDD_POWER, &flag_hddpower, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, hddpowerNotifier, CRCInput::RC_yellow);
|
mc = new CMenuOptionChooser(LOCALE_HDD_POWER, &fake_hddpower, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, hddpowerNotifier, CRCInput::RC_yellow);
|
||||||
mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_HDD_POWER);
|
mc->setHint(NEUTRINO_ICON_HINT_IMAGELOGO, LOCALE_MENU_HINT_HDD_POWER);
|
||||||
hddmenu->addItem(mc);
|
hddmenu->addItem(mc);
|
||||||
hddmenu->addItem(new CMenuSeparator());
|
hddmenu->addItem(new CMenuSeparator());
|
||||||
|
@@ -56,8 +56,6 @@
|
|||||||
#include "gui/lcd4l.h"
|
#include "gui/lcd4l.h"
|
||||||
extern CLCD4l *LCD4l;
|
extern CLCD4l *LCD4l;
|
||||||
|
|
||||||
#define FLAG_DIR "/var/etc/"
|
|
||||||
|
|
||||||
const CMenuOptionChooser::keyval LCD4L_SUPPORT_OPTIONS[] =
|
const CMenuOptionChooser::keyval LCD4L_SUPPORT_OPTIONS[] =
|
||||||
{
|
{
|
||||||
{ 0, LOCALE_LCD4L_SUPPORT_OFF },
|
{ 0, LOCALE_LCD4L_SUPPORT_OFF },
|
||||||
@@ -146,14 +144,14 @@ int CLCD4lSetup::show()
|
|||||||
mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SKIN);
|
mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_SKIN);
|
||||||
lcd4lSetup->addItem(mc);
|
lcd4lSetup->addItem(mc);
|
||||||
|
|
||||||
const char *flag_lcd4l_weather = FLAG_DIR ".lcd-weather";
|
const char *flag_lcd4l_weather = FLAGDIR "/.lcd-weather";
|
||||||
int fake_lcd4l_weather = file_exists(flag_lcd4l_weather);
|
int fake_lcd4l_weather = file_exists(flag_lcd4l_weather);
|
||||||
CTouchFileNotifier * lcd_weather = new CTouchFileNotifier(flag_lcd4l_weather);
|
CTouchFileNotifier * lcd_weather = new CTouchFileNotifier(flag_lcd4l_weather);
|
||||||
mc = new CMenuOptionChooser(LOCALE_LCD4L_WEATHER, &fake_lcd4l_weather, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (file_exists("/share/lcd/scripts/weather")), lcd_weather, CRCInput::convertDigitToKey(shortcut++));
|
mc = new CMenuOptionChooser(LOCALE_LCD4L_WEATHER, &fake_lcd4l_weather, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, (file_exists("/share/lcd/scripts/weather")), lcd_weather, CRCInput::convertDigitToKey(shortcut++));
|
||||||
mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_WEATHER);
|
mc->setHint(NEUTRINO_ICON_HINT_LCD4L, LOCALE_MENU_HINT_LCD4L_WEATHER);
|
||||||
lcd4lSetup->addItem(mc);
|
lcd4lSetup->addItem(mc);
|
||||||
|
|
||||||
const char *flag_lcd4l_clock_a = FLAG_DIR ".lcd-clock_a";
|
const char *flag_lcd4l_clock_a = FLAGDIR "/.lcd-clock_a";
|
||||||
int fake_lcd4l_clock_a = file_exists(flag_lcd4l_clock_a);
|
int fake_lcd4l_clock_a = file_exists(flag_lcd4l_clock_a);
|
||||||
CTouchFileNotifier * lcd_clock_a = new CTouchFileNotifier(flag_lcd4l_clock_a);
|
CTouchFileNotifier * lcd_clock_a = new CTouchFileNotifier(flag_lcd4l_clock_a);
|
||||||
mc = new CMenuOptionChooser(LOCALE_LCD4L_CLOCK_A, &fake_lcd4l_clock_a, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, lcd_clock_a, CRCInput::convertDigitToKey(shortcut++));
|
mc = new CMenuOptionChooser(LOCALE_LCD4L_CLOCK_A, &fake_lcd4l_clock_a, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, lcd_clock_a, CRCInput::convertDigitToKey(shortcut++));
|
||||||
|
@@ -200,7 +200,7 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
|
|||||||
{
|
{
|
||||||
std::ostringstream buf;
|
std::ostringstream buf;
|
||||||
|
|
||||||
buf << FLAG_DIR << "." << filename;
|
buf << FLAGDIR << "/." << filename;
|
||||||
std::string flag = buf.str();
|
std::string flag = buf.str();
|
||||||
|
|
||||||
if ((*(int *)data) != 0)
|
if ((*(int *)data) != 0)
|
||||||
@@ -251,10 +251,6 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
delete hintbox;
|
delete hintbox;
|
||||||
}
|
}
|
||||||
else if (strstr(filename, "hddpower"))
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf.str("");
|
buf.str("");
|
||||||
@@ -308,10 +304,6 @@ bool CNITouchFileNotifier::changeNotify(const neutrino_locale_t, void * data)
|
|||||||
sleep(1);
|
sleep(1);
|
||||||
delete hintbox;
|
delete hintbox;
|
||||||
}
|
}
|
||||||
else if (strstr(filename, "hddpower"))
|
|
||||||
{
|
|
||||||
// do nothing
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
buf << "service " << filename << " stop";
|
buf << "service " << filename << " stop";
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#define SCRIPT_DIR "/etc/init.d/"
|
#define SCRIPT_DIR "/etc/init.d/"
|
||||||
#define EMU_DIR "/var/bin/"
|
#define EMU_DIR "/var/bin/"
|
||||||
#define FLAG_DIR "/var/etc/"
|
|
||||||
#define EMU_START_SCRIPT SCRIPT_DIR "emu"
|
#define EMU_START_SCRIPT SCRIPT_DIR "emu"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
Reference in New Issue
Block a user