Fix - update history widget on new capture

This commit is contained in:
Yuriy Puchkov
2020-10-16 15:03:42 +03:00
parent b69f850c2a
commit 5ea80b2ca2
5 changed files with 14 additions and 3 deletions

View File

@@ -302,6 +302,15 @@ void Controller::updateConfigComponents()
}
}
void Controller::updateRecentScreenshots()
{
if (nullptr != m_history) {
if (m_history->isVisible()) {
m_history->loadHistory();
}
}
}
void Controller::showRecentScreenshots()
{
if (nullptr == m_history) {

View File

@@ -45,6 +45,7 @@ public:
void operator=(const Controller&) = delete;
void enableExports();
void updateRecentScreenshots();
signals:
void captureTaken(uint id, QPixmap p);

View File

@@ -16,6 +16,7 @@
// along with Flameshot. If not, see <http://www.gnu.org/licenses/>.
#include "imguruploader.h"
#include "src/core/controller.h"
#include "src/utils/confighandler.h"
#include "src/utils/filenamehandler.h"
#include "src/utils/history.h"
@@ -86,6 +87,7 @@ void ImgurUploader::handleReply(QNetworkReply* reply)
QApplication::clipboard()->setText(imageUrl().toString());
SystemNotification().sendMessage(
QObject::tr("URL copied to clipboard."));
Controller::getInstance()->updateRecentScreenshots();
close();
} else {
onUploadOk();

View File

@@ -18,6 +18,7 @@
#include "imgs3uploader.h"
#include "imgs3settings.h"
#include "src/core/controller.h"
#include "src/utils/confighandler.h"
#include "src/utils/history.h"
#include "src/utils/systemnotification.h"
@@ -200,6 +201,7 @@ void ImgS3Uploader::handleReplyUpload(QNetworkReply* reply)
if (ConfigHandler().copyAndCloseAfterUploadEnabled()) {
QApplication::clipboard()->setText(imageUrl().toString());
SystemNotification().sendMessage(tr("URL copied to clipboard."));
Controller::getInstance()->updateRecentScreenshots();
close();
} else {
onUploadOk();

View File

@@ -20,9 +20,6 @@
#include "src/utils/screengrabber.h"
#include "src/utils/screenshotsaver.h"
#include "src/widgets/imagelabel.h"
#include "src/widgets/notificationwidget.h"
#include <QCheckBox>
#include <QComboBox>
#include <QDrag>
#include <QFormLayout>