Always show post upload actions (#2640)

This commit is contained in:
borgmanJeremy
2022-07-24 09:18:09 -05:00
committed by GitHub
parent a951f93da4
commit bd3431a9f5
5 changed files with 10 additions and 19 deletions

View File

@@ -76,7 +76,7 @@ void GeneralConf::_updateComponents(bool allowEmptySavePath)
m_sidePanelButton->setChecked(config.showSidePanelButton());
m_sysNotifications->setChecked(config.showDesktopNotification());
m_autostart->setChecked(config.startupLaunch());
m_copyAndCloseAfterUpload->setChecked(config.copyAndCloseAfterUpload());
m_copyURLAfterUpload->setChecked(config.copyURLAfterUpload());
m_saveAfterCopy->setChecked(config.saveAfterCopy());
m_copyPathAfterSave->setChecked(config.copyPathAfterSave());
m_antialiasingPinZoom->setChecked(config.antialiasingPinZoom());
@@ -438,14 +438,13 @@ void GeneralConf::initCopyOnDoubleClick()
void GeneralConf::initCopyAndCloseAfterUpload()
{
m_copyAndCloseAfterUpload =
new QCheckBox(tr("Copy URL after upload"), this);
m_copyAndCloseAfterUpload->setToolTip(
tr("Copy URL and close window after uploading was successful"));
m_scrollAreaLayout->addWidget(m_copyAndCloseAfterUpload);
m_copyURLAfterUpload = new QCheckBox(tr("Copy URL after upload"), this);
m_copyURLAfterUpload->setToolTip(
tr("Copy URL after uploading was successful"));
m_scrollAreaLayout->addWidget(m_copyURLAfterUpload);
connect(m_copyAndCloseAfterUpload, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setCopyAndCloseAfterUpload(checked);
connect(m_copyURLAfterUpload, &QCheckBox::clicked, [](bool checked) {
ConfigHandler().setCopyURLAfterUpload(checked);
});
}

View File

@@ -108,7 +108,7 @@ private:
QCheckBox* m_autoCloseIdleDaemon;
QCheckBox* m_autostart;
QCheckBox* m_showStartupLaunchMessage;
QCheckBox* m_copyAndCloseAfterUpload;
QCheckBox* m_copyURLAfterUpload;
QCheckBox* m_copyPathAfterSave;
QCheckBox* m_antialiasingPinZoom;
QCheckBox* m_saveLastRegion;

View File

@@ -395,15 +395,11 @@ void Flameshot::exportCapture(QPixmap capture,
CR::ExportTask tasks = tasks;
QObject::connect(
widget, &ImgUploaderBase::uploadOk, [=](const QUrl& url) {
if (ConfigHandler().copyAndCloseAfterUpload()) {
if (ConfigHandler().copyURLAfterUpload()) {
if (!(tasks & CR::COPY)) {
FlameshotDaemon::copyToClipboard(
url.toString(), tr("URL copied to clipboard."));
widget->close();
} else {
widget->showPostUploadDialog();
}
} else {
widget->showPostUploadDialog();
}
});

View File

@@ -37,12 +37,10 @@ ImgUploaderBase::ImgUploaderBase(const QPixmap& capture, QWidget* parent)
setWindowTitle(tr("Upload image"));
setWindowIcon(QIcon(GlobalValues::iconPath()));
#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
QRect position = frameGeometry();
QScreen* screen = QGuiApplication::screenAt(QCursor::pos());
position.moveCenter(screen->availableGeometry().center());
move(position.topLeft());
#endif
m_spinner = new LoadSpinner(this);
m_spinner->setColor(ConfigHandler().uiColor());

View File

@@ -97,9 +97,7 @@ public:
setShowStartupLaunchMessage,
bool)
CONFIG_GETTER_SETTER(contrastOpacity, setContrastOpacity, int)
CONFIG_GETTER_SETTER(copyAndCloseAfterUpload,
setCopyAndCloseAfterUpload,
bool)
CONFIG_GETTER_SETTER(copyURLAfterUpload, setCopyURLAfterUpload, bool)
CONFIG_GETTER_SETTER(historyConfirmationToDelete,
setHistoryConfirmationToDelete,
bool)