From cfed91b59e7a8ca7198f0ff6a67b7d21708dfb66 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Tue, 29 Mar 2011 13:01:31 +0000 Subject: [PATCH] fix manuel rec dir in timerlist git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1351 e54a6e83-5905-42d5-8d5c-058d10e6a962 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/029f944c391ec46cfb35723fac6b0cbcb5187750 Author: Jacek Jendrzej Date: 2011-03-29 (Tue, 29 Mar 2011) Origin message was: ------------------ -fix manuel rec dir in timerlist git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@1351 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/timerlist.cpp | 39 ++++++++++++++++++++++----------------- src/neutrino.cpp | 16 +++++++++++----- 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index f6e2dfdd1..4efe8a398 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -45,10 +45,12 @@ #include #include +#include #include #include +#include #include -#include + #include #include @@ -57,7 +59,6 @@ #include #include #include -#include #include #include @@ -370,7 +371,22 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) g_RCInput->postMsg(CRCInput::RC_timeout, 0); // leave underlying menu also return menu_return::RETURN_EXIT; } - + else if(actionKey == "rec_dir1") { + parent->hide(); + const char *action_str = "RecDir1"; + if(chooserDir(timerlist[selected].recordingDir, true, action_str, sizeof(timerlist[selected].recordingDir)-1)){ + printf("[%s] new %s dir %s\n",__FILE__, action_str, timerlist[selected].recordingDir); + } + return menu_return::RETURN_REPAINT; + } + else if(actionKey == "rec_dir2") { + parent->hide(); + const char *action_str = "RecDir2"; + if(chooserDir(timerNew.recordingDir, true, action_str, sizeof(timerNew.recordingDir)-1)){ + printf("[%s] new %s dir %s\n",__FILE__, action_str, timerNew.recordingDir); + } + return menu_return::RETURN_REPAINT; + } if (parent) { parent->hide(); @@ -1062,14 +1078,8 @@ int CTimerList::modifyTimer() if (!strlen(timer->recordingDir)) strncpy(timer->recordingDir,g_settings.network_nfs_recordingdir,sizeof(timer->recordingDir)); - CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,NULL, - timer->recordingDir, g_settings.network_nfs_recordingdir); - if (!recDirs.hasItem()) - { - printf("[CTimerList] warning: no network devices available\n"); - } - bool recDirEnabled = recDirs.hasItem() && (timer->eventType == CTimerd::TIMER_RECORD) && (g_settings.recording_type == RECORDING_FILE); - CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR,recDirEnabled,timer->recordingDir, &recDirs); + bool recDirEnabled = (timer->eventType == CTimerd::TIMER_RECORD) && (g_settings.recording_type == RECORDING_FILE); + CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirEnabled, timer->recordingDir, this, "rec_dir1", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); timerSettings.addItem(GenericMenuSeparatorLine); timerSettings.addItem(m3); @@ -1180,12 +1190,7 @@ int CTimerList::newTimer() strcpy(timerNew_channel_name,"---"); CMenuForwarder* m6 = new CMenuForwarder(LOCALE_TIMERLIST_CHANNEL, true, timerNew_channel_name, &mm); - CMountChooser recDirs(LOCALE_TIMERLIST_RECORDING_DIR,NEUTRINO_ICON_SETTINGS,NULL,timerNew.recordingDir,g_settings.network_nfs_recordingdir); - if (!recDirs.hasItem()) - { - printf("[CTimerList] warning: no network devices available\n"); - } - CMenuForwarder* m7 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, recDirs.hasItem(),timerNew.recordingDir, &recDirs); + CMenuForwarder* m7 = new CMenuForwarder(LOCALE_TIMERLIST_RECORDING_DIR, true,timerNew.recordingDir, this, "rec_dir2", CRCInput::RC_green, NEUTRINO_ICON_BUTTON_GREEN); CMenuOptionChooser* m8 = new CMenuOptionChooser(LOCALE_TIMERLIST_STANDBY, &timerNew_standby_on, TIMERLIST_STANDBY_OPTIONS, TIMERLIST_STANDBY_OPTION_COUNT, false); diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 0b2a9d726..e23940455 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4079,12 +4079,13 @@ printf("radioMode: rezap %s\n", rezap ? "yes" : "no"); void CNeutrinoApp::startNextRecording() { if ((recordingstatus == 0) && (nextRecordingInfo != NULL)) { - bool doRecord = true; + bool doRecord = false; if (CVCRControl::getInstance()->isDeviceRegistered()) { recording_id = nextRecordingInfo->eventID; if (g_settings.recording_type == RECORDING_FILE) { char *recordingDir = strlen(nextRecordingInfo->recordingDir) > 0 ? nextRecordingInfo->recordingDir : g_settings.network_nfs_recordingdir; +#if 0 if (!CFSMounter::isMounted(recordingDir)) { doRecord = false; for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { @@ -4110,14 +4111,19 @@ void CNeutrinoApp::startNextRecording() break; } } - if (!doRecord) { + } +#endif + if(!check_dir(recordingDir)){ + doRecord = true; + } + if (!doRecord) { // recording dir does not seem to exist in config anymore // or an error occured while mounting // -> try default dir - recordingDir = g_settings.network_nfs_recordingdir; - doRecord = true; - } + recordingDir = g_settings.network_nfs_recordingdir; + doRecord = true; } + (static_cast(recordingdevice))->Directory = std::string(recordingDir); printf("CNeutrinoApp::startNextRecording: start to dir %s\n", recordingDir); }