Ticket #5316: mythtv-5316-disable_automatic_backups_setting.patch

File mythtv-5316-disable_automatic_backups_setting.patch, 1.7 KB (added by sphery <mtdean@…>, 16 years ago)
  • programs/mythtv-setup/backendsettings.cpp

     
    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
  • libs/libmyth/dbutil.cpp

     
    162162 */
    163163bool DBUtil::BackupDB(QString &filename)
    164164{
     165    filename = "";
     166    if (gContext->GetNumSetting("DisableAutomaticBackup", 0))
     167    {
     168        VERBOSE(VB_IMPORTANT, "Database backups disabled.  Skipping backup.");
     169        return true;
     170    }
     171
    165172    bool result = false;
    166173    MSqlQuery query(MSqlQuery::InitCon());
    167174