Ticket #10135: jumppoint.patch

File jumppoint.patch, 2.9 KB (added by [R] <ginsu.squirrel@…>, 12 years ago)
  • mythtv/programs/mythfrontend/commandlineparser.cpp

    diff --git a/mythtv/programs/mythfrontend/commandlineparser.cpp b/mythtv/programs/mythfrontend/commandlineparser.cpp
    index 7321510..fed9eca 100644
    a b void MythFrontendCommandLineParser::LoadArguments(void) 
    2929        "Always prompt for backend selection.", "");
    3030    add(QStringList( QStringList() << "-d" << "--disable-autodiscovery" ),
    3131        "noautodiscovery", false, "Prevent frontend from using UPnP autodiscovery.", "");
     32    add("--jumppoint", "jumppoint", "", "Start the frontend at a Jump Point.", "")
     33        ->SetBlocks("runplugin")->SetGroup("Startup Behavior");
     34    add("--runplugin", "runplugin", "", "Run a plugin right away.", "")
     35        ->SetBlocks("jumppoint")->SetGroup("Startup Behavior");
    3236}
    3337
    3438QString MythFrontendCommandLineParser::GetHelpHeader(void) const
  • mythtv/programs/mythfrontend/main.cpp

    diff --git a/mythtv/programs/mythfrontend/main.cpp b/mythtv/programs/mythfrontend/main.cpp
    index 599f493..054c897 100644
    a b int main(int argc, char **argv) 
    14631463    new QApplication(argc, argv);
    14641464    QCoreApplication::setApplicationName(MYTH_APPNAME_MYTHFRONTEND);
    14651465
    1466     QString pluginname;
    1467 
    1468     QFileInfo finfo(qApp->argv()[0]);
    1469     QString binname = finfo.baseName();
    1470 
    14711466    int retval;
    14721467    if ((retval = cmdline.ConfigureLogging()) != GENERIC_EXIT_OK)
    14731468        return retval;
    14741469
    14751470    bool ResetSettings = false;
    14761471
    1477     if (binname.toLower() != "mythfrontend")
    1478         pluginname = binname;
    1479 
    14801472    if (cmdline.toBool("prompt"))
    14811473        bPromptForBackend = true;
    14821474    if (cmdline.toBool("noautodiscovery"))
    int main(int argc, char **argv) 
    15241516    if (cmdline.toBool("reset"))
    15251517        ResetSettings = true;
    15261518
    1527     if (cmdline.GetArgs().size() >= 1)
    1528         pluginname = cmdline.GetArgs()[0];
    1529 
    15301519    QString fileprefix = GetConfDir();
    15311520
    15321521    QDir dir(fileprefix);
    int main(int argc, char **argv) 
    16141603    pmanager = new MythPluginManager();
    16151604    gContext->SetPluginManager(pmanager);
    16161605
    1617     if (pluginname.size())
     1606    if (cmdline.toBool("runplugin") && !cmdline.toString("runplugin").isEmpty())
    16181607    {
    1619         if (pmanager->run_plugin(pluginname) ||
    1620             pmanager->run_plugin("myth" + pluginname))
     1608        if (!pmanager->run_plugin(cmdline.toString("runplugin")) ||
     1609            !pmanager->run_plugin("myth" + cmdline.toString("runplugin")))
    16211610        {
    16221611            qApp->exec();
    16231612
    int main(int argc, char **argv) 
    16791668    PreviewGeneratorQueue::CreatePreviewGeneratorQueue(
    16801669        PreviewGenerator::kRemote, 50, 60);
    16811670
     1671    if (cmdline.toBool("jumppoint") && !cmdline.toString("jumppoint").isEmpty())
     1672    {
     1673        GetMythMainWindow()->JumpTo(cmdline.toString("jumppoint"), false);
     1674    }
     1675
    16821676    int ret = qApp->exec();
    16831677
    16841678    PreviewGeneratorQueue::TeardownPreviewGeneratorQueue();