KShare/screenshotter.cpp

32 lines
845 B
C++
Raw Normal View History

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-04-23 15:05:48 +02:00
void screenshotter::area()
{
CropEditor *editor = new CropEditor(screenshotutil::fullscreen());
2017-04-29 09:44:30 +02:00
QObject::connect(editor, &CropEditor::cropped, [&](QPixmap *pixmap) {
UploaderSingleton::inst().upload(pixmap);
delete editor;
});
2017-04-23 15:05:48 +02:00
}
void screenshotter::fullscreen()
{
UploaderSingleton::inst().upload(screenshotutil::fullscreen());
}
2017-04-25 22:36:33 +02:00
void screenshotter::areaDelayed()
{
QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::area);
}
void screenshotter::fullscreenDelayed()
{
QTimer::singleShot(MainWindow::inst()->delay()->value() * 1000, &screenshotter::fullscreen);
}