mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 07:51:11 +02:00
CComponentsButton: simplify assignment of button message values
Count of alternate message values was limited to 1 value. Now it is
possible to add any count of message values.
directKey and directKeyAlt were removed from struct type 'button_label_cc'
and directKeys was added as container for possible message values.
Some methods of CComponentsFooter had to be adapted for that.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 4eb6a315fc
Author: Thilo Graf <dbt@novatux.de>
Date: 2017-03-20 (Mon, 20 Mar 2017)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -134,8 +134,8 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbOk){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_OKAY;
|
||||
btn.text = BTN_TEXT(mbOk);
|
||||
btn.directKey = CRCInput::RC_ok;
|
||||
btn.directKeyAlt = btn.directKey;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||
btn.btn_result = mbrOk;
|
||||
btn.btn_alias = mbOk;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -143,8 +143,9 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbNo){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
||||
btn.text = BTN_TEXT(mbNo);
|
||||
btn.directKey = CRCInput::RC_red;
|
||||
btn.directKeyAlt = CRCInput::RC_home;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_red);
|
||||
btn.directKeys.push_back(CRCInput::RC_home);
|
||||
btn.btn_result = mbrNo;
|
||||
btn.btn_alias = mbNo;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -152,8 +153,9 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbYes){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
||||
btn.text = BTN_TEXT(mbYes);
|
||||
btn.directKey = CRCInput::RC_green;
|
||||
btn.directKeyAlt = CRCInput::RC_ok;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_green);
|
||||
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||
btn.btn_result = mbrYes;
|
||||
btn.btn_alias = mbYes;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -161,8 +163,9 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbCancel){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
||||
btn.text = BTN_TEXT(mbCancel);
|
||||
btn.directKey = CRCInput::RC_home;
|
||||
btn.directKeyAlt = CRCInput::RC_setup;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_home);
|
||||
btn.directKeys.push_back(CRCInput::RC_setup);
|
||||
btn.btn_result = mbrCancel;
|
||||
btn.btn_alias = mbCancel;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -170,8 +173,8 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbBack){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_HOME;
|
||||
btn.text = BTN_TEXT(mbBack);
|
||||
btn.directKey = CRCInput::RC_home;
|
||||
btn.directKeyAlt = btn.directKey;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_home);
|
||||
btn.btn_result = mbrBack;
|
||||
btn.btn_alias = mbBack;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -179,15 +182,18 @@ void CMsgBox::initButtons()
|
||||
if (mb_show_button & mbNoYes){
|
||||
btn.button = NEUTRINO_ICON_BUTTON_RED;
|
||||
btn.text = BTN_TEXT(mbYes);
|
||||
btn.directKey = CRCInput::RC_red;
|
||||
btn.directKeyAlt = CRCInput::RC_ok;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_red);
|
||||
btn.directKeys.push_back(CRCInput::RC_ok);
|
||||
btn.btn_result = mbrYes;
|
||||
btn.btn_alias = mbYes;
|
||||
v_buttons.push_back(btn);
|
||||
|
||||
btn.button = NEUTRINO_ICON_BUTTON_GREEN;
|
||||
btn.text = BTN_TEXT(mbNo);
|
||||
btn.directKey = CRCInput::RC_green;
|
||||
btn.directKeyAlt = CRCInput::RC_home;
|
||||
btn.directKeys.clear();
|
||||
btn.directKeys.push_back(CRCInput::RC_green);
|
||||
btn.directKeys.push_back(CRCInput::RC_home);
|
||||
btn.btn_result = mbrNo;
|
||||
btn.btn_alias = mbNo;
|
||||
v_buttons.push_back(btn);
|
||||
@@ -299,7 +305,7 @@ int CMsgBox::exec()
|
||||
//***action buttons without preselection***
|
||||
for (size_t i = 0; i< ccw_footer->getButtonChainObject()->size(); i++){
|
||||
CComponentsButton* btn_action = static_cast<CComponentsButton*>(ccw_footer->getButtonChainObject()->getCCItem(i));
|
||||
if (msg == btn_action->getButtonDirectKey() || msg == btn_action->getButtonDirectKeyA()){
|
||||
if (btn_action->hasButtonDirectKey(msg)){
|
||||
result = (msg_result_t)btn_action->getButtonResult();
|
||||
dprintf(DEBUG_INFO, "\033[32m[CMsgBox] [%s - %d] result = %d, mb_show_button = %d\033[0m\n", __func__, __LINE__, result, mb_show_button);
|
||||
loop = false;
|
||||
|
Reference in New Issue
Block a user