mirror of
https://github.com/cmclark00/retro-imager.git
synced 2025-05-18 07:55:21 +01:00
Shift+Ctrl+X option screen: allow persisting settings
This commit is contained in:
parent
a6150f7bc5
commit
abbed47f97
6 changed files with 355 additions and 34 deletions
|
@ -926,6 +926,45 @@ QString ImageWriter::crypt(const QByteArray &password)
|
|||
return sha256_crypt(password.constData(), salt.constData());
|
||||
}
|
||||
|
||||
void ImageWriter::setSavedCustomizationSettings(const QVariantMap &map)
|
||||
{
|
||||
_settings.beginGroup("imagecustomization");
|
||||
_settings.remove("");
|
||||
for (QString key : map.keys()) {
|
||||
_settings.setValue(key, map.value(key));
|
||||
}
|
||||
_settings.endGroup();
|
||||
}
|
||||
|
||||
QVariantMap ImageWriter::getSavedCustomizationSettings()
|
||||
{
|
||||
QVariantMap result;
|
||||
|
||||
_settings.beginGroup("imagecustomization");
|
||||
for (QString key : _settings.childKeys()) {
|
||||
result.insert(key, _settings.value(key));
|
||||
}
|
||||
_settings.endGroup();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void ImageWriter::clearSavedCustomizationSettings()
|
||||
{
|
||||
_settings.beginGroup("imagecustomization");
|
||||
_settings.remove("");
|
||||
_settings.endGroup();
|
||||
}
|
||||
|
||||
bool ImageWriter::hasSavedCustomizationSettings()
|
||||
{
|
||||
_settings.beginGroup("imagecustomization");
|
||||
bool result = !_settings.childKeys().isEmpty();
|
||||
_settings.endGroup();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void MountUtilsLog(std::string msg) {
|
||||
qDebug() << "mountutils:" << msg.c_str();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue