Added confirmation for Upload (#2037)

This commit is contained in:
Dearsh Oberoi
2021-11-09 01:03:50 +05:30
committed by GitHub
parent 445a4c68e8
commit df5d99321a
9 changed files with 99 additions and 0 deletions

View File

@@ -44,6 +44,7 @@ GeneralConf::GeneralConf(QWidget* parent)
initCopyAndCloseAfterUpload();
initCopyPathAfterSave();
initAntialiasingPinZoom();
initUploadWithoutConfirmation();
initUseJpgForClipboard();
initSaveAfterCopy();
inituploadHistoryMax();
@@ -68,6 +69,7 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
m_copyPathAfterSave->setChecked(config.copyPathAfterSave());
m_antialiasingPinZoom->setChecked(config.antialiasingPinZoom());
m_useJpgForClipboard->setChecked(config.useJpgForClipboard());
m_uploadWithoutConfirmation->setChecked(config.uploadWithoutConfirmation());
m_historyConfirmationToDelete->setChecked(
config.historyConfirmationToDelete());
m_checkForUpdates->setChecked(config.checkForUpdates());
@@ -531,6 +533,18 @@ void GeneralConf::initAntialiasingPinZoom()
});
}
void GeneralConf::initUploadWithoutConfirmation()
{
m_uploadWithoutConfirmation =
new QCheckBox(tr("Upload to Imgur without confirmation"), this);
m_uploadWithoutConfirmation->setToolTip(
tr("Upload to Imgur without confirmation"));
m_scrollAreaLayout->addWidget(m_uploadWithoutConfirmation);
connect(m_uploadWithoutConfirmation, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setUploadWithoutConfirmation(checked);
});
}
const QString GeneralConf::chooseFolder(const QString pathDefault)
{
QString path;