Go to the documentation of this file.
13 #include <QApplication>
48 bool bOK =
file.open(QIODevice::ReadOnly);
52 LOG(VB_GENERAL, LOG_ERR,
53 QString(
"Unable to open file %1").arg(lockFile));
58 QString line(
file.readLine(100));
60 pid_t pid = line.toInt(&bOK);
64 LOG(VB_GENERAL, LOG_ERR,
65 QString(
"Got bad PID '%1' from lock file").arg(pid));
69 LOG(VB_GENERAL, LOG_NOTICE,
70 QString(
"Checking if PID %1 is still running").arg(pid));
72 if (kill(pid, 0) == -1)
93 "Found a lock file but the owning process isn't running!\n"
94 "Removing stale lock file."));
97 LOG(VB_GENERAL, LOG_ERR,
98 QString(
"Failed to remove stale lock file - %1")
119 QString logDir = tempDir +
"logs";
145 QString logDir = tempDir +
"logs";
175 QString logDir = tempDir +
"logs";
190 if (selector->Create())
204 "Last run did not create a playable DVD."));
211 "Last run failed to create a DVD."));
220 QString
filename = tempDir +
"work/dvd";
223 if ((command.indexOf(
"internal", 0, Qt::CaseInsensitive) > -1) ||
224 (command.length() < 1))
227 command =
"Internal";
232 if (command.contains(
"%f"))
233 command = command.replace(
"%f",
filename);
251 QString sel = selection.toLower();
253 if (sel ==
"archive_create_dvd")
255 else if (sel ==
"archive_create_archive")
257 else if (sel ==
"archive_encode_video")
259 else if (sel ==
"archive_import_video")
261 else if (sel ==
"archive_last_log")
263 else if (sel ==
"archive_test_dvd")
265 else if (sel ==
"archive_burn_dvd")
284 mainMenu = qobject_cast<MythThemedMenu *>(parentObject);
286 if (mainMenu && mainMenu->objectName() ==
"mainmenu")
289 parentObject = parentObject->parent();
309 if (diag->foundTheme())
315 LOG(VB_GENERAL, LOG_ERR, QString(
"Couldn't find menu %1 or theme %2")
323 REG_KEY(
"Archive",
"TOGGLECUT", QT_TRANSLATE_NOOP(
"MythControls",
324 "Toggle use cut list state for selected program"),
"C");
326 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Create DVD"),
328 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Create Archive"),
330 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Import Archive"),
332 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"View Archive Log"),
334 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Play Created DVD"),
336 REG_JUMP(QT_TRANSLATE_NOOP(
"MythControls",
"Burn DVD"),
345 LOG(VB_GENERAL, LOG_ERR,
"Test Popup Version Failed");
352 LOG(VB_GENERAL, LOG_ERR,
353 "Couldn't upgrade database to new schema, exiting.");
369 return runMenu(
"archivemenu.xml");
MythScreenStack * GetMainStack()
static void REG_KEY(const QString &Context, const QString &Action, const QString &Description, const QString &Key)
static void runTestDVD(void)
static bool checkProcess(const QString &lockFile)
static int runMenu(const QString &which_menu)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static bool TestPluginVersion(const QString &name, const QString &libversion, const QString &pluginversion)
static bool checkLockFile(const QString &lockFile)
uint myth_system(const QString &command, uint flags, std::chrono::seconds timeout)
QString getTempDirectory(bool showError)
static void runCreateDVD(void)
int mythplugin_config(void)
static void initKeys(void)
bool HandleMedia(const QString &Handler, const QString &Mrl, const QString &Plot="", const QString &Title="", const QString &Subtitle="", const QString &Director="", int Season=0, int Episode=0, const QString &Inetref="", std::chrono::minutes LenMins=2h, const QString &Year="1895", const QString &Id="", bool UseBookmarks=false)
static void(* m_callback)(void *, QString &)
static void runImportVideo(void)
void showWarningDialog(const QString &msg)
static MythThemedMenu * menu
static void runCreateArchive(void)
static void * m_callbackdata
void checkTempDirectory()
static constexpr const char * MYTH_BINARY_VERSION
Update this whenever the plug-in ABI changes.
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
int mythplugin_init(const char *libversion)
static void runEncodeVideo(void)
static void runShowLog(void)
static void REG_JUMP(const QString &Destination, const QString &Description, const QString &Key, void(*Callback)(void))
MythMainWindow * GetMythMainWindow(void)
bool UpgradeArchiveDatabaseSchema(void)
void ActivateSettingsCache(bool activate=true)
static void ArchiveCallback(void *data, QString &selection)
MythUIHelper * GetMythUI()
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
QString GetSetting(const QString &key, const QString &defaultval="")
virtual MythScreenType * GetTopScreen(void) const
static void runBurnDVD(void)