23 #include "cfgautoupdates.h" 24 #include "ui_cfgautoupdates.h" 26 #include "configuration/doomseekerconfig.h" 27 #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())
104 else if (d->rbNotifyButDontInstall->isChecked())
108 else if (d->rbInstallAutomatically->isChecked())
114 assert(
false &&
"CFGAutoUpdates::saveSettings() - No radio button is checked.");
116 gConfig.autoUpdates.updateChannelName = d->cboUpdateChannel->itemData(
117 d->cboUpdateChannel->currentIndex()).toString();
118 gConfig.doomseeker.bIP2CountryAutoUpdate = d->cbIp2cAutoUpdate->isChecked();
void saveSettings()
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.
QString name() const
Reimplement this to return a list-displayable name for this ConfigPage.
Update is fully automatic.
void readSettings()
Reimplement this to read settings from config into widgets.
static UpdateChannel mkStable()
Creates "stable" channel object.
User is only notified of the update and decides if it should be installed.
Base class for configuration pages.