Ticket #6158: PBB-MV-export-3.11.09.diff
File PBB-MV-export-3.11.09.diff, 24.6 KB (added by , 17 years ago) |
---|
-
mythplugins/mythvideo/mythvideo/globalsettings.cpp
246 246 return gc; 247 247 } 248 248 249 HostLineEdit *TVExportDirectoryFormat() 250 { 251 HostLineEdit *gc = new HostLineEdit("TVExportDirFormat"); 252 gc->setLabel(QObject::tr("TV Export Directory Format")); 253 gc->setValue(DEFAULT_TVEXPORTDIRFORMAT); 254 gc->setHelpText(QObject::tr("Directory format for recording export " 255 "to MythVideo, using user job style variables. Directory " 256 "is off of base MythVideo directory. Example: " 257 "Television/%CATEGORY%/%TITLE%")); 258 return gc; 259 } 260 261 HostLineEdit *TVExportFileFormat() 262 { 263 HostLineEdit *gc = new HostLineEdit("TVExportFileFormat"); 264 gc->setLabel(QObject::tr("TV Export File Format")); 265 gc->setValue(DEFAULT_TVEXPORTFILEFORMAT); 266 gc->setHelpText(QObject::tr("File format for recording export " 267 "to MythVideo, using user job style variables. Example: " 268 "%TITLE% - %SUBTITLE% (%STARTTIMEISO%)")); 269 return gc; 270 } 271 249 272 HostLineEdit *VideoArtworkDirectory() 250 273 { 251 274 HostLineEdit *gc = new HostLineEdit("VideoArtworkDir"); … … 779 802 new VerticalConfigurationGroup(true, false); 780 803 trlr->addChild(TrailerDirectory()); 781 804 trlr->addChild(new RandomTrailers()); 805 trlr->addChild(TVExportFileFormat()); 806 trlr->addChild(TVExportDirectoryFormat()); 782 807 VConfigPage page7(pages, false); 783 808 page7->addChild(trlr); 784 809 -
mythplugins/mythvideo/mythvideo/globals.cpp
28 28 const QString JUMP_VIDEO_TREE = "Video Listings"; 29 29 const QString JUMP_VIDEO_GALLERY = "Video Gallery"; 30 30 const QString JUMP_VIDEO_DEFAULT = "MythVideo"; 31 const QString DEFAULT_TVEXPORTDIRFORMAT = "Television/%TITLE%"; 32 const QString DEFAULT_TVEXPORTFILEFORMAT = "%TITLE% - %SUBTITLE%"; 31 33 32 34 #ifdef Q_WS_MACX 33 35 const QString DEFAULT_VIDEOSTARTUP_DIR = QDir::homePath() + "/Movies"; -
mythplugins/mythvideo/mythvideo/globals.h
28 28 extern const QString JUMP_VIDEO_DEFAULT; 29 29 30 30 extern const QString DEFAULT_VIDEOSTARTUP_DIR; 31 extern const QString DEFAULT_TVEXPORTDIRFORMAT; 32 extern const QString DEFAULT_TVEXPORTFILEFORMAT; 31 33 32 34 #endif // GLOBALS_H_ -
mythtv/programs/mythfrontend/playbackbox.cpp
20 20 #include "mythdirs.h" 21 21 #include "mythcontext.h" 22 22 #include "mythdbcon.h" 23 #include "mythdb.h" 23 24 #include "mythverbose.h" 24 25 #include "programinfo.h" 25 26 #include "scheduledrecording.h" … … 35 36 #include "mythuibutton.h" 36 37 #include "mythuibuttonlist.h" 37 38 #include "mythuistatetype.h" 39 #include "mythuispinbox.h" 38 40 #include "mythdialogbox.h" 39 41 #include "mythuitextedit.h" 40 42 #include "mythuiimage.h" … … 44 46 #define LOC QString("PlaybackBox: ") 45 47 #define LOC_ERR QString("PlaybackBox Error: ") 46 48 49 QString customExportFile = NULL; 50 QString customExportDir = NULL; 51 unsigned int customExportSeason = 0; 52 unsigned int customExportEpisode = 0; 53 47 54 #define REC_CAN_BE_DELETED(rec) \ 48 55 ((((rec)->programflags & FL_INUSEPLAYING) == 0) && \ 49 56 ((((rec)->programflags & FL_INUSERECORDING) == 0) || \ … … 1812 1819 RemoteStopRecording(rec); 1813 1820 } 1814 1821 1822 void PlaybackBox::mvexport(ProgramInfo *rec) 1823 { 1824 1825 // User Rating Adjustment 1826 QString exportRating = QString::number((int)((rec->stars * 10.0) + 0.5)); 1827 1828 // Stuff necessary to perform the copy command 1829 1830 QString copyFrom = rec->GetPlaybackURL(false, true); 1831 QString baseMVDir = gContext->GetSetting("VideoStartupDir"); 1832 QString MVFileFormat; 1833 QString MVDirFormat; 1834 QString copyToDir; 1835 QString copyToFile; 1836 QString extension; 1837 unsigned int seasonValue; 1838 unsigned int episodeValue; 1839 1840 // Check the original extension 1841 1842 QRegExp rx(".*\\.(\\w+)$"); 1843 int pos = rx.indexIn(copyFrom); 1844 if (pos > -1) 1845 { 1846 extension = rx.cap(1); 1847 } 1848 else 1849 { 1850 extension = ""; 1851 } 1852 1853 // If a custom export string is used, use it. 1854 // Also replace %VARIABLES% with actual values. 1855 1856 if (customExportFile.isEmpty() && customExportDir.isEmpty() 1857 && customExportSeason == 0 && customExportEpisode == 0) 1858 { 1859 QString defaultDir = gContext->GetSetting("TVExportDirFormat", 1860 "Television/%TITLE%/"); 1861 QString defaultFile = gContext->GetSetting("TVExportFileFormat", 1862 "%TITLE% - %SUBTITLE%"); 1863 MVDirFormat = replaceExportVariables(rec, defaultDir); 1864 MVFileFormat = replaceExportVariables(rec, defaultFile); 1865 QString recType = rec->catType; 1866 if (recType == "movie") 1867 { 1868 seasonValue = 0; 1869 episodeValue = 0; 1870 } 1871 else 1872 { 1873 seasonValue = getLastSeason(rec->title); 1874 episodeValue = (getLastEpisode(rec->title, seasonValue) + 1); 1875 } 1876 } 1877 else 1878 { 1879 MVDirFormat = replaceExportVariables(rec, customExportDir); 1880 MVFileFormat = replaceExportVariables(rec, customExportFile); 1881 seasonValue = customExportSeason; 1882 episodeValue = customExportEpisode; 1883 } 1884 1885 copyToDir = QString("%1/%2").arg(baseMVDir).arg(MVDirFormat); 1886 copyToFile = QString("%1/%2.%3").arg(copyToDir) 1887 .arg(MVFileFormat).arg(extension); 1888 1889 // replace double slash with single 1890 1891 copyToFile.replace("//", "/"); 1892 1893 // File and Directory Definitions 1894 1895 QFile fromFile(copyFrom); 1896 QDir toDir(copyToDir); 1897 QFile toFile(copyToFile); 1898 1899 if (!toDir.exists()) 1900 { 1901 // Attempt to create path to export point. 1902 toDir.mkpath(copyToDir); 1903 toDir.mkdir(copyToDir); 1904 if (!toDir.exists()) 1905 { 1906 VERBOSE(VB_IMPORTANT, QString("Unable to create directory %1! " 1907 "Please ensure the preceding path " 1908 "exists and is writeable.").arg(copyToDir)); 1909 return; 1910 } 1911 } 1912 1913 // Perform the actual copy. 1914 1915 long long int bytesCopied = copy(toFile,fromFile); 1916 1917 if (bytesCopied != -1) 1918 { 1919 // Add File into videometadata 1920 1921 MSqlQuery query(MSqlQuery::InitCon()); 1922 1923 query.prepare("INSERT INTO videometadata (title,subtitle,director," 1924 "plot,rating,year,userrating,length,season," 1925 "episode,filename,showlevel,coverfile,inetref," 1926 "browse, trailer, screenshot, banner, fanart) VALUES " 1927 "(:TITLE, :SUBTITLE, :DIRECTOR, :PLOT, :RATING, :YEAR, " 1928 ":USERRATING, :LENGTH, :SEASON, :EPISODE, :FILENAME, " 1929 ":SHOWLEVEL, :COVERFILE, :INETREF, :BROWSE, :TRAILER, " 1930 ":SCREENSHOT, :BANNER, :FANART)"); 1931 1932 query.bindValue(":TITLE", rec->title); 1933 query.bindValue(":SUBTITLE", rec->subtitle); 1934 query.bindValue(":DIRECTOR", "Unknown"); 1935 query.bindValue(":PLOT", rec->description); 1936 query.bindValue(":RATING", "NR"); 1937 query.bindValue(":YEAR", rec->originalAirDate.toString("yyyy")); 1938 query.bindValue(":USERRATING", exportRating); 1939 query.bindValue(":LENGTH", rec->lenMins); 1940 query.bindValue(":SEASON", seasonValue); 1941 query.bindValue(":EPISODE", episodeValue); 1942 query.bindValue(":FILENAME", copyToFile); 1943 query.bindValue(":SHOWLEVEL", 1); 1944 query.bindValue(":COVERFILE", "No Cover"); 1945 query.bindValue(":INETREF", 0); 1946 query.bindValue(":BROWSE", 1); 1947 query.bindValue(":TRAILER", ""); 1948 query.bindValue(":SCREENSHOT", ""); 1949 query.bindValue(":BANNER", ""); 1950 query.bindValue(":FANART", ""); 1951 1952 if (!query.exec() || !query.isActive()) 1953 { 1954 MythDB::DBError("video metadata update", query); 1955 return; 1956 } 1957 1958 // Move recordedmarkup for file into videometadata 1959 1960 MSqlQuery markup(MSqlQuery::InitCon()); 1961 1962 markup.prepare("INSERT INTO filemarkup (filename,mark,offset,type) " 1963 "SELECT :FILENAME, mark, data, type from " 1964 "recordedmarkup where chanid=:CHANID and starttime=:STARTTIME"); 1965 1966 markup.bindValue(":FILENAME", copyToFile); 1967 markup.bindValue(":CHANID", rec->chanid); 1968 markup.bindValue(":STARTTIME", rec->recstartts); 1969 1970 if (!markup.exec() || !markup.isActive()) 1971 { 1972 MythDB::DBError("video metadata update", markup); 1973 return; 1974 } 1975 1976 // Copy and set preview image as screenshot 1977 // If Banners, cover files, or fanart exist with 1978 // seriesID as the name, use them automatically. 1979 1980 QString screenshotFile = getPreviewImage(rec); 1981 QString MVScreenshotDir = gContext->GetSetting("mythvideo.screenshotDir"); 1982 QString MVScreenshotFile = QString("%1/%2.png").arg(MVScreenshotDir).arg(MVFileFormat); 1983 1984 QString MVBannerDir = gContext->GetSetting("mythvideo.bannerDir"); 1985 QString bannerFile = testImageFiles(MVBannerDir, rec->seriesid, rec->title); 1986 if (!bannerFile.isNull()) 1987 VERBOSE(VB_IMPORTANT, QString("Found Banner File Match: %1").arg(bannerFile)); 1988 1989 QString MVFanartDir = gContext->GetSetting("mythvideo.fanartDir"); 1990 QString fanartFile = testImageFiles(MVFanartDir, rec->seriesid, rec->title); 1991 if (!fanartFile.isNull()) 1992 VERBOSE(VB_IMPORTANT, QString("Found Fanart File Match: %1").arg(fanartFile)); 1993 1994 QString MVCoverDir = gContext->GetSetting("VideoArtworkDir"); 1995 QString coverFile = testImageFiles(MVCoverDir, rec->seriesid, rec->title); 1996 if (!coverFile.isNull()) 1997 VERBOSE(VB_IMPORTANT, QString("Found Cover File Match: %1").arg(coverFile)); 1998 1999 VERBOSE(VB_IMPORTANT, QString("Copying %1 to %2").arg(screenshotFile).arg(MVScreenshotFile)); 2000 2001 QFile fromScreenshot(screenshotFile); 2002 QFile toScreenshot(MVScreenshotFile); 2003 long long int screenshotBytesCopied; 2004 2005 if (!screenshotFile.isNull()) 2006 screenshotBytesCopied = copy(toScreenshot,fromScreenshot); 2007 2008 if (!bannerFile.isNull() || !fanartFile.isNull() || !coverFile.isNull()) 2009 { 2010 MSqlQuery images(MSqlQuery::InitCon()); 2011 2012 images.prepare("UPDATE videometadata set screenshot=:SCREENSHOTFILE, " 2013 "banner=:BANNERFILE, fanart=:FANARTFILE, coverfile=:COVERFILE " 2014 "where filename=:FILENAME"); 2015 2016 images.bindValue(":SCREENSHOTFILE", MVScreenshotFile); 2017 images.bindValue(":BANNERFILE", bannerFile); 2018 images.bindValue(":FANARTFILE", fanartFile); 2019 images.bindValue(":COVERFILE", coverFile); 2020 images.bindValue(":FILENAME", copyToFile); 2021 2022 if (!images.exec() || !images.isActive()) 2023 { 2024 MythDB::DBError("video metadata update", images); 2025 return; 2026 } 2027 } 2028 else 2029 { 2030 VERBOSE(VB_IMPORTANT, QString("Copy succeeded, but no images " 2031 "were copied or found.").arg(screenshotBytesCopied)); 2032 return; 2033 } 2034 VERBOSE(VB_IMPORTANT, QString("Copy succeeded, %1 bytes copied.").arg(bytesCopied)); 2035 } 2036 else 2037 { 2038 VERBOSE(VB_IMPORTANT, QString("Copy unsuccessful, check all permissions.")); 2039 } 2040 2041 customExportDir.clear(); 2042 customExportFile.clear(); 2043 customExportSeason = 0; 2044 customExportEpisode = 0; 2045 } 2046 2047 unsigned int PlaybackBox::getLastSeason(QString title) 2048 { 2049 unsigned int retSeason; 2050 2051 if (!title.isEmpty()) 2052 { 2053 MSqlQuery season(MSqlQuery::InitCon()); 2054 2055 season.prepare("SELECT season from videometadata where " 2056 "title = :TITLE ORDER BY season DESC LIMIT 1"); 2057 2058 season.bindValue(":TITLE", title); 2059 2060 if (season.exec() && season.next()) 2061 { 2062 retSeason = season.value(0).toInt(); 2063 } 2064 else 2065 retSeason = 1; 2066 } 2067 2068 return retSeason; 2069 } 2070 2071 unsigned int PlaybackBox::getLastEpisode(QString title, unsigned int season) 2072 { 2073 unsigned int retEpisode; 2074 2075 if (!title.isEmpty()) 2076 { 2077 MSqlQuery episode(MSqlQuery::InitCon()); 2078 2079 episode.prepare("SELECT episode from videometadata where " 2080 "title = :TITLE AND season = :SEASON ORDER BY " 2081 "episode DESC LIMIT 1"); 2082 2083 episode.bindValue(":TITLE", title); 2084 episode.bindValue(":SEASON", season); 2085 2086 if (episode.exec() && episode.next()) 2087 { 2088 retEpisode = episode.value(0).toInt(); 2089 } 2090 else 2091 retEpisode = 0; 2092 } 2093 2094 return retEpisode; 2095 } 2096 2097 QString PlaybackBox::replaceExportVariables(ProgramInfo *rec, QString &repString) 2098 { 2099 if (!repString.isEmpty()) 2100 { 2101 repString.replace(QRegExp("%FILE%"), rec->GetRecordBasename(true)); 2102 repString.replace(QRegExp("%TITLE%"), rec->title); 2103 repString.replace(QRegExp("%SUBTITLE%"), rec->subtitle); 2104 repString.replace(QRegExp("%DESCRIPTION%"), rec->description); 2105 repString.replace(QRegExp("%HOSTNAME%"), rec->hostname); 2106 repString.replace(QRegExp("%CATEGORY%"), rec->category); 2107 repString.replace(QRegExp("%RECGROUP%"), rec->recgroup); 2108 repString.replace(QRegExp("%PLAYGROUP%"), rec->playgroup); 2109 repString.replace(QRegExp("%ORIGAIRYEAR%"), 2110 rec->originalAirDate.toString("yyyy")); 2111 repString.replace(QRegExp("%ORIGAIRDATE%"), 2112 rec->originalAirDate.toString("yyyyMMdd")); 2113 repString.replace(QRegExp("%CALLSIGN%"), rec->chansign); 2114 repString.replace(QRegExp("%CHANNAME%"), rec->channame); 2115 repString.replace(QRegExp("%CHANID%"), rec->chanid); 2116 repString.replace(QRegExp("%STARTTIME%"), 2117 rec->recstartts.toString("yyyyMMddhhmmss")); 2118 repString.replace(QRegExp("%ENDTIME%"), 2119 rec->recendts.toString("yyyyMMddhhmmss")); 2120 repString.replace(QRegExp("%STARTTIMEISO%"), 2121 rec->recstartts.toString(Qt::ISODate)); 2122 repString.replace(QRegExp("%ENDTIMEISO%"), 2123 rec->recendts.toString(Qt::ISODate)); 2124 repString.replace(QRegExp("%PROGSTART%"), 2125 rec->startts.toString("yyyyMMddhhmmss")); 2126 repString.replace(QRegExp("%PROGEND%"), 2127 rec->endts.toString("yyyyMMddhhmmss")); 2128 repString.replace(QRegExp("%PROGSTARTISO%"), 2129 rec->startts.toString(Qt::ISODate)); 2130 repString.replace(QRegExp("%PROGENDISO%"), 2131 rec->endts.toString(Qt::ISODate)); 2132 } 2133 return repString; 2134 } 2135 1815 2136 bool PlaybackBox::doRemove(ProgramInfo *rec, bool forgetHistory, 1816 2137 bool forceMetadataDelete) 1817 2138 { … … 1952 2273 showActionPopup(pginfo); 1953 2274 } 1954 2275 2276 void PlaybackBox::showExportPopup(ProgramInfo *program) 2277 { 2278 if (m_popupMenu) 2279 return; 2280 2281 QString label = tr("Are you sure you want to export:"); 2282 2283 m_expItem = CurrentItem(); 2284 popupString(m_expItem, label); 2285 2286 m_popupMenu = new MythDialogBox(label, m_popupStack, "pbbmainmenupopup"); 2287 2288 connect(m_popupMenu, SIGNAL(Exiting()), SLOT(popupClosed())); 2289 2290 if (m_popupMenu->Create()) 2291 m_popupStack->AddScreen(m_popupMenu); 2292 else 2293 { 2294 delete m_popupMenu; 2295 m_popupMenu = NULL; 2296 } 2297 2298 m_popupMenu->SetReturnEvent(this, "slotmenu"); 2299 2300 m_freeSpaceNeedsUpdate = true; 2301 QString tmpmessage; 2302 const char *tmpslot = NULL; 2303 2304 if (program->IsSameProgram(*program)) 2305 { 2306 tmpmessage = tr("Yes, Export to MythVideo"); 2307 tmpslot = SLOT(doMVExport()); 2308 m_popupMenu->AddButton(tmpmessage, tmpslot); 2309 2310 tmpmessage = tr("Export (Start New Season)"); 2311 tmpslot = SLOT(doNewSeasonExport()); 2312 m_popupMenu->AddButton(tmpmessage, tmpslot); 2313 2314 tmpmessage = tr("Export with custom name/location"); 2315 tmpslot = SLOT(showCustomExportEditor()); 2316 m_popupMenu->AddButton(tmpmessage, tmpslot); 2317 2318 tmpmessage = tr("No, I don't want to Export"); 2319 tmpslot = SLOT(noExport()); 2320 m_popupMenu->AddButton(tmpmessage, tmpslot); 2321 } 2322 } 2323 2324 1955 2325 void PlaybackBox::doPIPPlay(void) 1956 2326 { 1957 2327 doPIPPlay(kPIPonTV); … … 2378 2748 else 2379 2749 m_popupMenu->AddButton(tr("Preserve this episode"), 2380 2750 SLOT(togglePreserveEpisode())); 2751 2752 QString MVlocation = FindPluginName("mythvideo"); 2753 if (QFile(MVlocation).exists()) 2754 m_popupMenu->AddButton(tr("Export to MythVideo"), SLOT(askMVExport())); 2381 2755 } 2382 2756 } 2383 2757 … … 2754 3128 stop(pginfo); 2755 3129 } 2756 3130 3131 void PlaybackBox::doMVExport() 3132 { 3133 ProgramInfo *pginfo = CurrentItem(); 3134 mvexport(pginfo); 3135 } 3136 2757 3137 void PlaybackBox::showProgramDetails() 2758 3138 { 2759 3139 ProgramInfo *pginfo = CurrentItem(); … … 2892 3272 } 2893 3273 } 2894 3274 3275 void PlaybackBox::askMVExport(ProgramInfo *pginfo) 3276 { 3277 if (!pginfo) 3278 pginfo = CurrentItem(); 3279 showExportPopup(pginfo); 3280 } 3281 2895 3282 void PlaybackBox::askDelete() 2896 3283 { 2897 3284 if (m_delItem) … … 4130 4517 m_recordingList->RemoveItem(item); 4131 4518 } 4132 4519 4520 void PlaybackBox::showCustomExportEditor() 4521 { 4522 4523 MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); 4524 4525 CustomExportEdit *editExport = new CustomExportEdit(mainStack); 4526 4527 if (editExport->Create()) 4528 { 4529 connect(editExport, SIGNAL(result(const QString &, const QString &, 4530 unsigned int, unsigned int)), 4531 SLOT(startCustomExport(const QString &, const QString &, 4532 unsigned int, unsigned int))); 4533 mainStack->AddScreen(editExport); 4534 } 4535 else 4536 delete editExport; 4537 } 4538 4539 void PlaybackBox::doNewSeasonExport() 4540 { 4541 MythUIButtonListItem *item = m_recordingList->GetItemCurrent(); 4542 4543 if (!item) 4544 return; 4545 4546 ProgramInfo *pginfo = CurrentItem(); 4547 4548 if (!pginfo) 4549 return; 4550 4551 QString defaultDir = gContext->GetSetting("TVExportDirFormat", 4552 "Television/%TITLE%/"); 4553 QString defaultFile = gContext->GetSetting("TVExportFileFormat", 4554 "%TITLE% - %SUBTITLE%"); 4555 4556 4557 customExportFile = gContext->GetSetting("TVExportFileFormat", 4558 "%TITLE% - %SUBTITLE%"); 4559 customExportDir = gContext->GetSetting("TVExportDirFormat", 4560 "Television/%TITLE%/"); 4561 customExportSeason = (getLastSeason(pginfo->title) + 1); 4562 customExportEpisode = 1; 4563 4564 mvexport(pginfo); 4565 } 4566 4567 void PlaybackBox::startCustomExport(const QString &newFile, const QString &newDir, 4568 unsigned int newSeason, unsigned int newEpisode) 4569 { 4570 MythUIButtonListItem *item = m_recordingList->GetItemCurrent(); 4571 4572 if (!item) 4573 return; 4574 4575 ProgramInfo *pginfo = CurrentItem(); 4576 4577 if (!pginfo) 4578 return; 4579 4580 customExportFile = newFile; 4581 customExportDir = newDir; 4582 customExportSeason = newSeason; 4583 customExportEpisode = newEpisode; 4584 4585 mvexport(pginfo); 4586 } 4587 4133 4588 void PlaybackBox::setRecGroup(QString newRecGroup) 4134 4589 { 4135 4590 ProgramInfo *tmpItem = CurrentItem(); … … 4515 4970 Close(); 4516 4971 } 4517 4972 4973 //////////////////////////////////////////////////////// 4974 4975 CustomExportEdit::CustomExportEdit(MythScreenStack *lparent) 4976 : MythScreenType(lparent, "customexportedit") 4977 { 4978 m_dirEdit = m_fileEdit = NULL; 4979 } 4980 4981 bool CustomExportEdit::Create() 4982 { 4983 if (!LoadWindowFromXML("recordings-ui.xml", "customexport", this)) 4984 return false; 4985 4986 m_dirEdit = dynamic_cast<MythUITextEdit*>(GetChild("dir")); 4987 m_fileEdit = dynamic_cast<MythUITextEdit*>(GetChild("file")); 4988 m_seasonSpin = dynamic_cast<MythUISpinBox *>(GetChild("season")); 4989 m_episodeSpin = dynamic_cast<MythUISpinBox *>(GetChild("episode")); 4990 4991 MythUIButton *okButton = dynamic_cast<MythUIButton*>(GetChild("ok")); 4992 4993 if (!m_dirEdit || !m_fileEdit || !m_seasonSpin || 4994 !m_episodeSpin || !okButton) 4995 { 4996 VERBOSE(VB_IMPORTANT, "Window 'customexport' is missing required " 4997 "elements."); 4998 return false; 4999 } 5000 5001 m_dirEdit->SetText(gContext->GetSetting("TVExportDirFormat")); 5002 m_fileEdit->SetText(gContext->GetSetting("TVExportFileFormat")); 5003 m_seasonSpin->SetRange(0,100,1); 5004 m_seasonSpin->SetValue(1); 5005 m_episodeSpin->SetRange(0,999,1); 5006 m_episodeSpin->SetValue(1); 5007 5008 connect(okButton, SIGNAL(Clicked()), SLOT(ReturnExport())); 5009 5010 if (!BuildFocusList()) 5011 VERBOSE(VB_IMPORTANT, "Failed to build a focuslist."); 5012 5013 return true; 5014 } 5015 5016 void CustomExportEdit::ReturnExport() 5017 { 5018 QString newExportDir = m_dirEdit->GetText(); 5019 QString newExportFile = m_fileEdit->GetText(); 5020 unsigned int newSeason = m_seasonSpin->GetIntValue(); 5021 unsigned int newEpisode = m_episodeSpin->GetIntValue(); 5022 5023 emit result(newExportFile, newExportDir, newSeason, newEpisode); 5024 Close(); 5025 } 5026 4518 5027 ////////////////////////////////////////// 4519 5028 4520 5029 HelpPopup::HelpPopup(MythScreenStack *lparent) -
mythtv/programs/mythfrontend/playbackbox.h
142 142 void showRecGroupChanger(); 143 143 void showPlayGroupChanger(); 144 144 void showMetadataEditor(); 145 void showCustomExportEditor(); 145 146 void showGroupFilter(); 146 147 void showRecGroupPasswordChanger(); 147 148 void showPlayFromPopup(); … … 173 174 174 175 void askStop(); 175 176 void doStop(); 177 void askMVExport(ProgramInfo *pginfo = NULL); 178 void doMVExport(); 176 179 177 180 void doEditScheduled(); 178 181 void doAllowRerecord(); … … 203 206 void setPlayGroup(QString newPlayGroup); 204 207 205 208 void saveRecMetadata(const QString &newTitle, const QString &newSubtitle); 209 void startCustomExport(const QString &newFile, const QString &newDir, 210 unsigned int newSeason, unsigned int newEpisode); 211 void doNewSeasonExport(); 206 212 207 213 void SetRecGroupPassword(const QString &newPasswd); 208 214 … … 263 269 264 270 bool play(ProgramInfo *rec, bool inPlaylist = false); 265 271 void stop(ProgramInfo *); 272 void mvexport(ProgramInfo *); 273 unsigned int getLastSeason(QString title); 274 unsigned int getLastEpisode(QString title, unsigned int season); 275 QString replaceExportVariables(ProgramInfo *rec, QString &repString); 266 276 void remove(ProgramInfo *); 267 277 void showActions(ProgramInfo *); 268 278 ProgramInfo *CurrentItem(void); … … 282 292 283 293 bool doRemove(ProgramInfo *, bool forgetHistory, bool forceMetadataDelete); 284 294 void showDeletePopup(deletePopupType); 295 void showExportPopup(ProgramInfo *); 285 296 void showActionPopup(ProgramInfo *program); 286 297 void showFileNotFoundActionPopup(ProgramInfo *program); 287 298 void popupString(ProgramInfo *program, QString &message); … … 382 393 // Other state 383 394 /// Program currently selected for deletion 384 395 ProgramInfo *m_delItem; 396 /// Program currently selected for export 397 ProgramInfo *m_expItem; 385 398 /// Program currently selected during an update 386 399 ProgramInfo *m_currentItem; 387 400 /// Group currently selected … … 522 535 ProgramInfo *m_progInfo; 523 536 }; 524 537 538 class CustomExportEdit : public MythScreenType 539 { 540 Q_OBJECT 541 542 public: 543 CustomExportEdit(MythScreenStack *lparent); 544 545 bool Create(void); 546 547 signals: 548 void result(const QString &, const QString &, unsigned int, unsigned int); 549 550 protected slots: 551 void ReturnExport(void); 552 553 private: 554 MythUITextEdit *m_dirEdit; 555 MythUITextEdit *m_fileEdit; 556 MythUISpinBox *m_seasonSpin; 557 MythUISpinBox *m_episodeSpin; 558 559 }; 560 525 561 class HelpPopup : public MythScreenType 526 562 { 527 563 Q_OBJECT