Ticket #5316: mythtv-5316-disable_automatic_backups_setting-post_5286.patch

File mythtv-5316-disable_automatic_backups_setting-post_5286.patch, 1.7 KB (added by sphery <mtdean@…>, 12 years ago)

patch for use only after mythtv-5286-no_backup_for_new_database.patch (in #5286) is committed

  • libs/libmyth/dbutil.cpp

    old new  
    182182        return true;
    183183    }
    184184
     185    if (gContext->GetNumSetting("DisableAutomaticBackup", 0))
     186    {
     187        VERBOSE(VB_IMPORTANT, "Database backups disabled.  Skipping backup.");
     188        return true;
     189    }
     190
    185191    bool result = false;
    186192    MSqlQuery query(MSqlQuery::InitCon());
    187193
  • programs/mythtv-setup/backendsettings.cpp

    old new  
    165165    return bs;
    166166}
    167167
     168static GlobalCheckBox *DisableAutomaticBackup()
     169{
     170    GlobalCheckBox *gc = new GlobalCheckBox("DisableAutomaticBackup");
     171    gc->setLabel(QObject::tr("Disable Automatic Database Backup"));
     172    gc->setValue(false);
     173    gc->setHelpText(QObject::tr("This will prevent Myth from backing up the "
     174                                "database before upgrades.  If disabled, "
     175                                "you should have your own backup strategy "
     176                                "in place."));
     177    return gc;
     178};
     179
    168180static HostCheckBox *DisableFirewireReset()
    169181{
    170182    HostCheckBox *hc = new HostCheckBox("DisableFirewireReset");
     
    721733    fm->addChild(HDRingbufferSize());
    722734    group2->addChild(fm);
    723735    group2->addChild(MiscStatusScript());
     736    group2->addChild(DisableAutomaticBackup());
    724737    group2->addChild(DisableFirewireReset());
    725738    addChild(group2);
    726739