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

@@ -21,10 +21,6 @@
#include "src/infowindow.h"
#include "src/config/configwindow.h"
#include "src/capture/widget/capturebutton.h"
#include "src/utils/screengrabber.h"
#include "src/capture/workers/imgur/imguruploader.h"
#include "src/capture/workers/screenshotsaver.h"
#include "src/capture/workers/graphicalscreenshotsaver.h"
#include <QFile>
#include <QApplication>
#include <QSystemTrayIcon>
@@ -47,7 +43,6 @@ Controller::Controller() : m_captureWindow(nullptr)
QString StyleSheet = CaptureButton::globalStyleSheet();
qApp->setStyleSheet(StyleSheet);
}
Controller *Controller::getInstance() {
@@ -55,19 +50,6 @@ Controller *Controller::getInstance() {
return &c;
}
void Controller::saveFullScreenshot(const QString &path,
bool const toClipboard) {
QPixmap p(ScreenGrabber().grabEntireDesktop());
if(toClipboard) {
captureToClipboard(p);
}
if(path.isEmpty()) {
captureToFileUi(p);
} else {
captureToFile(p, path);
}
}
// initDefaults inits the global config in the first execution of the program
void Controller::initDefaults() {
ConfigHandler config;
@@ -147,21 +129,3 @@ void Controller::updateConfigComponents() {
m_configWindow->updateComponents();
}
}
void Controller::captureToClipboard(const QPixmap &p) {
ScreenshotSaver().saveToClipboard(p);
}
void Controller::captureToFile(const QPixmap &p, const QString &path) {
ScreenshotSaver().saveToFilesystem(p, path);
}
void Controller::captureToFileUi(const QPixmap &p) {
auto w = new GraphicalScreenshotSaver(p);
w->show();
}
void Controller::captureToImgur(const QPixmap &p) {
auto w = new ImgurUploader(p);
w->show();
}