2017-04-23 15:05:48 +02:00
|
|
|
#include "screenshotter.hpp"
|
|
|
|
#include "cropeditor/cropeditor.hpp"
|
2017-04-25 22:36:33 +02:00
|
|
|
#include "mainwindow.hpp"
|
2017-04-23 15:05:48 +02:00
|
|
|
#include "screenshotutil.hpp"
|
|
|
|
#include "uploaders/uploadersingleton.hpp"
|
2017-04-25 22:36:33 +02:00
|
|
|
#include <QDoubleSpinBox>
|
|
|
|
#include <QTimer>
|
2017-05-15 14:10:00 +02:00
|
|
|
#include <settings.hpp>
|
2017-04-23 15:05:48 +02:00
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
void screenshotter::area() {
|
2017-05-09 17:26:00 +02:00
|
|
|
CropEditor *editor = new CropEditor(screenshotutil::fullscreen());
|
2017-05-16 15:52:15 +02:00
|
|
|
QObject::connect(editor, &CropEditor::cropped, [&](QPixmap *pixmap) {
|
|
|
|
UploaderSingleton::inst().upload(pixmap);
|
|
|
|
QScopedPointer<CropEditor>(editor);
|
|
|
|
});
|
2017-04-23 15:05:48 +02:00
|
|
|
}
|
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
void screenshotter::fullscreen() {
|
2017-05-15 14:10:00 +02:00
|
|
|
UploaderSingleton::inst().upload(screenshotutil::fullscreen(settings::settings().value("captureCursor", true).toBool()));
|
2017-04-23 15:05:48 +02:00
|
|
|
}
|
2017-04-25 22:36:33 +02:00
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
void screenshotter::areaDelayed() {
|
2017-05-09 17:26:00 +02:00
|
|
|
QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::area);
|
2017-04-25 22:36:33 +02:00
|
|
|
}
|
|
|
|
|
2017-05-06 13:21:12 +02:00
|
|
|
void screenshotter::fullscreenDelayed() {
|
2017-05-09 17:26:00 +02:00
|
|
|
QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::fullscreen);
|
2017-04-25 22:36:33 +02:00
|
|
|
}
|