Add a resource exporter module

This commit is contained in:
lupoDharkael
2017-08-16 21:00:29 +02:00
parent a28104d60c
commit 321ec1b555
8 changed files with 99 additions and 56 deletions

View File

@@ -17,7 +17,9 @@
#include "flameshotdbusadapter.h"
#include "src/utils/confighandler.h"
#include "src/utils/screengrabber.h"
#include "src/core/controller.h"
#include "src/core/resourceexporter.h"
#include <QTimer>
FlameshotDBusAdapter::FlameshotDBusAdapter(QObject *parent)
@@ -39,11 +41,18 @@ void FlameshotDBusAdapter::graphicCapture(QString path, int delay) {
}
void FlameshotDBusAdapter::fullScreen(QString path, bool toClipboard, int delay) {
auto controller = Controller::getInstance();
auto f = [controller, path, toClipboard, this]() {
controller->saveFullScreenshot(path, toClipboard);
auto f = [path, toClipboard, this]() {
QPixmap p(ScreenGrabber().grabEntireDesktop());
if(toClipboard) {
ResourceExporter().captureToClipboard(p);
}
if(path.isEmpty()) {
ResourceExporter().captureToFileUi(p);
} else {
ResourceExporter().captureToFile(p, path);
}
};
QTimer::singleShot(delay, controller, f);
QTimer::singleShot(delay, this, f);
}