diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 44c56365d..09e2a7d51 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1171,6 +1171,7 @@ motorcontrol.store Speichere Motorposition (a) motorcontrol.timed_mode Zeitgesteuerter Schrittweitenmodus motorcontrol.user_menu Benutzermenü motorcontrol.west_limit Setze westliches (soft) Limit +moviebrowser.ask_rec_to_delete Das Löschen des Films beendet auch die laufende Aufnahme!\n[%s]\nTrotzdem fortsetzen? moviebrowser.book_add Lesezeichen setzen moviebrowser.book_clear_all Lösche alle moviebrowser.book_head Markierungen diff --git a/data/locale/english.locale b/data/locale/english.locale index 78e18ccb1..01e4502c5 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1171,6 +1171,7 @@ motorcontrol.store Store Motor Position (a) motorcontrol.timed_mode Timed Step Mode motorcontrol.user_menu User menu motorcontrol.west_limit Set West (soft) Limit +moviebrowser.ask_rec_to_delete Deletion of movie stops current recording!\n[%s]\nContinue anyway? moviebrowser.book_add Add bookmark moviebrowser.book_clear_all Clear all moviebrowser.book_head Bookmarks diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 93403f3fa..86baeec8e 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1650,18 +1650,18 @@ void CRecordManager::RestoreNeutrino(void) g_Sectionsd->setPauseScanning(false); } -bool CRecordManager::IsFileRecord(std::string file) +CRecordInstance* CRecordManager::getRecordInstance(std::string file) { mutex.lock(); for(recmap_iterator_t it = recmap.begin(); it != recmap.end(); it++) { CRecordInstance * inst = it->second; if ((((std::string)inst->GetFileName()) + ".ts") == file) { mutex.unlock(); - return true; + return inst; } } mutex.unlock(); - return false; + return NULL; } #if 0 diff --git a/src/driver/record.h b/src/driver/record.h index ac5ebc311..b8ee4be99 100644 --- a/src/driver/record.h +++ b/src/driver/record.h @@ -218,7 +218,7 @@ class CRecordManager : public CMenuTarget /*, public CChangeObserver*/ int GetRecordCount() { return recmap.size(); }; void StartTimeshift(); int GetRecordMode(const t_channel_id channel_id=0); - bool IsFileRecord(std::string file); + CRecordInstance* getRecordInstance(std::string file); // old code #if 0 bool IsTimeshift(t_channel_id channel_id=0); diff --git a/src/gui/moviebrowser.cpp b/src/gui/moviebrowser.cpp index 92b0d4d0c..bb3cf9281 100644 --- a/src/gui/moviebrowser.cpp +++ b/src/gui/moviebrowser.cpp @@ -520,7 +520,6 @@ void CMovieBrowser::init(void) refreshBrowserList(); refreshFilterList(); g_PicViewer->getSupportedImageFormats(PicExts); - IsRecord = false; #if 0 TRACE_1("Frames\r\n\tScren:\t%3d,%3d,%3d,%3d\r\n\tMain:\t%3d,%3d,%3d,%3d\r\n\tTitle:\t%3d,%3d,%3d,%3d \r\n\tBrowsr:\t%3d,%3d,%3d,%3d \r\n\tPlay:\t%3d,%3d,%3d,%3d \r\n\tRecord:\t%3d,%3d,%3d,%3d\r\n\r\n", g_settings.screen_StartX, @@ -1229,13 +1228,6 @@ void CMovieBrowser::refreshMovieInfo(void) m_pcInfo->setText(&emptytext); } else { - // Is record? - bool tmp = CRecordManager::getInstance()->IsFileRecord(m_movieSelectionHandler->file.Name); - if (tmp != IsRecord) { - IsRecord = tmp; - refreshFoot(); - } - bool logo_ok = false; int picw = (int)(((float)16 / (float)9) * (float)m_cBoxFrameInfo.iHeight); int pich = m_cBoxFrameInfo.iHeight; @@ -1638,13 +1630,9 @@ void CMovieBrowser::refreshFoot(void) m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_OKAY, &iw, &ih); m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_OKAY, m_cBoxFrame.iX+xpos1+width*2, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*2 + 10 + iw, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, ok_text.c_str(), (CFBWindow::color_t)color, 0, true); // UTF-8 - - if (IsRecord == false) { - //delete icon - m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); - m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); - m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 - } + m_pcWindow->getIconSize(NEUTRINO_ICON_BUTTON_MUTE_SMALL, &iw, &ih); + m_pcWindow->paintIcon(NEUTRINO_ICON_BUTTON_MUTE_SMALL, m_cBoxFrame.iX+xpos1+width*3, m_cBoxFrame.iY+m_cBoxFrameFootRel.iY, m_cBoxFrameFootRel.iHeight+ 6); + m_pcFontFoot->RenderString(m_cBoxFrame.iX+xpos1+width*3 + 10 + iw , m_cBoxFrame.iY+m_cBoxFrameFootRel.iY + m_cBoxFrameFootRel.iHeight + 4 , width-30, g_Locale->getText(LOCALE_FILEBROWSER_DELETE), (CFBWindow::color_t)color, 0, true); // UTF-8 } @@ -1740,8 +1728,28 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) } else if (msg == CRCInput::RC_spkr) { - if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL) && (IsRecord == false)) - onDeleteFile(*m_movieSelectionHandler); + if ((!m_vMovieInfo.empty()) && (m_movieSelectionHandler != NULL)) { + bool onDelete = true; + bool skipAsk = false; + CRecordInstance* inst = CRecordManager::getInstance()->getRecordInstance(m_movieSelectionHandler->file.Name); + if (inst != NULL) { + std::string delName = m_movieSelectionHandler->epgTitle; + if (delName == "") + delName = m_movieSelectionHandler->file.getFileName(); + char buf1[1024]; + memset(buf1, '\0', sizeof(buf1)); + snprintf(buf1, sizeof(buf1)-1, g_Locale->getText(LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE), delName.c_str()); + if(ShowMsgUTF(LOCALE_RECORDINGMENU_RECORD_IS_RUNNING, buf1, + CMessageBox::mbrNo, CMessageBox::mbYes | CMessageBox::mbNo, NULL, 450, 30, false) == CMessageBox::mbrNo) + onDelete = false; + else { + g_Timerd->removeTimerEvent(inst->GetRecordingId()); + skipAsk = true; + } + } + if (onDelete) + onDeleteFile(*m_movieSelectionHandler, skipAsk); + } } else if (msg == CRCInput::RC_help || msg == CRCInput::RC_info) { @@ -2045,7 +2053,7 @@ bool CMovieBrowser::onButtonPressMovieInfoList(neutrino_msg_t msg) return (result); } -void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) +void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk) { //TRACE( "[onDeleteFile] "); int test= movieSelectionHandler.file.Name.find(".ts"); @@ -2068,7 +2076,7 @@ void CMovieBrowser::onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler) msg += "\r\n "; msg += g_Locale->getText(LOCALE_FILEBROWSER_DODELETE2); - if (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes) + if ((skipAsk) || (ShowMsgUTF(LOCALE_FILEBROWSER_DELETE, msg, CMessageBox::mbrYes, CMessageBox::mbYes|CMessageBox::mbNo)==CMessageBox::mbrYes)) { delFile(movieSelectionHandler.file); diff --git a/src/gui/moviebrowser.h b/src/gui/moviebrowser.h index 1b3c89712..154b7364f 100644 --- a/src/gui/moviebrowser.h +++ b/src/gui/moviebrowser.h @@ -294,8 +294,6 @@ class CMovieBrowser : public CMenuTarget MB_SETTINGS m_settings; std::vector m_dir; - bool IsRecord; - int movieInfoUpdateAll[MB_INFO_MAX_NUMBER]; int movieInfoUpdateAllIfDestEmptyOnly; @@ -368,7 +366,7 @@ class CMovieBrowser : public CMenuTarget void onSetGUIWindow(MB_GUI gui); void onSetGUIWindowNext(void); void onSetGUIWindowPrev(void); - void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler); // P4 + void onDeleteFile(MI_MOVIE_INFO& movieSelectionHandler, bool skipAsk = false); // P4 bool onSortMovieInfoHandleList(std::vector& pv_handle_list, MB_INFO_ITEM sort_type, MB_DIRECTION direction); ///// parse Storage Directories ///////////// diff --git a/src/system/locals.h b/src/system/locals.h index 237eb94cf..5ae34e13e 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1198,6 +1198,7 @@ typedef enum LOCALE_MOTORCONTROL_TIMED_MODE, LOCALE_MOTORCONTROL_USER_MENU, LOCALE_MOTORCONTROL_WEST_LIMIT, + LOCALE_MOVIEBROWSER_ASK_REC_TO_DELETE, LOCALE_MOVIEBROWSER_BOOK_ADD, LOCALE_MOVIEBROWSER_BOOK_CLEAR_ALL, LOCALE_MOVIEBROWSER_BOOK_HEAD, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 7d307bdb7..8c58cd2a5 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1198,6 +1198,7 @@ const char * locale_real_names[] = "motorcontrol.timed_mode", "motorcontrol.user_menu", "motorcontrol.west_limit", + "moviebrowser.ask_rec_to_delete", "moviebrowser.book_add", "moviebrowser.book_clear_all", "moviebrowser.book_head",