Fix - update history widget on new capture
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -45,6 +45,7 @@ public:
|
||||
void operator=(const Controller&) = delete;
|
||||
|
||||
void enableExports();
|
||||
void updateRecentScreenshots();
|
||||
|
||||
signals:
|
||||
void captureTaken(uint id, QPixmap p);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user