diff --git a/.travis.yml b/.travis.yml index 1989846f..28e01037 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,7 +17,7 @@ env: # Environment variables for packaging - PRODUCT=flameshot #TODO: we should take version from the last tag in git history + build number - - VERSION=0.7.0 + - VERSION=0.7.1 - RELEASE=1 - ARCH=x86_64 # Dockerfile from https://github.com/flameshotapp/flameshot-docker-images diff --git a/appveyor.yml b/appveyor.yml index dfc833f2..87ba63e3 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ image: Visual Studio 2015 #TODO: we should take version from the last tag in git history + build number -version: 0.7.0.{build} +version: 0.7.1.{build} # Major_Version_Number.Minor_Version_Number.Patch_Number.Build_Number skip_branch_with_pr: true diff --git a/flameshot.pro b/flameshot.pro index 8508c04d..257e53f0 100644 --- a/flameshot.pro +++ b/flameshot.pro @@ -6,7 +6,7 @@ win32:LIBS += -luser32 -lshell32 -BASE_VERSION = 0.7.0 +BASE_VERSION = 0.7.1 TAG_VERSION = $$system(git --git-dir $$PWD/.git --work-tree $$PWD describe --always --tags) isEmpty(TAG_VERSION){ TAG_VERSION = $$BASE_VERSION diff --git a/src/tools/capturetool.h b/src/tools/capturetool.h index ae1a70c0..d7aab848 100644 --- a/src/tools/capturetool.h +++ b/src/tools/capturetool.h @@ -66,6 +66,8 @@ public: explicit CaptureTool(QObject *parent = nullptr) : QObject(parent){} + virtual void setCapture(const QPixmap &pixmap) {}; + // Returns false when the tool is in an inconsistent state and shouldn't // be included in the tool undo/redo stack. virtual bool isValid() const = 0; diff --git a/src/tools/imgs3/imgs3uploadertool.cpp b/src/tools/imgs3/imgs3uploadertool.cpp index 2d5ec0a2..68aec9ba 100644 --- a/src/tools/imgs3/imgs3uploadertool.cpp +++ b/src/tools/imgs3/imgs3uploadertool.cpp @@ -47,13 +47,17 @@ QString ImgS3UploaderTool::nameID() { } QString ImgS3UploaderTool::description() const { - return tr("Upload the selection to ImgS3"); + return tr("Upload the selection to S3 bucket"); } QWidget* ImgS3UploaderTool::widget() { return new ImgS3Uploader(capture, m_s3CredsUrl, m_s3XApiKey); } +void ImgS3UploaderTool::setCapture(const QPixmap &pixmap) { + capture = pixmap; +} + CaptureTool* ImgS3UploaderTool::copy(QObject *parent) { return new ImgS3UploaderTool(parent); } diff --git a/src/tools/imgs3/imgs3uploadertool.h b/src/tools/imgs3/imgs3uploadertool.h index f3f7d05f..42377526 100644 --- a/src/tools/imgs3/imgs3uploadertool.h +++ b/src/tools/imgs3/imgs3uploadertool.h @@ -34,6 +34,7 @@ public: QWidget* widget() override; CaptureTool* copy(QObject *parent = nullptr) override; + void setCapture(const QPixmap &pixmap); public slots: void pressed(const CaptureContext &context) override; diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 1db615bb..832383ef 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -33,6 +33,8 @@ #include "src/utils/screenshotsaver.h" #include "src/core/controller.h" #include "src/widgets/capture/modificationcommand.h" +#include "src/tools/imgs3/imgs3uploadertool.h" +#include "src/tools/toolfactory.h" #include #include #include @@ -778,8 +780,11 @@ void CaptureWidget::initShortcuts() { new QShortcut(QKeySequence(Qt::SHIFT + Qt::Key_Down), this, SLOT(downResize())); new QShortcut(Qt::Key_Space, this, SLOT(togglePanel())); new QShortcut(Qt::Key_Escape, this, SLOT(deleteToolwidgetOrClose())); - new QShortcut(Qt::Key_Return, this, SLOT(copyScreenshot())); - new QShortcut(Qt::Key_Enter, this, SLOT(copyScreenshot())); + +// new QShortcut(Qt::Key_Return, this, SLOT(copyScreenshot())); +// new QShortcut(Qt::Key_Enter, this, SLOT(copyScreenshot())); + new QShortcut(Qt::Key_Return, this, SLOT(uploadScreenshot())); + new QShortcut(Qt::Key_Enter, this, SLOT(uploadScreenshot())); } void CaptureWidget::updateSizeIndicator() { @@ -861,6 +866,13 @@ void CaptureWidget::childLeave() { update(); } +void CaptureWidget::uploadScreenshot() { + m_activeTool = new ImgS3UploaderTool(); + m_activeTool->setCapture(pixmap()); + handleButtonSignal(CaptureTool::REQ_ADD_EXTERNAL_WIDGETS); + close(); +} + void CaptureWidget::copyScreenshot() { m_captureDone = true; ScreenshotSaver().saveToClipboard(pixmap()); diff --git a/src/widgets/capture/capturewidget.h b/src/widgets/capture/capturewidget.h index 171ab33c..eb696dde 100644 --- a/src/widgets/capture/capturewidget.h +++ b/src/widgets/capture/capturewidget.h @@ -74,6 +74,7 @@ private slots: // TODO replace with tools void copyScreenshot(); void saveScreenshot(); + void uploadScreenshot(); void undo(); void redo(); void togglePanel(); diff --git a/translations/Internationalization_ru.ts b/translations/Internationalization_ru.ts index c3ba2524..ff32a258 100644 --- a/translations/Internationalization_ru.ts +++ b/translations/Internationalization_ru.ts @@ -125,12 +125,12 @@ CaptureWidget - + Unable to capture screen Не удалось захватить экран - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -460,9 +460,13 @@ Press Space to open the side panel. - Upload the selection to ImgS3 + Upload the selection to S3 bucket Загрузить выделение на S3 + + Upload the selection to ImgS3 + Загрузить выделение на S3 + ImgurUploader diff --git a/translations/Internationalization_uk.ts b/translations/Internationalization_uk.ts index f33d1d16..200cebce 100644 --- a/translations/Internationalization_uk.ts +++ b/translations/Internationalization_uk.ts @@ -125,12 +125,12 @@ CaptureWidget - + Unable to capture screen Не вдалось захопити екран - + Select an area with the mouse, or press Esc to exit. Press Enter to capture the screen. Press Right Click to show the color picker. @@ -460,9 +460,13 @@ Press Space to open the side panel. - Upload the selection to ImgS3 + Upload the selection to S3 bucket Вивантажити виділення на S3 + + Upload the selection to ImgS3 + Вивантажити виділення на S3 + ImgurUploader