mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 23:42:58 +02:00
CMenuWidget: add action keys
Conflicts: src/gui/widget/menue.h
This commit is contained in:
@@ -519,6 +519,25 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
if ( msg <= CRCInput::RC_MaxRC ) {
|
if ( msg <= CRCInput::RC_MaxRC ) {
|
||||||
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_MENU] == 0 ? 0xFFFF : g_settings.timing[SNeutrinoSettings::TIMING_MENU]);
|
||||||
|
|
||||||
|
std::map<neutrino_msg_t, keyAction>::iterator it = keyActionMap.find(msg);
|
||||||
|
if (it != keyActionMap.end()) {
|
||||||
|
int rv = it->second.menue->exec(parent, it->second.action);
|
||||||
|
switch ( rv ) {
|
||||||
|
case menu_return::RETURN_EXIT_ALL:
|
||||||
|
retval = menu_return::RETURN_EXIT_ALL;
|
||||||
|
case menu_return::RETURN_EXIT:
|
||||||
|
msg = CRCInput::RC_timeout;
|
||||||
|
break;
|
||||||
|
case menu_return::RETURN_REPAINT:
|
||||||
|
case menu_return::RETURN_EXIT_REPAINT:
|
||||||
|
if (fade && washidden)
|
||||||
|
fader.StartFadeIn();
|
||||||
|
checkHints();
|
||||||
|
paint();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
for (unsigned int i= 0; i< items.size(); i++) {
|
for (unsigned int i= 0; i< items.size(); i++) {
|
||||||
CMenuItem* titem = items[i];
|
CMenuItem* titem = items[i];
|
||||||
if ((titem->directKey != CRCInput::RC_nokey) && (titem->directKey == msg)) {
|
if ((titem->directKey != CRCInput::RC_nokey) && (titem->directKey == msg)) {
|
||||||
@@ -534,10 +553,10 @@ int CMenuWidget::exec(CMenuTarget* parent, const std::string &)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef MARTII
|
#ifdef MARTII
|
||||||
if (msg == (uint32_t) g_settings.key_channelList_pageup)
|
if (msg == (uint32_t) g_settings.key_channelList_pageup)
|
||||||
msg = CRCInput::RC_page_up;
|
msg = CRCInput::RC_page_up;
|
||||||
else if (msg == (uint32_t) g_settings.key_channelList_pagedown)
|
else if (msg == (uint32_t) g_settings.key_channelList_pagedown)
|
||||||
msg = CRCInput::RC_page_down;
|
msg = CRCInput::RC_page_down;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1147,6 +1166,12 @@ void CMenuWidget::paintHint(int pos)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CMenuWidget::addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string & action)
|
||||||
|
{
|
||||||
|
keyActionMap[key].menue = menue;
|
||||||
|
keyActionMap[key].action = action;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------------------------------------
|
||||||
CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ, const int print_offset, const int special_value, const neutrino_locale_t special_value_name, const char * non_localized_name, bool sliderOn)
|
CMenuOptionNumberChooser::CMenuOptionNumberChooser(const neutrino_locale_t name, int * const OptionValue, const bool Active, const int min_value, const int max_value, CChangeObserver * const Observ, const int print_offset, const int special_value, const neutrino_locale_t special_value_name, const char * non_localized_name, bool sliderOn)
|
||||||
{
|
{
|
||||||
|
@@ -435,6 +435,8 @@ class CMenuWidget : public CMenuTarget
|
|||||||
CFrameBuffer *frameBuffer;
|
CFrameBuffer *frameBuffer;
|
||||||
std::vector<CMenuItem*> items;
|
std::vector<CMenuItem*> items;
|
||||||
std::vector<int> page_start;
|
std::vector<int> page_start;
|
||||||
|
struct keyAction { std::string action; CMenuTarget *menue; };
|
||||||
|
std::map<neutrino_msg_t, keyAction> keyActionMap;
|
||||||
std::string iconfile;
|
std::string iconfile;
|
||||||
|
|
||||||
int min_width;
|
int min_width;
|
||||||
@@ -514,6 +516,7 @@ class CMenuWidget : public CMenuTarget
|
|||||||
MENU_POS_BOTTOM_LEFT ,
|
MENU_POS_BOTTOM_LEFT ,
|
||||||
MENU_POS_BOTTOM_RIGHT
|
MENU_POS_BOTTOM_RIGHT
|
||||||
};
|
};
|
||||||
|
void addKey(neutrino_msg_t key, CMenuTarget *menue, const std::string &action);
|
||||||
};
|
};
|
||||||
|
|
||||||
class CPINProtection
|
class CPINProtection
|
||||||
|
Reference in New Issue
Block a user