23 #include "cfgautoupdates.h" 24 #include "ui_cfgautoupdates.h" 26 #include "configuration/doomseekerconfig.h" 28 #include "updater/updatechannel.h" 31 DClass<CFGAutoUpdates> :
public Ui::CFGAutoUpdates
42 #ifndef WITH_AUTOUPDATES 43 d->programUpdateArea->hide();
45 layout()->setAlignment(Qt::AlignTop);
48 CFGAutoUpdates::~CFGAutoUpdates()
52 void CFGAutoUpdates::initUpdateChannels()
57 d->cboUpdateChannel->addItem(channel.translatedName(),
62 void CFGAutoUpdates::onUpdateChannelChange(
int index)
65 QString
name = d->cboUpdateChannel->itemData(index).toString();
67 d->pteChannelDescription->setPlainText(channel.translatedDescription());
74 switch (gConfig.autoUpdates.updateMode)
77 d->rbDisabled->setChecked(
true);
81 d->rbNotifyButDontInstall->setChecked(
true);
84 d->rbInstallAutomatically->setChecked(
true);
87 QString channelName = gConfig.autoUpdates.updateChannelName;
88 int channelIdx = d->cboUpdateChannel->findData(channelName);
94 d->cboUpdateChannel->setCurrentIndex(channelIdx);
95 d->cbIp2cAutoUpdate->setChecked(gConfig.doomseeker.bIP2CountryAutoUpdate);
100 if (d->rbDisabled->isChecked())
102 else if (d->rbNotifyButDontInstall->isChecked())
104 else if (d->rbInstallAutomatically->isChecked())
107 assert(
false &&
"CFGAutoUpdates::saveSettings() - No radio button is checked.");
108 gConfig.autoUpdates.updateChannelName = d->cboUpdateChannel->itemData(
109 d->cboUpdateChannel->currentIndex()).toString();
110 gConfig.doomseeker.bIP2CountryAutoUpdate = d->cbIp2cAutoUpdate->isChecked();
void saveSettings() override
Reimplement this to write settings to config from widgets.
static UpdateChannel fromName(const QString &name)
Creates object from its internal name.
static QList< UpdateChannel > allChannels()
List of all available channels.
Update is fully automatic.
void readSettings() override
Reimplement this to read settings from config into widgets.
static UpdateChannel mkStable()
Creates "stable" channel object.
QString name() const override
Reimplement this to return a list-displayable name for this ConfigPage.
User is only notified of the update and decides if it should be installed.
Base class for configuration pages.