Ability to lock switching between s3 and imgur and use s3 only

This commit is contained in:
Yuriy Puchkov
2020-10-06 15:57:45 +03:00
parent 79ededbd99
commit 7d0d51efb5
5 changed files with 45 additions and 2 deletions

View File

@@ -17,6 +17,7 @@
#include "uploadstorageconfig.h"
#include "src/tools/storage/imgstorages.h"
#include "src/tools/storage/storagemanager.h"
#include "src/utils/confighandler.h"
#include <QCheckBox>
@@ -46,6 +47,13 @@ UploadStorageConfig::UploadStorageConfig(QWidget* parent)
ConfigHandler().setUploadStorage(SCREENSHOT_STORAGE_TYPE_S3);
});
StorageManager storageManager;
if (storageManager.storageLocked()) {
ConfigHandler().setUploadStorage(storageManager.storageDefault());
storageImgUr->setDisabled(true);
storageImgS3->setDisabled(true);
}
// set current storage radiobutton active
if (ConfigHandler().uploadStorage() == SCREENSHOT_STORAGE_TYPE_IMGUR) {
storageImgUr->setChecked(true);