Skip to content
Permalink
Browse files

Merge branch 'mythsystem-rewrite'

  • Loading branch information
Beirdo committed Jan 2, 2011
2 parents eab21fb + fceaa99 commit 0f063f53b8cbe078c973105ec2125cae541a4be9
Showing with 3,340 additions and 1,857 deletions.
  1. +2 −0 README
  2. +9 −9 mythplugins/mytharchive/mytharchive/archiveutil.cpp
  3. +9 −7 mythplugins/mytharchive/mytharchive/exportnative.cpp
  4. +8 −5 mythplugins/mytharchive/mytharchive/importnative.cpp
  5. +5 −3 mythplugins/mytharchive/mytharchive/logviewer.cpp
  6. +15 −11 mythplugins/mytharchive/mytharchive/mythburn.cpp
  7. +1 −1 mythplugins/mytharchive/mytharchive/recordingselector.cpp
  8. +4 −6 mythplugins/mytharchive/mytharchive/thumbfinder.cpp
  9. +72 −21 mythplugins/mytharchive/mytharchive/videoselector.cpp
  10. +4 −7 mythplugins/mytharchive/mytharchive/videoselector.h
  11. +32 −24 mythplugins/mytharchive/mytharchivehelper/main.cpp
  12. +6 −6 mythplugins/mytharchive/theme/default-wide/mytharchive-ui.xml
  13. +3 −4 mythplugins/mytharchive/theme/default-wide/mythburn-ui.xml
  14. +6 −6 mythplugins/mytharchive/theme/default/mytharchive-ui.xml
  15. +3 −4 mythplugins/mytharchive/theme/default/mythburn-ui.xml
  16. 0 mythplugins/mythbrowser/i18n/mythbrowser_fr.ts
  17. +9 −24 mythplugins/mythgallery/dcrawplugin/dcrawhandler.cpp
  18. +7 −3 mythplugins/mythgallery/mythgallery/thumbgenerator.cpp
  19. +25 −33 mythplugins/mythgame/mythgame/gamehandler.cpp
  20. +1 −3 mythplugins/mythgame/mythgame/gamehandler.h
  21. +1 −2 mythplugins/mythgame/mythgame/main.cpp
  22. 0 mythplugins/mythmusic/contrib/import/itunes/it2m.c
  23. 0 mythplugins/mythmusic/contrib/import/itunes/it2m.h
  24. 0 mythplugins/mythmusic/i18n/mythmusic_fi.ts
  25. +2 −16 mythplugins/mythmusic/mythmusic/cdrip.cpp
  26. +6 −7 mythplugins/mythmusic/mythmusic/databasebox.cpp
  27. +0 −1 mythplugins/mythmusic/mythmusic/globalsettings.cpp
  28. +1 −1 mythplugins/mythmusic/mythmusic/lameencoder.cpp
  29. +1 −1 mythplugins/mythmusic/mythmusic/metadata.cpp
  30. +15 −7 mythplugins/mythmusic/mythmusic/musiccommon.cpp
  31. +2 −1 mythplugins/mythmusic/mythmusic/musiccommon.h
  32. +2 −0 mythplugins/mythmusic/mythmusic/playbackbox.cpp
  33. +161 −113 mythplugins/mythmusic/mythmusic/playlist.cpp
  34. +11 −1 mythplugins/mythmusic/mythmusic/playlist.h
  35. +0 −1 mythplugins/mythnetvision/mythnetvision/netsearch.cpp
  36. +0 −1 mythplugins/mythnetvision/mythnetvision/netsearch.h
  37. +0 −1 mythplugins/mythnetvision/mythnetvision/nettree.cpp
  38. +0 −1 mythplugins/mythvideo/mythvideo/metadatasettings.cpp
  39. 0 mythplugins/mythweather/i18n/mythweather_fi.ts
  40. +1 −1 mythplugins/mythweather/mythweather/mythweather.pro
  41. +4 −19 mythplugins/mythweather/mythweather/sourceManager.cpp
  42. +132 −211 mythplugins/mythweather/mythweather/weatherSource.cpp
  43. +8 −14 mythplugins/mythweather/mythweather/weatherSource.h
  44. +1 −1 mythplugins/mythweather/mythweather/weatherUtils.h
  45. 0 mythplugins/mythzoneminder/mythzoneminder.pro
  46. 0 mythplugins/mythzoneminder/mythzoneminder/mythzoneminder.pro
  47. +1 −1 mythtv/filters/quickdnr/quickdnr.pro
  48. BIN mythtv/i18n/mythfrontend_en_gb.qm
  49. +1 −1 mythtv/i18n/mythfrontend_en_gb.ts
  50. BIN mythtv/i18n/mythfrontend_fr.qm
  51. +1 −1 mythtv/i18n/mythfrontend_fr.ts
  52. BIN mythtv/i18n/mythfrontend_pt.qm
  53. +1 −1 mythtv/i18n/mythfrontend_pt.ts
  54. +17 −15 mythtv/libs/libmyth/dbutil.cpp
  55. +1 −1 mythtv/libs/libmyth/libmyth.pro
  56. +19 −33 mythtv/libs/libmyth/mediamonitor-unix.cpp
  57. +1 −1 mythtv/libs/libmyth/mythcontext.cpp
  58. +4 −2 mythtv/libs/libmyth/mythmedia.cpp
  59. +0 −1 mythtv/libs/libmyth/mythrssmanager.cpp
  60. +0 −1 mythtv/libs/libmyth/mythrssmanager.h
  61. +39 −52 mythtv/libs/libmyth/netgrabbermanager.cpp
  62. +4 −8 mythtv/libs/libmyth/netgrabbermanager.h
  63. +0 −1 mythtv/libs/libmyth/rssparse.cpp
  64. +1 −1 mythtv/libs/libmyth/rssparse.h
  65. +54 −6 mythtv/libs/libmyth/util.cpp
  66. +4 −0 mythtv/libs/libmyth/util.h
  67. +9 −6 mythtv/libs/libmythdb/compat.h
  68. +81 −80 mythtv/libs/libmythdb/exitcodes.h
  69. +9 −133 mythtv/libs/libmythdb/lcddevice.cpp
  70. +7 −1 mythtv/libs/libmythdb/libmythdb.pro
  71. +5 −3 mythtv/libs/libmythdb/mythcorecontext.cpp
  72. +3 −2 mythtv/libs/libmythdb/mythdbcon.cpp
  73. +254 −352 mythtv/libs/libmythdb/mythsystem.cpp
  74. +165 −16 mythtv/libs/libmythdb/mythsystem.h
  75. +809 −0 mythtv/libs/libmythdb/system-unix.cpp
  76. +100 −0 mythtv/libs/libmythdb/system-unix.h
  77. +713 −0 mythtv/libs/libmythdb/system-windows.cpp
  78. +103 −0 mythtv/libs/libmythdb/system-windows.h
  79. +14 −11 mythtv/libs/libmythmetadata/metadatadownload.cpp
  80. +5 −7 mythtv/libs/libmythmetadata/parentalcontrols.cpp
  81. +2 −118 mythtv/libs/libmythtv/avformatdecoder.cpp
  82. +11 −10 mythtv/libs/libmythtv/channelbase.cpp
  83. +7 −5 mythtv/libs/libmythtv/channelbase.h
  84. +49 −108 mythtv/libs/libmythtv/datadirect.cpp
  85. +5 −5 mythtv/libs/libmythtv/datadirect.h
  86. +4 −4 mythtv/libs/libmythtv/jobqueue.cpp
  87. +2 −1 mythtv/libs/libmythtv/mythsystemevent.cpp
  88. +6 −4 mythtv/libs/libmythtv/previewgenerator.cpp
  89. +0 −6 mythtv/libs/libmythtv/subtitlescreen.cpp
  90. +1 −5 mythtv/libs/libmythtv/textsubtitleparser.h
  91. +71 −5 mythtv/libs/libmythtv/tv_play.cpp
  92. +0 −1 mythtv/libs/libmythtv/tv_play.h
  93. +25 −33 mythtv/libs/libmythtv/videosource.cpp
  94. +4 −9 mythtv/libs/libmythui/lirc.cpp
  95. +5 −3 mythtv/libs/libmythui/lirc_client.c
  96. 0 mythtv/libs/libmythupnp/upnpexp.h
  97. +35 −48 mythtv/programs/mythbackend/httpstatus.cpp
  98. +7 −5 mythtv/programs/mythbackend/mythxml.cpp
  99. +8 −8 mythtv/programs/mythbackend/scheduler.cpp
  100. +6 −3 mythtv/programs/mythcommflag/TemplateFinder.cpp
  101. +49 −88 mythtv/programs/mythfilldatabase/filldata.cpp
  102. +2 −17 mythtv/programs/mythfrontend/main.cpp
  103. +2 −10 mythtv/programs/mythshutdown/main.cpp
  104. +14 −0 mythtv/programs/mythtranscode/mpeg2fix.cpp
  105. +0 −1 mythtv/programs/mythtranscode/mythtranscode.pro
  106. +0 −2 mythtv/programs/mythtranscode/replex/replex.pro
  107. +26 −39 mythtv/programs/mythwelcome/welcomedialog.cpp
  108. +0 −1 mythtv/themes/MythCenter-wide/base.xml
  109. +2 −1 mythtv/themes/MythCenter-wide/menu-ui.xml
  110. +1 −1 mythtv/themes/MythCenter-wide/video-ui.xml
  111. +0 −1 mythtv/themes/MythCenter/base.xml
  112. +2 −1 mythtv/themes/MythCenter/menu-ui.xml
  113. 0 mythtv/themes/default/htmls/notfound.html
  114. BIN mythtv/themes/default/progressbar_fill2.png
  115. 0 mythtv/themes/mythuitheme.xsd
2 README
@@ -0,0 +1,2 @@
Empty README.

@@ -20,6 +20,8 @@ using namespace std;
#include <mythmainwindow.h>
#include <mythdialogbox.h>
#include <util.h>
#include <mythsystem.h>
#include <exitcodes.h>

// mytharchive
#include "archiveutil.h"
@@ -102,7 +104,7 @@ void checkTempDirectory()
if (!dir.exists())
{
dir.mkdir(tempDir);
if( !chmod(qPrintable(tempDir), 0777) )
if( chmod(qPrintable(tempDir), 0777) )
VERBOSE(VB_IMPORTANT, QString("Failed to change permissions on archive directory: %1")
.arg(strerror(errno)));
}
@@ -111,7 +113,7 @@ void checkTempDirectory()
if (!dir.exists())
{
dir.mkdir(workDir);
if( !chmod(qPrintable(workDir), 0777) )
if( chmod(qPrintable(workDir), 0777) )
VERBOSE(VB_IMPORTANT, QString("Failed to change permissions on archive work directory: %1")
.arg(strerror(errno)));
}
@@ -120,7 +122,7 @@ void checkTempDirectory()
if (!dir.exists())
{
dir.mkdir(logDir);
if( !chmod(qPrintable(logDir), 0777) )
if( chmod(qPrintable(logDir), 0777) )
VERBOSE(VB_IMPORTANT, QString("Failed to change permissions on archive log directory: %1")
.arg(strerror(errno)));

@@ -129,7 +131,7 @@ void checkTempDirectory()
if (!dir.exists())
{
dir.mkdir(configDir);
if( !chmod(qPrintable(configDir), 0777) )
if( chmod(qPrintable(configDir), 0777) )
VERBOSE(VB_IMPORTANT, QString("Failed to change permissions on archive config directory: %1")
.arg(strerror(errno)));
}
@@ -233,16 +235,14 @@ bool getFileDetails(ArchiveItem *a)
inFile.replace("\"", "\\\"");
inFile.replace("`", "\\`");

QString outFile = tempDir + "/work/file.xml";
QString outFile = tempDir + "work/file.xml";

// call mytharchivehelper to get files stream info etc.
QString command = QString("mytharchivehelper -i \"%1\" \"%2\" %3 > /dev/null 2>&1")
.arg(inFile).arg(outFile).arg(lenMethod);

int res = system(qPrintable(command));
if (WIFEXITED(res))
res = WEXITSTATUS(res);
if (res != 0)
uint flags = kMSDontBlockInputDevs | kMSDontDisableDrawing;
if (myth_system(command, flags) != GENERIC_EXIT_OK)
return false;

QDomDocument doc("mydocument");
@@ -22,6 +22,8 @@
#include <mythuibuttonlist.h>
#include <mythuiprogressbar.h>
#include <mythmainwindow.h>
#include <mythsystem.h>
#include <exitcodes.h>

// mytharchive
#include "exportnative.h"
@@ -464,17 +466,17 @@ void ExportNative::runScript()
commandline = "mytharchivehelper -n " + configDir + "/mydata.xml"; // job file
commandline += " > " + logDir + "/progress.log 2>&1 &"; // Logs

int state = system(qPrintable(commandline));

if (state != 0)
uint flags = kMSRunBackground | kMSDontBlockInputDevs |
kMSDontDisableDrawing;
uint retval = myth_system(commandline, flags);
if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
{
ShowOkPopup(QObject::tr("It was not possible to create the DVD. "
"An error occured when running the scripts") );
return;
}
else
{
showLogViewer();
}

showLogViewer();
}

void ExportNative::handleAddRecording()
@@ -16,6 +16,8 @@
#include <mythuibutton.h>
#include <mythuibuttonlist.h>
#include <mythdialogbox.h>
#include <mythsystem.h>
#include <exitcodes.h>

// mytharchive
#include "importnative.h"
@@ -426,16 +428,17 @@ void ImportNative::finishedPressed()
commandline = "mytharchivehelper -f \"" + m_xmlFile + "\" " + chanID;
commandline += " > " + logDir + "/progress.log 2>&1 &";

int state = system(qPrintable(commandline));

if (state != 0)
uint flags = kMSRunBackground | kMSDontBlockInputDevs |
kMSDontDisableDrawing;
uint retval = myth_system(commandline, flags);
if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
{
ShowOkPopup(tr("It was not possible to import the Archive. "
" An error occured when running 'mytharchivehelper'") );
return;
}
else
showLogViewer();

showLogViewer();

m_previousScreen->Close();
Close();
@@ -153,12 +153,14 @@ void LogViewer::updateLogItem(MythUIButtonListItem *item)
void LogViewer::cancelClicked(void)
{
QString tempDir = gCoreContext->GetSetting("MythArchiveTempDir", "");
QFile lockFile(tempDir + "/logs/mythburncancel.lck");

QString command("echo Cancel > " + tempDir + "/logs/mythburncancel.lck");
int res = system(qPrintable(command));
if (WIFEXITED(res) == 0)
if (!lockFile.open(QIODevice::WriteOnly | QIODevice::Truncate))
VERBOSE(VB_IMPORTANT, "LogViewer: Failed to create mythburncancel.lck file");

lockFile.write("Cancel\n\r");
lockFile.close();

ShowOkPopup(QObject::tr("Background creation has been asked to stop.\n"
"This may take a few minutes."));
}
@@ -25,6 +25,9 @@
#include <mythuicheckbox.h>
#include <mythuibuttonlist.h>
#include <mythuiprogressbar.h>
#include <util.h>
#include <mythsystem.h>
#include <exitcodes.h>

// mytharchive
#include "archiveutil.h"
@@ -36,6 +39,8 @@
#include "videoselector.h"
#include "logviewer.h"

using namespace std;

MythBurn::MythBurn(MythScreenStack *parent,
MythScreenType *destinationScreen,
MythScreenType *themeScreen,
@@ -49,12 +54,8 @@ MythBurn::MythBurn(MythScreenStack *parent,
// remove any old thumb images
QString thumbDir = getTempDirectory() + "/config/thumbs";
QDir dir(thumbDir);
if (dir.exists())
{
int res = system(qPrintable("rm -rf " + thumbDir));
if (!WIFEXITED(res) || WEXITSTATUS(res))
VERBOSE(VB_IMPORTANT, "MythBurn: Failed to clear thumb directory");
}
if (dir.exists() && !RemoveDirectory(dir))
VERBOSE(VB_IMPORTANT, "MythBurn: Failed to clear thumb directory");

m_bCreateISO = false;
m_bDoBurn = false;
@@ -942,9 +943,10 @@ void MythBurn::runScript()

gCoreContext->SaveSetting("MythArchiveLastRunStatus", "Running");

int state = system(qPrintable(commandline));

if (state != 0)
uint flags = kMSRunBackground | kMSDontBlockInputDevs |
kMSDontDisableDrawing;
uint retval = myth_system(commandline, flags);
if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
{
ShowOkPopup(tr("It was not possible to create the DVD. "
" An error occured when running the scripts"));
@@ -1195,9 +1197,11 @@ void BurnMenu::doBurn(int mode)
commandline = "mytharchivehelper -b " + sArchiveFormat +
" " + sEraseDVDRW + " " + sNativeFormat;
commandline += " > " + logDir + "/progress.log 2>&1 &";
int state = system(qPrintable(commandline));

if (state != 0)
uint flags = kMSRunBackground | kMSDontBlockInputDevs |
kMSDontDisableDrawing;
uint retval = myth_system(commandline, flags);
if (retval != GENERIC_EXIT_RUNNING && retval != GENERIC_EXIT_OK)
{
showWarningDialog(QObject::tr("It was not possible to run "
"mytharchivehelper to burn the DVD."));
@@ -116,7 +116,7 @@ bool RecordingSelector::Create(void)

void RecordingSelector::Init(void)
{
QString message = tr("Retrieving Recording List.\nPlease Wait...");
QString message = tr("Retrieving Recording List. Please Wait...");

MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");

@@ -352,22 +352,20 @@ QString ThumbFinder::createThumbDir(void)
if (!dir.exists())
{
dir.mkdir(thumbDir);
if( !chmod(qPrintable(thumbDir), 0777) )
if( chmod(qPrintable(thumbDir), 0777) )
VERBOSE(VB_IMPORTANT, QString("ThumbFinder: Failed to change permissions on thumb directory: %1")
.arg(strerror(errno)));
}

int x = 0;
QString path;
do
for (int x = 1; dir.exists(); x++)
{
x++;
path = QString(thumbDir + "/%1").arg(x);
dir.setPath(path);
} while (dir.exists());
}

dir.mkdir(path);
if( !chmod(qPrintable(path), 0777) )
if( chmod(qPrintable(path), 0777) )
VERBOSE(VB_IMPORTANT, QString("ThumbFinder: Failed to change permissions on thumb directory: %1")
.arg(strerror(errno)));

@@ -28,12 +28,8 @@ VideoSelector::VideoSelector(MythScreenStack *parent, QList<ArchiveItem *> *arch
:MythScreenType(parent, "VideoSelector")
{
m_archiveList = archiveList;
m_currentParentalLevel = ParentalLevel::plNone;
m_currentParentalLevel = 1;
m_videoList = NULL;

m_parentalLevelChecker = new ParentalLevelChangeChecker();
connect(m_parentalLevelChecker, SIGNAL(SigResultReady(bool, ParentalLevel::Level)),
this, SLOT(parentalLevelChanged(bool, ParentalLevel::Level)));
}

VideoSelector::~VideoSelector(void)
@@ -44,8 +40,6 @@ VideoSelector::~VideoSelector(void)
while (!m_selectedList.isEmpty())
delete m_selectedList.takeFirst();
m_selectedList.clear();

delete m_parentalLevelChecker;
}

bool VideoSelector::Create(void)
@@ -92,8 +86,6 @@ bool VideoSelector::Create(void)

SetFocusWidget(m_videoButtonList);

setParentalLevel(ParentalLevel::plLowest);

updateSelectedList();
updateVideoList();

@@ -120,19 +112,19 @@ bool VideoSelector::keyPressEvent(QKeyEvent *event)
}
else if (action == "1")
{
setParentalLevel(ParentalLevel::plLowest);
setParentalLevel(1);
}
else if (action == "2")
{
setParentalLevel(ParentalLevel::plLow);
setParentalLevel(2);
}
else if (action == "3")
{
setParentalLevel(ParentalLevel::plMedium);
setParentalLevel(3);
}
else if (action == "4")
{
setParentalLevel(ParentalLevel::plHigh);
setParentalLevel(4);
}
else
handled = false;
@@ -529,20 +521,79 @@ void VideoSelector::updateSelectedList()
}
}

void VideoSelector::setParentalLevel(ParentalLevel::Level level)
void VideoSelector::setParentalLevel(int which_level)
{
m_parentalLevelChecker->Check(m_currentParentalLevel, level);
if (which_level < 1)
which_level = 1;

if (which_level > 4)
which_level = 4;

if ((which_level > m_currentParentalLevel) && !checkParentPassword())
which_level = m_currentParentalLevel;


if (m_currentParentalLevel != which_level)
{
m_currentParentalLevel = which_level;
updateVideoList();
m_plText->SetText(QString::number(which_level));
}
}

void VideoSelector::parentalLevelChanged(bool passwordValid, ParentalLevel::Level newLevel)
bool VideoSelector::checkParentPassword()
{
if (passwordValid)
QDateTime curr_time = QDateTime::currentDateTime();
QString last_time_stamp = gCoreContext->GetSetting("VideoPasswordTime");
QString password = gCoreContext->GetSetting("VideoAdminPassword");
if (password.length() < 1)
{
m_currentParentalLevel = newLevel;
updateVideoList();
m_plText->SetText(QString::number(newLevel));
return true;
}

// See if we recently (and succesfully) asked for a password
if (last_time_stamp.length() < 1)
{
// Probably first time used
}
else
ShowOkPopup(tr("You need to enter a valid password for this parental level"));
{
QDateTime last_time = QDateTime::fromString(last_time_stamp,
Qt::TextDate);
if (last_time.secsTo(curr_time) < 120)
{
// Two minute window
last_time_stamp = curr_time.toString(Qt::TextDate);
gCoreContext->SetSetting("VideoPasswordTime", last_time_stamp);
gCoreContext->SaveSetting("VideoPasswordTime", last_time_stamp);
return true;
}
}

// See if there is a password set
if (password.length() > 0)
{
bool ok = false;
MythPasswordDialog *pwd = new MythPasswordDialog(tr("Parental Pin:"),
&ok,
password,
GetMythMainWindow());
pwd->exec();
pwd->deleteLater();
if (ok)
{
// All is good
last_time_stamp = curr_time.toString(Qt::TextDate);
gCoreContext->SetSetting("VideoPasswordTime", last_time_stamp);
gCoreContext->SaveSetting("VideoPasswordTime", last_time_stamp);
return true;
}
}
else
{
return true;
}

return false;
}

0 comments on commit 0f063f5

Please sign in to comment.
You can’t perform that action at this time.