diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 7c3c4f06a..a741e1a04 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -167,7 +167,7 @@ audioplayer.receiving_list Liste wird empfangen, bitte warten... audioplayer.repeat_on Repeatmodus aktivieren audioplayer.rewind schneller Rückl. audioplayer.save_playlist Playlist speichern -audioplayer.screensaver_timeout Bildschirmschoner (min, 0=aus) +audioplayer.screensaver_timeout Bildschirmschoner audioplayer.select_title_by_name Titelsuche nach Name (SMS) audioplayer.show_playlist Playlist anzeigen audioplayer.shuffle Zufällig diff --git a/data/locale/english.locale b/data/locale/english.locale index c5bd4432b..dd5a213d1 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -167,7 +167,7 @@ audioplayer.receiving_list Receiving list, please wait audioplayer.repeat_on enable repeat mode audioplayer.rewind rewind audioplayer.save_playlist save play list -audioplayer.screensaver_timeout screensaver timeout (min, 0=off) +audioplayer.screensaver_timeout screensaver timeout audioplayer.select_title_by_name search title by name (SMS) audioplayer.show_playlist Show Playlist audioplayer.shuffle shuffle diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index ac0ca1828..4a8a2107c 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -375,7 +375,7 @@ int CAudioPlayerGui::show() if ( msg == CRCInput::RC_timeout || msg == NeutrinoMessages::EVT_TIMER) { int timeout = time(NULL) - m_idletime; - int screensaver_timeout = atoi(g_settings.audioplayer_screensaver); + int screensaver_timeout = g_settings.audioplayer_screensaver; if (screensaver_timeout !=0 && timeout > screensaver_timeout*60 && !m_screensaver) screensaver(true); diff --git a/src/gui/audioplayer_setup.cpp b/src/gui/audioplayer_setup.cpp index 1d952128a..d7b4a4cc7 100644 --- a/src/gui/audioplayer_setup.cpp +++ b/src/gui/audioplayer_setup.cpp @@ -125,10 +125,10 @@ int CAudioPlayerSetup::showAudioPlayerSetup() mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_PLAYLIST); audioplayerSetup->addItem(mc); - CStringInput audio_screensaver(LOCALE_AUDIOPLAYER_SCREENSAVER_TIMEOUT, g_settings.audioplayer_screensaver, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 "); - mf = new CMenuForwarder(LOCALE_AUDIOPLAYER_SCREENSAVER_TIMEOUT, true, g_settings.audioplayer_screensaver, &audio_screensaver); - mf->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SCREENSAVER); - audioplayerSetup->addItem(mf); + CMenuOptionNumberChooser *cc = new CMenuOptionNumberChooser(LOCALE_AUDIOPLAYER_SCREENSAVER_TIMEOUT, &g_settings.audioplayer_screensaver, true, 0, 999, NULL, 0, 0, LOCALE_OPTIONS_OFF); + cc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE)); + cc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_SCREENSAVER); + audioplayerSetup->addItem(cc); mc = new CMenuOptionChooser(LOCALE_AUDIOPLAYER_HIGHPRIO, &g_settings.audioplayer_highprio, MESSAGEBOX_NO_YES_OPTIONS, MESSAGEBOX_NO_YES_OPTION_COUNT, true ); mc->setHint("", LOCALE_MENU_HINT_AUDIOPLAYER_HIGHPRIO); diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index fcf8292ef..eb6fbec6a 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -274,7 +274,7 @@ int CPictureViewerGui::show() timeout=50; // egal else { - timeout=(m_time+atoi(g_settings.picviewer_slide_time)-(long)time(NULL))*10; + timeout=(m_time+g_settings.picviewer_slide_time-(long)time(NULL))*10; if (timeout <0 ) timeout=1; } diff --git a/src/gui/pictureviewer_setup.cpp b/src/gui/pictureviewer_setup.cpp index 6dd9be459..cf135f5eb 100644 --- a/src/gui/pictureviewer_setup.cpp +++ b/src/gui/pictureviewer_setup.cpp @@ -105,12 +105,12 @@ int CPictureViewerSetup::showPictureViewerSetup() mc->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SCALING); picviewsetup->addItem(mc); - CStringInput pic_timeout(LOCALE_PICTUREVIEWER_SLIDE_TIME, g_settings.picviewer_slide_time, 2, NONEXISTANT_LOCALE, NONEXISTANT_LOCALE, "0123456789 "); - CMenuForwarder * mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_SLIDE_TIME, true, g_settings.picviewer_slide_time, &pic_timeout); - mf->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SLIDE_TIME); - picviewsetup->addItem(mf); + CMenuOptionNumberChooser *cc = new CMenuOptionNumberChooser(LOCALE_PICTUREVIEWER_SLIDE_TIME, &g_settings.picviewer_slide_time, true, 0, 999); + cc->setNumberFormat(std::string("%d ") + g_Locale->getText(LOCALE_UNIT_SHORT_SECOND)); + cc->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_SLIDE_TIME); + picviewsetup->addItem(cc); - mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_DEFDIR, true, g_settings.network_nfs_picturedir, this, "picturedir"); + CMenuForwarder *mf = new CMenuForwarder(LOCALE_PICTUREVIEWER_DEFDIR, true, g_settings.network_nfs_picturedir, this, "picturedir"); mf->setHint("", LOCALE_MENU_HINT_PICTUREVIEWER_DEFDIR); picviewsetup->addItem(mf); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index f5ea2e49d..d9bd7947b 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -598,7 +598,7 @@ void CUpnpBrowserGui::playnext(void) } else if (mime.substr(0,6) == "image/") { if (m_folderplay) - timeout = time(NULL) + atoi(g_settings.picviewer_slide_time); + timeout = time(NULL) + g_settings.picviewer_slide_time; showPicture((*entries)[0].resources[preferred].url); } return; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index f74ac2e2e..26353cf3d 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -711,14 +711,14 @@ int CNeutrinoApp::loadSetup(const char * fname) g_settings.lcd_info_line = configfile.getInt32("lcd_info_line", 0);//channel name or clock //Picture-Viewer - strcpy( g_settings.picviewer_slide_time, configfile.getString( "picviewer_slide_time", "10" ).c_str() ); + g_settings.picviewer_slide_time = configfile.getInt32( "picviewer_slide_time", 10); g_settings.picviewer_scaling = configfile.getInt32("picviewer_scaling", 1 /*(int)CPictureViewer::SIMPLE*/); g_settings.picviewer_decode_server_ip = configfile.getString("picviewer_decode_server_ip", ""); //Audio-Player g_settings.audioplayer_display = configfile.getInt32("audioplayer_display",(int)CAudioPlayerGui::ARTIST_TITLE); g_settings.audioplayer_follow = configfile.getInt32("audioplayer_follow",0); - strcpy( g_settings.audioplayer_screensaver, configfile.getString( "audioplayer_screensaver", "1" ).c_str() ); + g_settings.audioplayer_screensaver = configfile.getInt32("audioplayer_screensaver", 1); g_settings.audioplayer_highprio = configfile.getInt32("audioplayer_highprio",0); g_settings.audioplayer_select_title_by_name = configfile.getInt32("audioplayer_select_title_by_name",0); g_settings.audioplayer_repeat_on = configfile.getInt32("audioplayer_repeat_on",0); @@ -1169,7 +1169,7 @@ void CNeutrinoApp::saveSetup(const char * fname) configfile.setInt32("lcd_info_line", g_settings.lcd_info_line);//channel name or clock //Picture-Viewer - configfile.setString( "picviewer_slide_time", g_settings.picviewer_slide_time ); + configfile.setInt32( "picviewer_slide_time", g_settings.picviewer_slide_time); configfile.setInt32( "picviewer_scaling", g_settings.picviewer_scaling ); configfile.setString( "picviewer_decode_server_ip", g_settings.picviewer_decode_server_ip ); configfile.setString( "picviewer_decode_server_port", g_settings.picviewer_decode_server_port); @@ -1177,7 +1177,7 @@ void CNeutrinoApp::saveSetup(const char * fname) //Audio-Player configfile.setInt32( "audioplayer_display", g_settings.audioplayer_display ); configfile.setInt32( "audioplayer_follow", g_settings.audioplayer_follow ); - configfile.setString( "audioplayer_screensaver", g_settings.audioplayer_screensaver ); + configfile.setInt32( "audioplayer_screensaver", g_settings.audioplayer_screensaver ); configfile.setInt32( "audioplayer_highprio", g_settings.audioplayer_highprio ); configfile.setInt32( "audioplayer_select_title_by_name", g_settings.audioplayer_select_title_by_name ); configfile.setInt32( "audioplayer_repeat_on", g_settings.audioplayer_repeat_on ); diff --git a/src/system/settings.h b/src/system/settings.h index a08f0b511..8e23bd0fa 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -577,15 +577,15 @@ struct SNeutrinoSettings #define FILESYSTEM_ENCODING_TO_UTF8_STRING(a) (isUTF8(a) ? (a) : ZapitTools::Latin1_to_UTF8(a)) // pictureviewer - char picviewer_slide_time[3]; - int picviewer_scaling; + int picviewer_slide_time; + int picviewer_scaling; std::string picviewer_decode_server_ip; char picviewer_decode_server_port[6]; //audioplayer int audioplayer_display; int audioplayer_follow; - char audioplayer_screensaver[3]; + int audioplayer_screensaver; int audioplayer_highprio; int audioplayer_select_title_by_name; int audioplayer_repeat_on;