aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/base/thread.cpp9
-rw-r--r--lib/dvb/sec.cpp415
-rw-r--r--lib/python/Components/Converter/Makefile.am2
-rw-r--r--lib/python/Components/Converter/ValueToPixmap.py40
-rw-r--r--lib/python/Components/Renderer/Pixmap.py13
-rw-r--r--lib/python/Components/Scanner.py2
-rw-r--r--lib/python/Components/UsageConfig.py2
-rw-r--r--lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py40
-rw-r--r--lib/python/Plugins/SystemPlugins/Hotplug/plugin.py10
-rwxr-xr-xlib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py2
-rw-r--r--lib/python/Screens/AudioSelection.py22
-rw-r--r--lib/python/Screens/ChannelSelection.py18
-rw-r--r--lib/python/Screens/InfoBarGenerics.py23
-rw-r--r--lib/python/Screens/TaskView.py6
-rwxr-xr-xlib/python/Screens/VirtualKeyBoard.py200
-rw-r--r--lib/python/Tools/NumericalTextInput.py16
16 files changed, 535 insertions, 285 deletions
diff --git a/lib/base/thread.cpp b/lib/base/thread.cpp
index fa923deb..1fda6a47 100644
--- a/lib/base/thread.cpp
+++ b/lib/base/thread.cpp
@@ -58,7 +58,12 @@ int eThread::runAsync(int prio, int policy)
pthread_attr_setschedpolicy(&attr, policy);
pthread_attr_setschedparam(&attr, &p);
}
-
+
+ if (the_thread) {
+ eDebug("old thread joined %d", pthread_join(the_thread, 0));
+ the_thread = 0;
+ }
+
if (pthread_create(&the_thread, &attr, wrapper, this))
{
pthread_attr_destroy(&attr);
@@ -69,7 +74,7 @@ int eThread::runAsync(int prio, int policy)
pthread_attr_destroy(&attr);
return 0;
-}
+}
int eThread::run(int prio, int policy)
{
diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp
index a2bc8869..e4f00add 100644
--- a/lib/dvb/sec.cpp
+++ b/lib/dvb/sec.cpp
@@ -324,6 +324,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
bool diseqc13V = voltage_mode == eDVBSatelliteSwitchParameters::HV_13;
bool is_unicable = lnb_param.SatCR_idx != -1;
+ bool useGotoXX = false;
+ int RotorCmd=-1;
+ int send_mask = 0;
+
lnb_param.guard_offset = 0; //HACK
frontend.setData(eDVBFrontend::SATCR, lnb_param.SatCR_idx);
@@ -411,6 +415,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
eDebug("[prepare] UnicableTuningWord %#04x",lnb_param.UnicableTuningWord);
eDebug("[prepare] guard_offset %d",lnb_param.guard_offset);
frontend.setData(eDVBFrontend::FREQ_OFFSET, (lnb_param.UnicableTuningWord & 0x3FF) *4000 + 1400000 + lof - (2 * (lnb_param.SatCRvco - (tmp1-tmp2))) );
+ voltage = VOLTAGE(13);
}
if (diseqc_mode >= eDVBSatelliteDiseqcParameters::V1_0)
@@ -433,7 +438,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
(di_param.m_toneburst_param != eDVBSatelliteDiseqcParameters::NO);
bool changed_burst = send_burst && (forceChanged || toneburst != lastToneburst);
- int send_mask = 0; /*
+ /* send_mask
1 must send csw
2 must send ucsw
4 send toneburst first
@@ -487,8 +492,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
#endif
if (doSetVoltageToneFrontend)
{
- int RotorCmd=-1;
- bool useGotoXX = false;
+
if ( diseqc_mode == eDVBSatelliteDiseqcParameters::V1_2
&& !sat.no_rotor_command_on_tune )
{
@@ -561,7 +565,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
vlt = iDVBFrontend::voltage13;
else if ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
{
- if (rotor_param.m_inputpower_parameters.m_use)
+ if (rotor_param.m_inputpower_parameters.m_use && !is_unicable)
vlt = VOLTAGE(18); // in input power mode set 18V for measure input power
else
vlt = VOLTAGE(13); // in normal mode start turning with 13V
@@ -687,187 +691,6 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
}
}
- eDebugNoSimulate("RotorCmd %02x, lastRotorCmd %02lx", RotorCmd, lastRotorCmd);
- if ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
- {
- eSecCommand::pair compare;
- if (!send_mask && !is_unicable)
- {
- compare.steps = +3;
- compare.tone = iDVBFrontend::toneOff;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_CONT_TONE_DISABLE_BEFORE_DISEQC]) );
-
- compare.voltage = iDVBFrontend::voltageOff;
- compare.steps = +4;
- // the next is a check if voltage is switched off.. then we first set a voltage :)
- // else we set voltage after all diseqc stuff..
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) );
-
- if (rotor_param.m_inputpower_parameters.m_use)
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // set 18V for measure input power
- else
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V
-
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_MOTOR_CMD]) ); // wait 750ms when voltage was disabled
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +9) ); // no need to send stop rotor cmd and recheck voltage
- }
- else
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
-
- eDVBDiseqcCommand diseqc;
- memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
- diseqc.len = 3;
- diseqc.data[0] = 0xE0;
- diseqc.data[1] = 0x31; // positioner
- diseqc.data[2] = 0x60; // stop
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_ROTORPOS_VALID_GOTO, +5) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
- // wait 150msec after send rotor stop cmd
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_MOTOR_STOP_CMD]) );
-
- diseqc.data[0] = 0xE0;
- diseqc.data[1] = 0x31; // positioner
- if ( useGotoXX )
- {
- diseqc.len = 5;
- diseqc.data[2] = 0x6E; // drive to angular position
- diseqc.data[3] = ((RotorCmd & 0xFF00) / 0x100);
- diseqc.data[4] = RotorCmd & 0xFF;
- }
- else
- {
- diseqc.len = 4;
- diseqc.data[2] = 0x6B; // goto stored sat position
- diseqc.data[3] = RotorCmd;
- diseqc.data[4] = 0x00;
- }
-// if(!is_unicable)
- {
- int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds!
- if ( rotor_param.m_inputpower_parameters.m_use && !is_unicable)
- { // use measure rotor input power to detect rotor state
- bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed);
- eSecCommand::rotor cmd;
- eSecCommand::pair compare;
- if (turn_fast)
- compare.voltage = VOLTAGE(18);
- else
- compare.voltage = VOLTAGE(13);
- compare.steps = +3;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) );
- // measure idle power values
- compare.steps = -2;
- if (turn_fast) {
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MEASURE_IDLE_INPUTPOWER]) ); // wait 150msec after voltage change
- sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 1) );
- compare.val = 1;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) );
- }
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MEASURE_IDLE_INPUTPOWER]) ); // wait 150msec before measure
- sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 0) );
- compare.val = 0;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) );
- ////////////////////////////
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_DISEQC_RETRYS, m_params[MOTOR_COMMAND_RETRIES]) ); // 2 retries
- sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, 40) ); // 2 seconds rotor start timout
- // rotor start loop
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // 50msec delay
- sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
- cmd.direction=1; // check for running rotor
- cmd.deltaA=rotor_param.m_inputpower_parameters.m_delta;
- cmd.steps=+5;
- cmd.okcount=0;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) ); // check if rotor has started
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout .. we assume now the rotor is already at the correct position
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // goto loop start
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, turn_fast ? 10 : 9 ) ); // timeout .. we assume now the rotor is already at the correct position
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -8) ); // goto loop start
- ////////////////////
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) );
- if (turn_fast)
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, mrt*20) ); // mrt is in seconds... our SLEEP time is 50ms.. so * 20
- // rotor running loop
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // wait 50msec
- sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
- cmd.direction=0; // check for stopped rotor
- cmd.steps=+3;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout ? this should never happen
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // running loop start
- /////////////////////
- sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) );
- }
- else
- { // use normal turning mode
- if (curRotorPos != -1)
- {
- mrt = abs(curRotorPos - sat.orbital_position);
- if (mrt > 1800)
- mrt = 3600 - mrt;
- if (mrt % 10)
- mrt += 10; // round a little bit
- mrt *= 2000; // (we assume a very slow rotor with just 0.5 degree per second here)
- mrt /= 10000;
- mrt += 3; // a little bit overhead
- }
- doSetVoltageToneFrontend=false;
- doSetFrontend=false;
- eSecCommand::rotor cmd;
- eSecCommand::pair compare;
- compare.voltage = VOLTAGE(13);
- compare.steps = +3;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD]) ); // wait 150msec after voltage change
-
- sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 1000) ); // sleep one second before change voltage or tone
-
- compare.voltage = voltage;
- compare.steps = +3;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); // correct final voltage?
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 2000) ); // wait 2 second before set high voltage
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) );
-
- compare.tone = tone;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_CONT_TONE_CHANGE]) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND, 0) );
-
- cmd.direction=1; // check for running rotor
- cmd.deltaA=0;
- cmd.steps = +3;
- cmd.okcount=0;
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, mrt*4) ); // mrt is in seconds... our SLEEP time is 250ms.. so * 4
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) ); // 250msec delay
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TUNER_LOCKED_GOTO, cmd ) );
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +5 ) );
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -3) ); // goto loop start
- sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) );
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +4) );
- sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT, tunetimeout) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND, 1) );
- sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -5) );
- }
- eDebug("set rotor timeout to %d seconds", mrt);
- sec_fe->setData(eDVBFrontend::NEW_ROTOR_CMD, RotorCmd);
- sec_fe->setData(eDVBFrontend::NEW_ROTOR_POS, sat.orbital_position);
- }
- }
}
}
else
@@ -880,22 +703,6 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
sec_fe->setData(eDVBFrontend::NEW_UCSW, ucsw);
sec_fe->setData(eDVBFrontend::NEW_TONEBURST, di_param.m_toneburst_param);
- if (doSetVoltageToneFrontend && !is_unicable)
- {
- eSecCommand::pair compare;
- compare.voltage = voltage;
- compare.steps = +3;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); // voltage already correct ?
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_VOLTAGE_CHANGE]) );
- compare.tone = tone;
- sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_CONT_TONE_CHANGE]) );
- }
-
- sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_SWITCHPARMS) );
-
if(is_unicable)
{
// check if voltage is disabled
@@ -903,10 +710,10 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
compare.steps = +3;
compare.voltage = iDVBFrontend::voltageOff;
sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) );
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS] ) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage18_5) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_SWITCH_CMDS]) ); // wait 20 ms after voltage change
@@ -921,9 +728,209 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_LAST_DISEQC_CMD]) );
- sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, iDVBFrontend::voltage13) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) );
+ if ( RotorCmd != -1 && RotorCmd != lastRotorCmd && !rotor_param.m_inputpower_parameters.m_use)
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD]) ); // wait 150msec after voltage change
}
+ eDebugNoSimulate("RotorCmd %02x, lastRotorCmd %02lx", RotorCmd, lastRotorCmd);
+ if ( RotorCmd != -1 && RotorCmd != lastRotorCmd )
+ {
+ eSecCommand::pair compare;
+ if (!send_mask && !is_unicable)
+ {
+ compare.steps = +3;
+ compare.tone = iDVBFrontend::toneOff;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, iDVBFrontend::toneOff) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_CONT_TONE_DISABLE_BEFORE_DISEQC]) );
+
+ compare.voltage = iDVBFrontend::voltageOff;
+ compare.steps = +4;
+ // the next is a check if voltage is switched off.. then we first set a voltage :)
+ // else we set voltage after all diseqc stuff..
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_NOT_VOLTAGE_GOTO, compare) );
+
+ if (rotor_param.m_inputpower_parameters.m_use)
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) ); // set 18V for measure input power
+ else
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) ); // in normal mode start turning with 13V
+
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_MOTOR_CMD]) ); // wait 750ms when voltage was disabled
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +9) ); // no need to send stop rotor cmd and recheck voltage
+ }
+ else
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_BETWEEN_SWITCH_AND_MOTOR_CMD]) ); // wait 700ms when diseqc changed
+
+ eDVBDiseqcCommand diseqc;
+ memset(diseqc.data, 0, MAX_DISEQC_LENGTH);
+ diseqc.len = 3;
+ diseqc.data[0] = 0xE0;
+ diseqc.data[1] = 0x31; // positioner
+ diseqc.data[2] = 0x60; // stop
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_ROTORPOS_VALID_GOTO, +5) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ // wait 150msec after send rotor stop cmd
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_MOTOR_STOP_CMD]) );
+
+ diseqc.data[0] = 0xE0;
+ diseqc.data[1] = 0x31; // positioner
+ if ( useGotoXX )
+ {
+ diseqc.len = 5;
+ diseqc.data[2] = 0x6E; // drive to angular position
+ diseqc.data[3] = ((RotorCmd & 0xFF00) / 0x100);
+ diseqc.data[4] = RotorCmd & 0xFF;
+ }
+ else
+ {
+ diseqc.len = 4;
+ diseqc.data[2] = 0x6B; // goto stored sat position
+ diseqc.data[3] = RotorCmd;
+ diseqc.data[4] = 0x00;
+ }
+
+ {
+ int mrt = m_params[MOTOR_RUNNING_TIMEOUT]; // in seconds!
+ if ( rotor_param.m_inputpower_parameters.m_use)
+ { // use measure rotor input power to detect rotor state
+ bool turn_fast = need_turn_fast(rotor_param.m_inputpower_parameters.m_turning_speed) && !is_unicable;
+ eSecCommand::rotor cmd;
+ eSecCommand::pair compare;
+ if (turn_fast)
+ compare.voltage = VOLTAGE(18);
+ else
+ compare.voltage = VOLTAGE(13);
+ compare.steps = +3;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) );
+ // measure idle power values
+ compare.steps = -2;
+ if (turn_fast) {
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MEASURE_IDLE_INPUTPOWER]) ); // wait 150msec after voltage change
+ sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 1) );
+ compare.val = 1;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(13)) );
+ }
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MEASURE_IDLE_INPUTPOWER]) ); // wait 150msec before measure
+ sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_IDLE_INPUTPOWER, 0) );
+ compare.val = 0;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_MEASURE_IDLE_WAS_NOT_OK_GOTO, compare) );
+ ////////////////////////////
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_DISEQC_RETRYS, m_params[MOTOR_COMMAND_RETRIES]) ); // 2 retries
+ sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, 40) ); // 2 seconds rotor start timout
+ // rotor start loop
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // 50msec delay
+ sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
+ cmd.direction=1; // check for running rotor
+ cmd.deltaA=rotor_param.m_inputpower_parameters.m_delta;
+ cmd.steps=+5;
+ cmd.okcount=0;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) ); // check if rotor has started
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout .. we assume now the rotor is already at the correct position
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // goto loop start
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_NO_MORE_ROTOR_DISEQC_RETRYS_GOTO, turn_fast ? 10 : 9 ) ); // timeout .. we assume now the rotor is already at the correct position
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -8) ); // goto loop start
+ ////////////////////
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) );
+ if (turn_fast)
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, VOLTAGE(18)) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, mrt*20) ); // mrt is in seconds... our SLEEP time is 50ms.. so * 20
+ // rotor running loop
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); // wait 50msec
+ sec_sequence.push_back( eSecCommand(eSecCommand::MEASURE_RUNNING_INPUTPOWER) );
+ cmd.direction=0; // check for stopped rotor
+ cmd.steps=+3;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_INPUTPOWER_DELTA_GOTO, cmd ) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +2 ) ); // timeout ? this should never happen
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -4) ); // running loop start
+ /////////////////////
+ sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) );
+ }
+ else
+ { // use normal turning mode
+ if (curRotorPos != -1)
+ {
+ mrt = abs(curRotorPos - sat.orbital_position);
+ if (mrt > 1800)
+ mrt = 3600 - mrt;
+ if (mrt % 10)
+ mrt += 10; // round a little bit
+ mrt *= 2000; // (we assume a very slow rotor with just 0.5 degree per second here)
+ mrt /= 10000;
+ mrt += 3; // a little bit overhead
+ }
+ doSetVoltageToneFrontend=false;
+ doSetFrontend=false;
+ eSecCommand::rotor cmd;
+ eSecCommand::pair compare;
+ compare.voltage = VOLTAGE(13);
+ compare.steps = +3;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, compare.voltage) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_VOLTAGE_CHANGE_BEFORE_MOTOR_CMD]) ); // wait 150msec after voltage change
+
+ sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_ROTORPARMS) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_MOVING) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 1000) ); // sleep one second before change voltage or tone
+
+ compare.voltage = voltage;
+ compare.steps = +3;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); // correct final voltage?
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 2000) ); // wait 2 second before set high voltage
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) );
+
+ compare.tone = tone;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_CONT_TONE_CHANGE]) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND, 0) );
+
+ cmd.direction=1; // check for running rotor
+ cmd.deltaA=0;
+ cmd.steps = +3;
+ cmd.okcount=0;
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TIMEOUT, mrt*4) ); // mrt is in seconds... our SLEEP time is 250ms.. so * 4
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 250) ); // 250msec delay
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TUNER_LOCKED_GOTO, cmd ) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TIMEOUT_GOTO, +5 ) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -3) ); // goto loop start
+ sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_ROTORPARAMS) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_ROTOR_STOPPED) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, +4) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT, tunetimeout) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_FRONTEND, 1) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::GOTO, -5) );
+ }
+ eDebug("set rotor timeout to %d seconds", mrt);
+ sec_fe->setData(eDVBFrontend::NEW_ROTOR_CMD, RotorCmd);
+ sec_fe->setData(eDVBFrontend::NEW_ROTOR_POS, sat.orbital_position);
+ }
+ }
+
+ if (doSetVoltageToneFrontend && !is_unicable)
+ {
+ eSecCommand::pair compare;
+ compare.voltage = voltage;
+ compare.steps = +3;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_VOLTAGE_GOTO, compare) ); // voltage already correct ?
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_VOLTAGE, voltage) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_VOLTAGE_CHANGE]) );
+ compare.tone = tone;
+ sec_sequence.push_back( eSecCommand(eSecCommand::IF_TONE_GOTO, compare) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SET_TONE, tone) );
+ sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_FINAL_CONT_TONE_CHANGE]) );
+ }
+
+ sec_sequence.push_back( eSecCommand(eSecCommand::UPDATE_CURRENT_SWITCHPARMS) );
+
if (doSetFrontend)
{
sec_sequence.push_back( eSecCommand(eSecCommand::START_TUNE_TIMEOUT, tunetimeout) );
diff --git a/lib/python/Components/Converter/Makefile.am b/lib/python/Components/Converter/Makefile.am
index 3b6fd3e8..b73f6d5a 100644
--- a/lib/python/Components/Converter/Makefile.am
+++ b/lib/python/Components/Converter/Makefile.am
@@ -6,4 +6,4 @@ install_PYTHON = \
ConditionalShowHide.py ServicePosition.py ValueRange.py RdsInfo.py Streaming.py \
StaticMultiList.py ServiceTime.py MovieInfo.py MenuEntryCompare.py StringListSelection.py \
ValueBitTest.py TunerInfo.py ConfigEntryTest.py TemplatedMultiContent.py ProgressToText.py \
- Combine.py SensorToText.py
+ Combine.py SensorToText.py ValueToPixmap.py
diff --git a/lib/python/Components/Converter/ValueToPixmap.py b/lib/python/Components/Converter/ValueToPixmap.py
new file mode 100644
index 00000000..0acd2639
--- /dev/null
+++ b/lib/python/Components/Converter/ValueToPixmap.py
@@ -0,0 +1,40 @@
+from Components.Converter.Converter import Converter
+from Components.Element import cached, ElementError
+from Tools.Directories import fileExists, SCOPE_SKIN_IMAGE, SCOPE_CURRENT_SKIN, resolveFilename
+from Tools.LoadPixmap import LoadPixmap
+
+
+class ValueToPixmap(Converter, object):
+ LANGUAGE_CODE = 0
+ PATH = 1
+
+ def __init__(self, type):
+ Converter.__init__(self, type)
+ if type == "LanguageCode":
+ self.type = self.LANGUAGE_CODE
+ elif type == "Path":
+ self.type = self.PATH
+ else:
+ raise ElementError("'%s' is not <LanguageCode|Path> for ValueToPixmap converter" % type)
+
+ @cached
+ def getPixmap(self):
+ if self.source:
+ val = self.source.text
+ if val in (None, ""):
+ return None
+ if self.type == self.PATH:
+ return LoadPixmap(val)
+ if self.type == self.LANGUAGE_CODE:
+ png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_SKIN, "countries/" + val[3:].lower() + ".png"))
+ if png == None:
+ png = LoadPixmap(cached=True, path=resolveFilename(SCOPE_SKIN_IMAGE, "countries/missing.png"))
+ return png
+ return None
+
+ pixmap = property(getPixmap)
+
+ def changed(self, what):
+ if what[0] != self.CHANGED_SPECIFIC or what[1] == self.type:
+ Converter.changed(self, what)
+
diff --git a/lib/python/Components/Renderer/Pixmap.py b/lib/python/Components/Renderer/Pixmap.py
index d67cd559..7c6b5795 100644
--- a/lib/python/Components/Renderer/Pixmap.py
+++ b/lib/python/Components/Renderer/Pixmap.py
@@ -3,4 +3,17 @@ from Renderer import Renderer
from enigma import ePixmap
class Pixmap(Renderer):
+ def __init__(self):
+ Renderer.__init__(self)
+
GUI_WIDGET = ePixmap
+
+ def postWidgetCreate(self, instance):
+ self.changed((self.CHANGED_DEFAULT,))
+
+ def changed(self, what):
+ if what[0] != self.CHANGED_CLEAR:
+ if self.source and hasattr(self.source, "pixmap"):
+ if self.instance:
+ self.instance.setPixmap(self.source.pixmap)
+
diff --git a/lib/python/Components/Scanner.py b/lib/python/Components/Scanner.py
index 813c09f8..e01c61fd 100644
--- a/lib/python/Components/Scanner.py
+++ b/lib/python/Components/Scanner.py
@@ -11,6 +11,8 @@ add_type("application/x-dream-package", ".dmpkg")
add_type("application/x-dream-image", ".nfi")
add_type("video/MP2T", ".ts")
add_type("video/x-dvd-iso", ".iso")
+add_type("video/x-matroska", ".mkv")
+add_type("audio/x-matroska", ".mka")
def getType(file):
(type, _) = guess_type(file)
diff --git a/lib/python/Components/UsageConfig.py b/lib/python/Components/UsageConfig.py
index acbc3425..ce56f0f6 100644
--- a/lib/python/Components/UsageConfig.py
+++ b/lib/python/Components/UsageConfig.py
@@ -9,6 +9,8 @@ def InitUsageConfig():
config.usage = ConfigSubsection();
config.usage.showdish = ConfigYesNo(default = True)
config.usage.multibouquet = ConfigYesNo(default = False)
+ config.usage.multiepg_ask_bouquet = ConfigYesNo(default = False)
+
config.usage.quickzap_bouquet_change = ConfigYesNo(default = False)
config.usage.e1like_radio_mode = ConfigYesNo(default = False)
config.usage.infobar_timeout = ConfigSelection(default = "5", choices = [
diff --git a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
index bcc7b9b2..af14578a 100644
--- a/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
+++ b/lib/python/Plugins/Extensions/GraphMultiEPG/plugin.py
@@ -1,8 +1,9 @@
from Plugins.Plugin import PluginDescriptor
from GraphMultiEpg import GraphMultiEPG
-from Screens.ChannelSelection import BouquetSelector
+from Screens.ChannelSelection import BouquetSelector, SilentBouquetSelector
from enigma import eServiceCenter, eServiceReference
from ServiceReference import ServiceReference
+from Components.config import config
Session = None
Servicelist = None
@@ -73,6 +74,32 @@ def changeBouquetCB(direction, epg):
epg_bouquet = bouquet
epg.setServices(services)
+def openAskBouquet(Session, bouquets, cnt):
+ if cnt > 1: # show bouquet list
+ global bouquetSel
+ bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True)
+ dlg_stack.append(bouquetSel)
+ elif cnt == 1:
+ if not openBouquetEPG(bouquets[0][1]):
+ cleanup()
+
+def openSilent(Servicelist, bouquets, cnt):
+ root = Servicelist.getRoot()
+ if cnt > 1: # create bouquet list
+ global bouquetSel
+ current = 0
+ rootstr = root.toCompareString()
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
+ bouquetSel = SilentBouquetSelector(bouquets, True, current)
+ if cnt >= 1: # open current bouquet
+ if not openBouquetEPG(root):
+ cleanup()
+
def main(session, servicelist, **kwargs):
global Session
Session = session
@@ -83,13 +110,10 @@ def main(session, servicelist, **kwargs):
cnt = 0
else:
cnt = len(bouquets)
- if cnt > 1: # show bouquet list
- global bouquetSel
- bouquetSel = Session.openWithCallback(closed, BouquetSelector, bouquets, openBouquetEPG, enableWrapAround=True)
- dlg_stack.append(bouquetSel)
- elif cnt == 1:
- if not openBouquetEPG(bouquets[0][1]):
- cleanup()
+ if config.usage.multiepg_ask_bouquet.value:
+ openAskBouquet(session, bouquets, cnt)
+ else:
+ openSilent(servicelist, bouquets, cnt)
def Plugins(**kwargs):
name = _("Graphical Multi EPG")
diff --git a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
index 84cbbcb6..e26a93c6 100644
--- a/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
+++ b/lib/python/Plugins/SystemPlugins/Hotplug/plugin.py
@@ -50,12 +50,12 @@ IOC_TYPESHIFT = (IOC_NRSHIFT+IOC_NRBITS)
BLKRRPART = ((0x12<<IOC_TYPESHIFT) | (95<<IOC_NRSHIFT))
def autostart(reason, **kwargs):
+ global bdpoll
if reason == 0:
print "starting hotplug handler"
if fileExists('/dev/.udev'):
global netlink
- global bdpoll
from enigma import eSocketNotifier, eTimer, ePythonMessagePump
import socket
from select import POLLIN, POLLPRI
@@ -256,6 +256,8 @@ def autostart(reason, **kwargs):
self.__lock.release()
netlink = Netlink()
+ if bdpoll is not None:
+ bdpoll.running = False
bdpoll = BDPoll()
for blockdev, removable, is_cdrom, medium_found in harddiskmanager.devices_scanned_on_init:
if removable or is_cdrom:
@@ -295,6 +297,12 @@ def autostart(reason, **kwargs):
factory = Factory()
factory.protocol = Hotplug
reactor.listenUNIX("/tmp/hotplug.socket", factory)
+ else:
+ if bdpoll:
+ bdpoll.running = False
+ bdpoll.timeout() # XXX: I assume the timer is shut down before it executes again, so release the semaphore manually
+ bdpoll.join()
+ bdpoll = None
def Plugins(**kwargs):
return PluginDescriptor(name = "Hotplug", description = "listens to hotplug events", where = PluginDescriptor.WHERE_AUTOSTART, needsRestart = True, fnc = autostart)
diff --git a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
index bfe28b46..c7c143f2 100755
--- a/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
+++ b/lib/python/Plugins/SystemPlugins/SoftwareManager/BackupRestore.py
@@ -267,7 +267,7 @@ class RestoreMenu(Screen):
self.sel = self["filelist"].getCurrent()
if self.sel:
self.val = self.path + "/" + self.sel
- self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n" + self.sel ))
+ self.session.openWithCallback(self.startDelete, MessageBox, _("Are you sure you want to delete\nfollowing backup:\n") + self.sel)
def startDelete(self, ret = False):
if (ret == True):
diff --git a/lib/python/Screens/AudioSelection.py b/lib/python/Screens/AudioSelection.py
index 4c689620..a5e09c0b 100644
--- a/lib/python/Screens/AudioSelection.py
+++ b/lib/python/Screens/AudioSelection.py
@@ -1,6 +1,6 @@
from Screen import Screen
from Components.ServiceEventTracker import ServiceEventTracker
-from Components.ActionMap import ActionMap
+from Components.ActionMap import NumberActionMap
from Components.ConfigList import ConfigListScreen
from Components.ChoiceList import ChoiceList, ChoiceEntryComponent
from Components.config import config, ConfigSubsection, getConfigListEntry, ConfigNothing, ConfigSelection, ConfigOnOff
@@ -36,7 +36,7 @@ class AudioSelection(Screen, ConfigListScreen):
self.cached_subtitle_checked = False
self.__selected_subtitle = None
- self["actions"] = ActionMap(["ColorActions", "SetupActions", "DirectionActions"],
+ self["actions"] = NumberActionMap(["ColorActions", "SetupActions", "DirectionActions"],
{
"red": self.keyRed,
"green": self.keyGreen,
@@ -46,6 +46,15 @@ class AudioSelection(Screen, ConfigListScreen):
"cancel": self.cancel,
"up": self.keyUp,
"down": self.keyDown,
+ "1": self.keyNumberGlobal,
+ "2": self.keyNumberGlobal,
+ "3": self.keyNumberGlobal,
+ "4": self.keyNumberGlobal,
+ "5": self.keyNumberGlobal,
+ "6": self.keyNumberGlobal,
+ "7": self.keyNumberGlobal,
+ "8": self.keyNumberGlobal,
+ "9": self.keyNumberGlobal,
}, -2)
self.settings = ConfigSubsection()
@@ -87,7 +96,7 @@ class AudioSelection(Screen, ConfigListScreen):
self["key_green"].setBoolean(False)
selectedAudio = self.audioTracks.getCurrentTrack()
for x in range(n):
- number = str(x)
+ number = str(x + 1)
i = audio.getTrackInfo(x)
languages = i.getLanguage().split('/')
description = i.getDescription() or _("<unknown>")
@@ -289,11 +298,16 @@ class AudioSelection(Screen, ConfigListScreen):
elif self.focus == FOCUS_STREAMS:
self["streams"].selectNext()
+ def keyNumberGlobal(self, number):
+ if number <= len(self["streams"].list):
+ self["streams"].setIndex(number-1)
+ self.keyOk()
+
def keyOk(self):
if self.focus == FOCUS_STREAMS and self["streams"].list:
cur = self["streams"].getCurrent()
if self.settings.menupage.getValue() == PAGE_AUDIO and cur[0] is not None:
- self.changeAudio(cur[2])
+ self.changeAudio(cur[0])
self.__updatedInfo()
if self.settings.menupage.getValue() == PAGE_SUBTITLES and cur[0] is not None:
if self.infobar.selected_subtitle == cur[0]:
diff --git a/lib/python/Screens/ChannelSelection.py b/lib/python/Screens/ChannelSelection.py
index c07e3495..912d6784 100644
--- a/lib/python/Screens/ChannelSelection.py
+++ b/lib/python/Screens/ChannelSelection.py
@@ -65,6 +65,24 @@ class BouquetSelector(Screen):
def cancelClick(self):
self.close(False)
+class SilentBouquetSelector:
+ def __init__(self, bouquets, enableWrapAround=False, current=0):
+ self.bouquets = [b[1] for b in bouquets]
+ self.pos = current
+ self.count = len(bouquets)
+ self.enableWrapAround = enableWrapAround
+
+ def up(self):
+ if self.pos > 0 or self.enableWrapAround:
+ self.pos = (self.pos - 1) % self.count
+
+ def down(self):
+ if self.pos < (self.count - 1) or self.enableWrapAround:
+ self.pos = (self.pos + 1) % self.count
+
+ def getCurrent(self):
+ return self.bouquets[self.pos]
+
# csel.bouquet_mark_edit values
OFF = 0
EDIT_BOUQUET = 1
diff --git a/lib/python/Screens/InfoBarGenerics.py b/lib/python/Screens/InfoBarGenerics.py
index 2e97b59d..93a47886 100644
--- a/lib/python/Screens/InfoBarGenerics.py
+++ b/lib/python/Screens/InfoBarGenerics.py
@@ -1,4 +1,4 @@
-from ChannelSelection import ChannelSelection, BouquetSelector
+from ChannelSelection import ChannelSelection, BouquetSelector, SilentBouquetSelector
from Components.ActionMap import ActionMap, HelpableActionMap
from Components.ActionMap import NumberActionMap
@@ -559,6 +559,12 @@ class InfoBarEPG:
cnt = 0
else:
cnt = len(bouquets)
+ if config.usage.multiepg_ask_bouquet.value:
+ self.openMultiServiceEPGAskBouquet(bouquets, cnt, withCallback)
+ else:
+ self.openMultiServiceEPGSilent(bouquets, cnt, withCallback)
+
+ def openMultiServiceEPGAskBouquet(self, bouquets, cnt, withCallback):
if cnt > 1: # show bouquet list
if withCallback:
self.bouquetSel = self.session.openWithCallback(self.closed, BouquetSelector, bouquets, self.openBouquetEPG, enableWrapAround=True)
@@ -568,6 +574,21 @@ class InfoBarEPG:
elif cnt == 1:
self.openBouquetEPG(bouquets[0][1], withCallback)
+ def openMultiServiceEPGSilent(self, bouquets, cnt, withCallback):
+ root = self.servicelist.getRoot()
+ rootstr = root.toCompareString()
+ current = 0
+ for bouquet in bouquets:
+ if bouquet[1].toCompareString() == rootstr:
+ break
+ current += 1
+ if current >= cnt:
+ current = 0
+ if cnt > 1: # create bouquet list for bouq+/-
+ self.bouquetSel = SilentBouquetSelector(bouquets, True, self.servicelist.getBouquetNumOffset(root))
+ if cnt >= 1:
+ self.openBouquetEPG(root, withCallback)
+
def changeServiceCB(self, direction, epg):
if self.serviceSel:
if direction > 0:
diff --git a/lib/python/Screens/TaskView.py b/lib/python/Screens/TaskView.py
index 660fb276..6e1b752d 100644
--- a/lib/python/Screens/TaskView.py
+++ b/lib/python/Screens/TaskView.py
@@ -108,10 +108,10 @@ class JobView(InfoBarNotifications, Screen, ConfigListScreen):
self.close(False)
def abort(self):
- if self.job.status in (self.job.FINISHED, self.job.FAILED):
- self.close(False)
- if self["cancelable"].boolean == True:
+ if self.job.status == self.job.IN_PROGRESS and self["cancelable"].boolean == True:
self.job.cancel()
+ else:
+ self.close(False)
def performAfterEvent(self):
self["config"].hide()
diff --git a/lib/python/Screens/VirtualKeyBoard.py b/lib/python/Screens/VirtualKeyBoard.py
index 7846e4b8..a8695439 100755
--- a/lib/python/Screens/VirtualKeyBoard.py
+++ b/lib/python/Screens/VirtualKeyBoard.py
@@ -1,12 +1,13 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: UTF-8 -*-
+from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_CENTER, RT_VALIGN_CENTER, getPrevAsciiCode
+from Screen import Screen
from Components.Language import language
from Components.ActionMap import ActionMap
+from Components.Sources.StaticText import StaticText
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.MenuList import MenuList
from Components.MultiContent import MultiContentEntryText, MultiContentEntryPixmapAlphaTest
-from enigma import eListboxPythonMultiContent, gFont, RT_HALIGN_CENTER, RT_VALIGN_CENTER
-from Screen import Screen
from Tools.Directories import resolveFilename, SCOPE_CURRENT_SKIN
from Tools.LoadPixmap import LoadPixmap
@@ -86,52 +87,127 @@ class VirtualKeyBoard(Screen):
self.keys_list = []
self.shiftkeys_list = []
self.lang = language.getLanguage()
+ self.nextLang = None
+ self.shiftMode = False
+ self.text = text
+ self.selectedKey = 0
+
+ self["country"] = StaticText("")
+ self["header"] = Label(title)
+ self["text"] = Label(self.text)
+ self["list"] = VirtualKeyBoardList([])
+
+ self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions", "KeyboardInputActions", "InputBoxActions", "InputAsciiActions"],
+ {
+ "gotAsciiCode": self.keyGotAscii,
+ "ok": self.okClicked,
+ "cancel": self.exit,
+ "left": self.left,
+ "right": self.right,
+ "up": self.up,
+ "down": self.down,
+ "red": self.backClicked,
+ "green": self.ok,
+ "yellow": self.switchLang,
+ "deleteBackward": self.backClicked,
+ "back": self.exit
+ }, -2)
+ self.setLang()
+ self.onExecBegin.append(self.setKeyboardModeAscii)
+ self.onLayoutFinish.append(self.buildVirtualKeyBoard)
+
+ def switchLang(self):
+ self.lang = self.nextLang
+ self.setLang()
+ self.buildVirtualKeyBoard()
+
+ def setLang(self):
if self.lang == 'de_DE':
self.keys_list = [
[u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
- [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"", u"+"],
- [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"", u"", u"#"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"ü", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ö", u"ä", u"#"],
[u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
- [u"SHIFT", u"SPACE", u"@", u"", u"OK"]]
-
+ [u"SHIFT", u"SPACE", u"@", u"ß", u"OK"]]
self.shiftkeys_list = [
- [u"EXIT", u"!", u'"', u"", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
- [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"", u"*"],
- [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"", u"", u"'"],
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"Ü", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"Ö", u"Ä", u"'"],
[u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
[u"SHIFT", u"SPACE", u"?", u"\\", u"OK"]]
-
+ self.nextLang = 'es_ES'
elif self.lang == 'es_ES':
- #still missing keys (u"")
+ #still missing keys (u"ùÙ")
self.keys_list = [
[u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
- [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"", u"+"],
- [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"", u"", u"#"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"ú", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ó", u"á", u"#"],
[u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
- [u"SHIFT", u"SPACE", u"@", u"", u"", u"", u"", u"", u"", u"", u"", u"OK"]]
-
+ [u"SHIFT", u"SPACE", u"@", u"Ł", u"ŕ", u"é", u"č", u"í", u"ě", u"ń", u"ň", u"OK"]]
self.shiftkeys_list = [
- [u"EXIT", u"!", u'"', u"", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
- [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"", u"*"],
- [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"", u"", u"'"],
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"Ú", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"Ó", u"Á", u"'"],
[u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
- [u"SHIFT", u"SPACE", u"?", u"\\", u"", u"", u"", u"", u"", u"", u"", u"OK"]]
-
- elif self.lang in ('sv_SE', 'fi_FI'):
+ [u"SHIFT", u"SPACE", u"?", u"\\", u"Ŕ", u"É", u"Č", u"Í", u"Ě", u"Ń", u"Ň", u"OK"]]
+ self.nextLang = 'fi_FI'
+ elif self.lang == 'fi_FI':
self.keys_list = [
[u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
- [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"", u"+"],
- [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"", u"", u"#"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"é", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ö", u"ä", u"#"],
[u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
- [u"SHIFT", u"SPACE", u"@", u"", u"", u"OK"]]
-
+ [u"SHIFT", u"SPACE", u"@", u"ß", u"ĺ", u"OK"]]
self.shiftkeys_list = [
- [u"EXIT", u"!", u'"', u"", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
- [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"", u"*"],
- [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"", u"", u"'"],
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"É", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"Ö", u"Ä", u"'"],
[u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
-
- [u"SHIFT", u"SPACE", u"?", u"\\", u"", u"OK"]]
+ [u"SHIFT", u"SPACE", u"?", u"\\", u"Ĺ", u"OK"]]
+ self.nextLang = 'sv_SE'
+ elif self.lang == 'sv_SE':
+ self.keys_list = [
+ [u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"é", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ö", u"ä", u"#"],
+ [u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"@", u"ß", u"ĺ", u"OK"]]
+ self.shiftkeys_list = [
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"É", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"Ö", u"Ä", u"'"],
+ [u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"?", u"\\", u"Ĺ", u"OK"]]
+ self.nextLang = 'sk_SK'
+ elif self.lang =='sk_SK':
+ self.keys_list = [
+ [u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"ú", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ľ", u"@", u"#"],
+ [u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"š", u"č", u"ž", u"ý", u"á", u"í", u"é", u"OK"]]
+ self.shiftkeys_list = [
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"ť", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"ň", u"ď", u"'"],
+ [u"Á", u"É", u"Ď", u"Í", u"Ý", u"Ó", u"Ú", u"Ž", u"Š", u"Č", u"Ť", u"Ň"],
+ [u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"?", u"\\", u"ä", u"ö", u"ü", u"ô", u"ŕ", u"ĺ", u"OK"]]
+ self.nextLang = 'cs_CZ'
+ elif self.lang == 'cs_CZ':
+ self.keys_list = [
+ [u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
+ [u"q", u"w", u"e", u"r", u"t", u"z", u"u", u"i", u"o", u"p", u"ú", u"+"],
+ [u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"ů", u"@", u"#"],
+ [u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"ě", u"š", u"č", u"ř", u"ž", u"ý", u"á", u"í", u"é", u"OK"]]
+ self.shiftkeys_list = [
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"ť", u"*"],
+ [u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"ň", u"ď", u"'"],
+ [u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
+ [u"SHIFT", u"SPACE", u"?", u"\\", u"Č", u"Ř", u"Š", u"Ž", u"Ú", u"Á", u"É", u"OK"]]
+ self.nextLang = 'en_EN'
else:
self.keys_list = [
[u"EXIT", u"1", u"2", u"3", u"4", u"5", u"6", u"7", u"8", u"9", u"0", u"BACKSPACE"],
@@ -139,36 +215,15 @@ class VirtualKeyBoard(Screen):
[u"a", u"s", u"d", u"f", u"g", u"h", u"j", u"k", u"l", u"#", u"\\"],
[u"<", u"y", u"x", u"c", u"v", u"b", u"n", u"m", u",", ".", u"-", u"CLEAR"],
[u"SHIFT", u"SPACE", u"OK"]]
-
self.shiftkeys_list = [
- [u"EXIT", u"!", u'"', u"", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
+ [u"EXIT", u"!", u'"', u"§", u"$", u"%", u"&", u"/", u"(", u")", u"=", u"BACKSPACE"],
[u"Q", u"W", u"E", u"R", u"T", u"Z", u"U", u"I", u"O", u"P", u"*"],
[u"A", u"S", u"D", u"F", u"G", u"H", u"J", u"K", u"L", u"'", u"?"],
[u">", u"Y", u"X", u"C", u"V", u"B", u"N", u"M", u";", u":", u"_", u"CLEAR"],
[u"SHIFT", u"SPACE", u"OK"]]
-
- self.shiftMode = False
- self.text = text
- self.selectedKey = 0
-
- self["header"] = Label(title)
- self["text"] = Label(self.text)
- self["list"] = VirtualKeyBoardList([])
-
- self["actions"] = ActionMap(["OkCancelActions", "WizardActions", "ColorActions"],
- {
- "ok": self.okClicked,
- "cancel": self.exit,
- "left": self.left,
- "right": self.right,
- "up": self.up,
- "down": self.down,
- "red": self.backClicked,
- "green": self.ok
- }, -2)
-
- self.onLayoutFinish.append(self.buildVirtualKeyBoard)
-
+ self.lang = 'en_EN'
+ self.nextLang = 'de_DE'
+ self["country"].setText(self.lang)
self.max_key=47+len(self.keys_list[4])
def buildVirtualKeyBoard(self, selectedKey=0):
@@ -192,7 +247,6 @@ class VirtualKeyBoard(Screen):
selectedKey -= 12
self["list"].setList(list)
-
def backClicked(self):
self.text = self["text"].getText()[:-1]
@@ -219,7 +273,7 @@ class VirtualKeyBoard(Screen):
if text is None:
return
- text = text.encode("utf-8")
+ text = text.encode("UTF-8")
if text == "EXIT":
self.close(None)
@@ -312,3 +366,33 @@ class VirtualKeyBoard(Screen):
def showActiveKey(self):
self.buildVirtualKeyBoard(self.selectedKey)
+
+ def inShiftKeyList(self,key):
+ for KeyList in self.shiftkeys_list:
+ for char in KeyList:
+ if char == key:
+ return True
+ return False
+
+ def keyGotAscii(self):
+ char = str(unichr(getPrevAsciiCode()).encode('utf-8'))
+ if self.inShiftKeyList(char):
+ self.shiftMode = True
+ list = self.shiftkeys_list
+ else:
+ self.shiftMode = False
+ list = self.keys_list
+
+ if char == " ":
+ char = "SPACE"
+
+ selkey = 0
+ for keylist in list:
+ for key in keylist:
+ if key == char:
+ self.selectedKey = selkey
+ self.okClicked()
+ self.showActiveKey()
+ return
+ else:
+ selkey += 1
diff --git a/lib/python/Tools/NumericalTextInput.py b/lib/python/Tools/NumericalTextInput.py
index 63a58ea4..252e174e 100644
--- a/lib/python/Tools/NumericalTextInput.py
+++ b/lib/python/Tools/NumericalTextInput.py
@@ -1,4 +1,4 @@
-# -*- coding: utf-8 -*-
+# -*- coding: UTF-8 -*-
from enigma import eTimer
from Components.Language import language
@@ -63,6 +63,17 @@ class NumericalTextInput:
self.mapping.append (u"pqrs7PQRS") # 7
self.mapping.append (u"tuv8TUV") # 8
self.mapping.append (u"wxyz9WXYZ") # 9
+ elif self.lang in ('cs_CZ', 'sk_SK'):
+ self.mapping.append (u"0,?'+\"()@$!=&*") # 0
+ self.mapping.append (u" 1.:/-_") # 1
+ self.mapping.append (u"abc2áäčABCÁÄČ") # 2
+ self.mapping.append (u"def3ďéěDEFĎÉĚ") # 3
+ self.mapping.append (u"ghi4íGHIÍ") # 4
+ self.mapping.append (u"jkl5ľĺJKLĽĹ") # 5
+ self.mapping.append (u"mno6ňóöôMNOŇÓÖÔ") # 6
+ self.mapping.append (u"pqrs7řŕšPQRSŘŔŠ") # 7
+ self.mapping.append (u"tuv8ťúůüTUVŤÚŮÜ") # 8
+ self.mapping.append (u"wxyz9ýžWXYZÝŽ") # 9
else:
self.mapping.append (u"0,?!&@=*'+\"()$~") # 0
self.mapping.append (u" 1.:/-_") # 1
@@ -76,7 +87,8 @@ class NumericalTextInput:
self.mapping.append (u"wxyz9WXYZ") # 9
def setUseableChars(self, useable):
- self.useableChars = useable
+ self.useableChars = unicode(useable)
+
def getKey(self, num):
cnt=0