Ticket #13295: 20180703_1716_startup_screen.patch

File 20180703_1716_startup_screen.patch, 4.4 KB (added by Peter Bennett, 3 years ago)

Fix for this problem

  • mythtv/libs/libmyth/mythcontext.cpp

    diff --git a/mythtv/libs/libmyth/mythcontext.cpp b/mythtv/libs/libmyth/mythcontext.cpp
    index 130f4ec93fb..183b4884b20 100644
    a b void MythContextPrivate::TempMainWindow(bool languagePrompt) 
    292292
    293293    SilenceDBerrors();
    294294
    295     loadSettingsCacheOverride();
    296 
    297295#ifdef Q_OS_MAC
    298296    // Qt 4.4 has window-focus problems
    299297    gCoreContext->OverrideSettingForSession("RunFrontendInWindow", "1");
    bool MythContextPrivate::Init(const bool gui, 
    353351{
    354352    gCoreContext->GetDB()->IgnoreDatabase(ignoreDB);
    355353    m_gui = gui;
     354    loadSettingsCacheOverride();
    356355
    357356    if (gCoreContext->IsFrontend())
    358357        needsBackend = true;
    QString MythContextPrivate::TestDBconnection(bool prompt) 
    848847        {"start","dbAwake","dbStarted","dbConnects","beWOL","beAwake",
    849848            "success" };
    850849
     850    int msStartupScreenDelay = gCoreContext->GetNumSetting("StartupScreenDelay",2);
     851    if (msStartupScreenDelay > 0)
     852        msStartupScreenDelay *= 1000;
    851853    do
    852854    {
     855        QElapsedTimer timer;
     856        timer.start();
    853857        if (m_DBparams.dbHostName.isNull() && m_DBhostCp.length())
    854858            host = m_DBhostCp;
    855859        else
    QString MythContextPrivate::TestDBconnection(bool prompt) 
    892896            // After that show the GUI (if this is a GUI program)
    893897
    894898            LOG(VB_GENERAL, LOG_INFO,
    895                  QString("Start up testing connections. DB %1, BE %2, attempt %3, status %4")
    896                       .arg(host).arg(backendIP).arg(attempt).arg(guiStatuses[startupState]));
     899                 QString("Start up testing connections. DB %1, BE %2, attempt %3, status %4, Delay: %5")
     900                      .arg(host).arg(backendIP).arg(attempt).arg(guiStatuses[startupState]).arg(msStartupScreenDelay) );
    897901
    898902            int useTimeout = wakeupTime;
    899903            if (attempt == 0)
    QString MythContextPrivate::TestDBconnection(bool prompt) 
    901905
    902906            if (m_gui && !m_guiStartup)
    903907            {
    904                 if (attempt > 0)
     908                if (msStartupScreenDelay==0 || timer.hasExpired(msStartupScreenDelay))
    905909                {
    906910                    ShowGuiStartup();
    907911                    if (m_guiStartup)
    QString MythContextPrivate::TestDBconnection(bool prompt) 
    10181022             QString("Start up failure. host %1, status %2")
    10191023                  .arg(host).arg(stateMsg));
    10201024
     1025        if (m_gui && !m_guiStartup)
     1026        {
     1027            ShowGuiStartup();
     1028            if (m_guiStartup)
     1029                m_guiStartup->setTotal(progressTotal);
     1030        }
     1031
    10211032        if (m_guiStartup
    10221033          && !m_guiStartup->m_Exit
    10231034          && !m_guiStartup->m_Setup
    void MythContextPrivate::processEvents(void) 
    14721483const QString MythContextPrivate::settingsToSave[] =
    14731484{ "Theme", "Language", "Country", "GuiHeight",
    14741485  "GuiOffsetX", "GuiOffsetY", "GuiWidth", "RunFrontendInWindow",
    1475   "AlwaysOnTop", "HideMouseCursor", "ThemePainter", "libCECEnabled" };
     1486  "AlwaysOnTop", "HideMouseCursor", "ThemePainter", "libCECEnabled",
     1487  "StartupScreenDelay" };
    14761488
    14771489
    14781490bool MythContextPrivate::saveSettingsCache(void)
  • mythtv/programs/mythfrontend/globalsettings.cpp

    diff --git a/mythtv/programs/mythfrontend/globalsettings.cpp b/mythtv/programs/mythfrontend/globalsettings.cpp
    index 2523fd133a4..68485cb19e9 100644
    a b static HostCheckBoxSetting *AlwaysOnTop() 
    24262426    return gc;
    24272427}
    24282428
     2429static HostSpinBoxSetting *StartupScreenDelay()
     2430{
     2431    HostSpinBoxSetting *gs = new HostSpinBoxSetting("StartupScreenDelay", -1, 60, 1, 1, "Never show startup screen");
     2432
     2433    gs->setLabel(AppearanceSettings::tr("Startup Screen Delay"));
     2434
     2435    gs->setValue(2);
     2436
     2437    gs->setHelpText(AppearanceSettings::tr(
     2438        "The Startup Screen will show the progress of starting the frontend "
     2439        "if frontend startup takes longer than this number of seconds."));
     2440    return gs;
     2441}
     2442
     2443
    24292444static HostComboBoxSetting *MythDateFormatCB()
    24302445{
    24312446    HostComboBoxSetting *gc = new HostComboBoxSetting("DateFormat");
    AppearanceSettings::AppearanceSettings() 
    42554270    screen->addChild(RunInWindow());
    42564271    screen->addChild(UseFixedWindowSize());
    42574272    screen->addChild(AlwaysOnTop());
     4273    screen->addChild(StartupScreenDelay());
    42584274#ifdef USING_AIRPLAY
    42594275    screen->addChild(AirPlayFullScreen());
    42604276#endif