diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index a61993a21..eec36ad5f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -209,6 +209,9 @@ channellist.foot Kanalinformationen channellist.foot_freq Tuning-Parameter channellist.foot_next Nachfolgesendung channellist.foot_off aus +channellist.foot_sort_alpha Sortiert[alpha] +channellist.foot_sort_freq Sortiert[freq] +channellist.foot_sort_sat Sortiert[sat] channellist.head Alle Kanäle channellist.history Verlauf channellist.make_hdlist Erzeuge Bouquet mit HD-Kanälen diff --git a/data/locale/english.locale b/data/locale/english.locale index 59c239e8f..5b3e5a713 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -209,6 +209,9 @@ channellist.foot Channel Information channellist.foot_freq Sat/Freq Info channellist.foot_next next Event channellist.foot_off off +channellist.foot_sort_alpha sorted[alpha] +channellist.foot_sort_freq sorted[freq] +channellist.foot_sort_sat sorted[sat] channellist.head All Services channellist.history History channellist.make_hdlist Create list of HD channels diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 689f15d33..7241799b4 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -798,6 +798,19 @@ int CChannelList::show() paintHead(); // update button bar showChannelLogo(); } + else if ( msg == CRCInput::RC_green ) + { + int mode = CNeutrinoApp::getInstance()->GetChannelMode(); + if(mode){ + g_settings.channellist_sort_mode++; + if(g_settings.channellist_sort_mode > 2) + g_settings.channellist_sort_mode = 0; + CNeutrinoApp::getInstance()->SetChannelMode(mode); + paint(); + paintHead(); // update button bar + } + } + else if ((msg == CRCInput::RC_info) || (msg == CRCInput::RC_help)) { hide(); CChannelEvent *p_event=NULL; @@ -1604,36 +1617,78 @@ struct button_label SChannelListButtons[NUM_LIST_BUTTONS] = { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} }; +#define NUM_LIST_BUTTONS_SORT 5 +struct button_label SChannelListButtons_SMode[NUM_LIST_BUTTONS_SORT] = +{ + { NEUTRINO_ICON_BUTTON_RED, LOCALE_INFOVIEWER_EVENTLIST}, + { NEUTRINO_ICON_BUTTON_GREEN, LOCALE_CHANNELLIST_FOOT_SORT_ALPHA}, + { NEUTRINO_ICON_BUTTON_YELLOW, LOCALE_BOUQUETLIST_HEAD}, + { NEUTRINO_ICON_BUTTON_BLUE, LOCALE_INFOVIEWER_NEXT}, + { NEUTRINO_ICON_BUTTON_RECORD_INACTIVE, NONEXISTANT_LOCALE} +}; void CChannelList::paintButtonBar(bool is_current) { //printf("[neutrino channellist] %s...%d, selected %d\n", __FUNCTION__, __LINE__, selected); - + unsigned int smode = CNeutrinoApp::getInstance()->GetChannelMode(); + int num_buttons = smode ? NUM_LIST_BUTTONS_SORT : NUM_LIST_BUTTONS; + + struct button_label Button[num_buttons]; + const neutrino_locale_t button_ids[] = {LOCALE_INFOVIEWER_NOW,LOCALE_INFOVIEWER_NEXT,LOCALE_MAINMENU_RECORDING,LOCALE_MAINMENU_RECORDING_STOP,NONEXISTANT_LOCALE, + LOCALE_CHANNELLIST_FOOT_SORT_ALPHA,LOCALE_CHANNELLIST_FOOT_SORT_FREQ,LOCALE_CHANNELLIST_FOOT_SORT_SAT}; + const std::vector buttonID_rest (button_ids, button_ids + sizeof(button_ids) / sizeof(neutrino_locale_t) ); + + for (int i = 0;iRecordingStatus(getActiveChannel_ChannelID()); if (g_settings.recording_type != RECORDING_OFF && !displayNext){ if (is_current && !do_record){ - SChannelListButtons[3].locale = LOCALE_MAINMENU_RECORDING; - SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE; + Button[Bindex].locale = LOCALE_MAINMENU_RECORDING; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_ACTIVE; }else if (do_record){ - SChannelListButtons[3].locale = LOCALE_MAINMENU_RECORDING_STOP; - SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_STOP; + Button[Bindex].locale = LOCALE_MAINMENU_RECORDING_STOP; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_STOP; }else{ - SChannelListButtons[3].locale = NONEXISTANT_LOCALE; - SChannelListButtons[3].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE; + Button[Bindex].locale = NONEXISTANT_LOCALE; + Button[Bindex].button = NEUTRINO_ICON_BUTTON_RECORD_INACTIVE; } } - + if(smode) + { + switch (g_settings.channellist_sort_mode) + { + case 0: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_ALPHA; + break; + case 1: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_FREQ; + break; + case 2: + Button[1].locale = LOCALE_CHANNELLIST_FOOT_SORT_SAT; + break; + } + } + //paint buttons int y_foot = y + (height - footerHeight); - ::paintButtons(x, y_foot, width, NUM_LIST_BUTTONS, SChannelListButtons, footerHeight/*, (width - 20) / NUM_LIST_BUTTONS*/); //buttonwidth will set automaticly + ::paintButtons(x, y_foot, width,num_buttons, Button, footerHeight,0,false,COL_INFOBAR_SHADOW,NULL,0,true, buttonID_rest); } void CChannelList::paintItem(int pos) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index bcadaa14b..b8da51879 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -611,6 +611,7 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.channellist_extended = configfile.getBool("channellist_extended" , true); g_settings.channellist_foot = configfile.getInt32("channellist_foot" , 1);//default next Event g_settings.channellist_new_zap_mode = configfile.getInt32("channellist_new_zap_mode", 1); + g_settings.channellist_sort_mode = configfile.getInt32("channellist_sort_mode", 0);//sort mode: alpha, freq, sat //screen configuration g_settings.screen_xres = configfile.getInt32("screen_xres", 100); @@ -1028,6 +1029,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("channellist_new_zap_mode", g_settings.channellist_new_zap_mode); configfile.setInt32("remote_control_hardware", g_settings.remote_control_hardware); configfile.setBool ( "audiochannel_up_down_enable", g_settings.audiochannel_up_down_enable ); + configfile.setInt32("channellist_sort_mode", g_settings.channellist_sort_mode); //screen configuration configfile.setInt32( "screen_xres", g_settings.screen_xres); @@ -1459,6 +1461,16 @@ printf("CNeutrinoApp::SetChannelMode %d\n", newmode); } break; } + if( newmode != LIST_MODE_FAV && g_settings.channellist_sort_mode < 3){ + for (uint32_t i = 0; i < bouquetList->Bouquets.size(); i++) { + if(g_settings.channellist_sort_mode == 0) + bouquetList->Bouquets[i]->channelList->SortAlpha(); + if(g_settings.channellist_sort_mode == 1) + bouquetList->Bouquets[i]->channelList->SortTP(); + if(g_settings.channellist_sort_mode == 2) + bouquetList->Bouquets[i]->channelList->SortSat(); + } + } lastChannelMode = newmode; } diff --git a/src/system/locals.h b/src/system/locals.h index 91c53c24c..578827bb3 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -236,6 +236,9 @@ typedef enum LOCALE_CHANNELLIST_FOOT_FREQ, LOCALE_CHANNELLIST_FOOT_NEXT, LOCALE_CHANNELLIST_FOOT_OFF, + LOCALE_CHANNELLIST_FOOT_SORT_ALPHA, + LOCALE_CHANNELLIST_FOOT_SORT_FREQ, + LOCALE_CHANNELLIST_FOOT_SORT_SAT, LOCALE_CHANNELLIST_HEAD, LOCALE_CHANNELLIST_HISTORY, LOCALE_CHANNELLIST_MAKE_HDLIST, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index b19ee79e0..a96b8315e 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -236,6 +236,9 @@ const char * locale_real_names[] = "channellist.foot_freq", "channellist.foot_next", "channellist.foot_off", + "channellist.foot_sort_alpha", + "channellist.foot_sort_freq", + "channellist.foot_sort_sat", "channellist.head", "channellist.history", "channellist.make_hdlist", diff --git a/src/system/settings.h b/src/system/settings.h index 63c2933e4..2fc7739d0 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -410,7 +410,7 @@ struct SNeutrinoSettings int channellist_extended; int channellist_foot; int channellist_new_zap_mode; - + int channellist_sort_mode; char repeat_blocker[4]; char repeat_genericblocker[4]; int remote_control_hardware;