reformatted to Mozilla code style
This commit is contained in:
committed by
borgmanJeremy
parent
c0e2e48db4
commit
c8d15205be
@@ -19,47 +19,61 @@
|
||||
#include "src/utils/screenshotsaver.h"
|
||||
#include <QPainter>
|
||||
|
||||
SaveTool::SaveTool(QObject *parent) : AbstractActionTool(parent) {
|
||||
SaveTool::SaveTool(QObject* parent)
|
||||
: AbstractActionTool(parent)
|
||||
{}
|
||||
|
||||
bool
|
||||
SaveTool::closeOnButtonPressed() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SaveTool::closeOnButtonPressed() const {
|
||||
return true;
|
||||
QIcon
|
||||
SaveTool::icon(const QColor& background, bool inEditor) const
|
||||
{
|
||||
Q_UNUSED(inEditor);
|
||||
return QIcon(iconPath(background) + "content-save.svg");
|
||||
}
|
||||
QString
|
||||
SaveTool::name() const
|
||||
{
|
||||
return tr("Save");
|
||||
}
|
||||
|
||||
QIcon SaveTool::icon(const QColor &background, bool inEditor) const {
|
||||
Q_UNUSED(inEditor);
|
||||
return QIcon(iconPath(background) + "content-save.svg");
|
||||
}
|
||||
QString SaveTool::name() const {
|
||||
return tr("Save");
|
||||
QString
|
||||
SaveTool::nameID()
|
||||
{
|
||||
return QLatin1String("");
|
||||
}
|
||||
|
||||
QString SaveTool::nameID() {
|
||||
return QLatin1String("");
|
||||
QString
|
||||
SaveTool::description() const
|
||||
{
|
||||
return tr("Save the capture");
|
||||
}
|
||||
|
||||
QString SaveTool::description() const {
|
||||
return tr("Save the capture");
|
||||
CaptureTool*
|
||||
SaveTool::copy(QObject* parent)
|
||||
{
|
||||
return new SaveTool(parent);
|
||||
}
|
||||
|
||||
CaptureTool* SaveTool::copy(QObject *parent) {
|
||||
return new SaveTool(parent);
|
||||
}
|
||||
|
||||
void SaveTool::pressed(const CaptureContext &context) {
|
||||
if (context.savePath.isEmpty()) {
|
||||
emit requestAction(REQ_HIDE_GUI);
|
||||
bool ok = ScreenshotSaver().saveToFilesystemGUI(
|
||||
context.selectedScreenshotArea());
|
||||
if (ok) {
|
||||
emit requestAction(REQ_CAPTURE_DONE_OK);
|
||||
}
|
||||
} else {
|
||||
bool ok = ScreenshotSaver().saveToFilesystem(
|
||||
context.selectedScreenshotArea(), context.savePath);
|
||||
if (ok) {
|
||||
emit requestAction(REQ_CAPTURE_DONE_OK);
|
||||
}
|
||||
void
|
||||
SaveTool::pressed(const CaptureContext& context)
|
||||
{
|
||||
if (context.savePath.isEmpty()) {
|
||||
emit requestAction(REQ_HIDE_GUI);
|
||||
bool ok =
|
||||
ScreenshotSaver().saveToFilesystemGUI(context.selectedScreenshotArea());
|
||||
if (ok) {
|
||||
emit requestAction(REQ_CAPTURE_DONE_OK);
|
||||
}
|
||||
} else {
|
||||
bool ok = ScreenshotSaver().saveToFilesystem(
|
||||
context.selectedScreenshotArea(), context.savePath);
|
||||
if (ok) {
|
||||
emit requestAction(REQ_CAPTURE_DONE_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user