mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 09:21:09 +02:00
usermenu: formatting code using astyle; some manual code nicenings
Origin commit data
------------------
Branch: ni/coolstream
Commit: fc170d0cf2
Author: vanhofen <vanhofen@gmx.de>
Date: 2021-12-04 (Sat, 04 Dec 2021)
Origin message was:
------------------
- usermenu: formatting code using astyle; some manual code nicenings
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -10,9 +10,9 @@
|
|||||||
Copyright (C) 2011 T. Graf 'dbt'
|
Copyright (C) 2011 T. Graf 'dbt'
|
||||||
Homepage: http://www.dbox2-tuning.net/
|
Homepage: http://www.dbox2-tuning.net/
|
||||||
|
|
||||||
License: GPL
|
License: GPL
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public
|
modify it under the terms of the GNU General Public
|
||||||
License as published by the Free Software Foundation; either
|
License as published by the Free Software Foundation; either
|
||||||
version 2 of the License, or (at your option) any later version.
|
version 2 of the License, or (at your option) any later version.
|
||||||
@@ -49,8 +49,8 @@ typedef struct user_menu_data_t
|
|||||||
{
|
{
|
||||||
neutrino_locale_t caption;
|
neutrino_locale_t caption;
|
||||||
const neutrino_msg_t key_helper_msg_def;
|
const neutrino_msg_t key_helper_msg_def;
|
||||||
const char * key_helper_icon_def;
|
const char *key_helper_icon_def;
|
||||||
const char * menu_icon_def;
|
const char *menu_icon_def;
|
||||||
int selected;
|
int selected;
|
||||||
} user_menu_data_struct;
|
} user_menu_data_struct;
|
||||||
|
|
||||||
@@ -58,13 +58,13 @@ typedef struct user_menu_data_t
|
|||||||
static user_menu_data_t user_menu[COL_BUTTONMAX] =
|
static user_menu_data_t user_menu[COL_BUTTONMAX] =
|
||||||
{
|
{
|
||||||
{LOCALE_USERMENU_TITLE_RED , CRCInput::RC_red , NEUTRINO_ICON_BUTTON_RED , NEUTRINO_ICON_RED, -1},
|
{LOCALE_USERMENU_TITLE_RED , CRCInput::RC_red , NEUTRINO_ICON_BUTTON_RED , NEUTRINO_ICON_RED, -1},
|
||||||
{LOCALE_USERMENU_TITLE_GREEN , CRCInput::RC_green , NEUTRINO_ICON_BUTTON_GREEN , NEUTRINO_ICON_GREEN, -1},
|
{LOCALE_USERMENU_TITLE_GREEN , CRCInput::RC_green , NEUTRINO_ICON_BUTTON_GREEN , NEUTRINO_ICON_GREEN, -1},
|
||||||
{NONEXISTANT_LOCALE , CRCInput::RC_yellow , NEUTRINO_ICON_BUTTON_YELLOW , NEUTRINO_ICON_YELLOW, -1},
|
{NONEXISTANT_LOCALE , CRCInput::RC_yellow , NEUTRINO_ICON_BUTTON_YELLOW , NEUTRINO_ICON_YELLOW, -1},
|
||||||
{LOCALE_USERMENU_TITLE_BLUE , CRCInput::RC_blue , NEUTRINO_ICON_BUTTON_BLUE , NEUTRINO_ICON_BLUE, -1}
|
{LOCALE_USERMENU_TITLE_BLUE , CRCInput::RC_blue , NEUTRINO_ICON_BUTTON_BLUE , NEUTRINO_ICON_BLUE, -1}
|
||||||
};
|
};
|
||||||
|
|
||||||
// const neutrino_msg_t col_key_helper_msg_def[COL_BUTTONMAX]={CRCInput::RC_red,CRCInput::RC_green,CRCInput::RC_yellow,CRCInput::RC_blue};
|
// const neutrino_msg_t col_key_helper_msg_def[COL_BUTTONMAX]={ CRCInput::RC_red, CRCInput::RC_green, CRCInput::RC_yellow, CRCInput::RC_blue };
|
||||||
// const char * col_key_helper_icon_def[COL_BUTTONMAX]={NEUTRINO_ICON_BUTTON_RED,NEUTRINO_ICON_BUTTON_GREEN,NEUTRINO_ICON_BUTTON_YELLOW,NEUTRINO_ICON_BUTTON_BLUE};
|
// const char *col_key_helper_icon_def[COL_BUTTONMAX]={ NEUTRINO_ICON_BUTTON_RED, NEUTRINO_ICON_BUTTON_GREEN, NEUTRINO_ICON_BUTTON_YELLOW, NEUTRINO_ICON_BUTTON_BLUE };
|
||||||
|
|
||||||
class CUserMenu : public CChangeObserver
|
class CUserMenu : public CChangeObserver
|
||||||
{
|
{
|
||||||
@@ -80,7 +80,6 @@ class CUserMenu : public CChangeObserver
|
|||||||
static const char *getUserMenuButtonName(int button, bool &active, bool return_title = false);
|
static const char *getUserMenuButtonName(int button, bool &active, bool return_title = false);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// This is just a quick helper for the usermenu and pluginlist.
|
// This is just a quick helper for the usermenu and pluginlist.
|
||||||
class CColorKeyHelper
|
class CColorKeyHelper
|
||||||
{
|
{
|
||||||
@@ -96,16 +95,18 @@ class CColorKeyHelper
|
|||||||
void reset(void)
|
void reset(void)
|
||||||
{
|
{
|
||||||
number_key = 1;
|
number_key = 1;
|
||||||
for (int i= 0; i < COL_BUTTONMAX; i++ )
|
for (int i = 0; i < COL_BUTTONMAX; i++)
|
||||||
color_key_used[i] = false;
|
color_key_used[i] = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Returns the next available button, to be used in menu as 'direct' keys. Appropriate
|
/*
|
||||||
|
* Returns the next available button, to be used in menu as 'direct' keys. Appropriate
|
||||||
* definitions are returnd in msp and icon
|
* definitions are returnd in msp and icon
|
||||||
* A color button could be requested as prefered button (other buttons are not supported yet).
|
* A color button could be requested as prefered button (other buttons are not supported yet).
|
||||||
* If the appropriate button is already in used, the next number_key button is returned instead
|
* If the appropriate button is already in used, the next number_key button is returned instead
|
||||||
* (first 1-9 and than 0). */
|
* (first 1-9 and than 0).
|
||||||
bool get(neutrino_msg_t* msg, const char** icon, neutrino_msg_t prefered_key = CRCInput::RC_nokey)
|
*/
|
||||||
|
bool get(neutrino_msg_t *msg, const char **icon, neutrino_msg_t prefered_key = CRCInput::RC_nokey)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
int button = -1;
|
int button = -1;
|
||||||
@@ -121,8 +122,9 @@ class CColorKeyHelper
|
|||||||
*msg = CRCInput::RC_nokey;
|
*msg = CRCInput::RC_nokey;
|
||||||
*icon = "";
|
*icon = "";
|
||||||
if (button >= 0 && button < COL_BUTTONMAX)
|
if (button >= 0 && button < COL_BUTTONMAX)
|
||||||
{ // try to get color button
|
{
|
||||||
if ( color_key_used[button] == false)
|
// try to get color button
|
||||||
|
if (color_key_used[button] == false)
|
||||||
{
|
{
|
||||||
color_key_used[button] = true;
|
color_key_used[button] = true;
|
||||||
*msg = user_menu[button].key_helper_msg_def;
|
*msg = user_menu[button].key_helper_msg_def;
|
||||||
@@ -131,7 +133,7 @@ class CColorKeyHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( result == false && number_key < 10) // no key defined yet, at least try to get a numbered key
|
if (result == false && number_key < 10) // no key defined yet, at least try to get a numbered key
|
||||||
{
|
{
|
||||||
// there is still a available number_key
|
// there is still a available number_key
|
||||||
*msg = CRCInput::convertDigitToKey(number_key);
|
*msg = CRCInput::convertDigitToKey(number_key);
|
||||||
|
Reference in New Issue
Block a user