23 #include "cfgwadseekergeneral.h"
24 #include "ui_cfgwadseekergeneral.h"
26 #include "configuration/doomseekerconfig.h"
27 #include "pathfinder/filesearchpath.h"
31 #include <QMessageBox>
33 DClass<CFGWadseekerGeneral> :
public Ui::CFGWadseekerGeneral
45 d->widgetTimeouts->setVisible(
false);
47 d->cbTargetDirectory->setCompleter(
new QCompleter(
new QDirModel()));
50 CFGWadseekerGeneral::~CFGWadseekerGeneral()
54 void CFGWadseekerGeneral::fillTargetDirectoryComboBox()
56 d->cbTargetDirectory->clear();
57 d->cbTargetDirectory->addItems(gConfig.doomseeker.wadPathsOnly());
62 fillTargetDirectoryComboBox();
64 d->cbTargetDirectory->setEditText(gConfig.wadseeker.targetDirectory);
65 d->spinConnectTimeout->setValue(gConfig.wadseeker.connectTimeoutSeconds);
66 d->spinDownloadTimeout->setValue(gConfig.wadseeker.downloadTimeoutSeconds);
67 d->spinMaxConcurrentSiteSeeks->setValue(gConfig.wadseeker.maxConcurrentSiteDownloads);
68 d->spinMaxConcurrentWadDownloads->setValue(gConfig.wadseeker.maxConcurrentWadDownloads);
73 gConfig.wadseeker.targetDirectory = d->cbTargetDirectory->currentText();
75 QFileInfo targetDirectoryInfo(d->cbTargetDirectory->currentText());
76 if(!targetDirectoryInfo.isWritable())
78 QMessageBox::warning(
this, tr(
"Wadseeker - error"),
79 tr(
"The target directory you selected for Wadseeker can not be written to."));
85 bool pathPossible =
false;
87 QFileInfo wadseekerTargetDirectoryFileInfo(d->cbTargetDirectory->currentText());
93 QFileInfo possiblePathFileInfo(possiblePath.path());
95 if (possiblePathFileInfo == wadseekerTargetDirectoryFileInfo)
104 QMessageBox::warning(
this, tr(
"Wadseeker - error"),
105 tr(
"The specified target directory for Wadseeker could not be found on the file (WAD) paths list.\n\n"
106 "Doomseeker will automatically add this path to the file search paths."));
110 gConfig.wadseeker.connectTimeoutSeconds = d->spinConnectTimeout->value();
111 gConfig.wadseeker.downloadTimeoutSeconds = d->spinDownloadTimeout->value();
112 gConfig.wadseeker.maxConcurrentSiteDownloads = d->spinMaxConcurrentSiteSeeks->value();
113 gConfig.wadseeker.maxConcurrentWadDownloads = d->spinMaxConcurrentWadDownloads->value();
void saveSettings()
Reimplement this to write settings to config from widgets.
void readSettings()
Reimplement this to read settings from config into widgets.
Base class for configuration pages.