diff -Nru deepin-screenshot-4.1.8/CHANGELOG.md deepin-screenshot-5.0.0/CHANGELOG.md --- deepin-screenshot-4.1.8/CHANGELOG.md 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/CHANGELOG.md 2019-07-08 05:43:20.000000000 +0000 @@ -1,3 +1,51 @@ + +### 4.2.1 (2019-05-29) + + +#### Bug Fixes + +* cannot input text ([63121fc0](https://github.com/linuxdeepin/deepin-screenshot/commit/63121fc09f8034be86733bc483bc945e756092cf)) + + + + +## 4.2.0 (2019-05-24) + + +#### Bug Fixes + +* SaveToSpecificDir not select last path ([3c1fef47](https://github.com/linuxdeepin/deepin-screenshot/commit/3c1fef47b0f125c01c57ed7f7199476d260c0e3b)) +* **blur:** check geometry failed ([f0a82283](https://github.com/linuxdeepin/deepin-screenshot/commit/f0a8228355c34ef5eeb7b43affc96714bd32b149)) + + + + +### 4.1.11 (2019-05-09) + + +#### Bug Fixes + +* cannot select window on other screen ([2635aa93](https://github.com/linuxdeepin/deepin-screenshot/commit/2635aa93719b9dc0f50f2ef3fc354bf86237d2d8)) +* indicator pos error ([cce7ca59](https://github.com/linuxdeepin/deepin-screenshot/commit/cce7ca59091aa9ed8fb838c5ff4a49b7301780e1)) + + + + +### 4.1.10 (2019-04-26) + + +* support HiDPI ([31d2fd94](https://github.com/linuxdeepin/deepin-screenshot/commit/31d2fd940b9ac4d05e88a5ba8606730be57e84ee)) + + +## 4.1.9 (2019-04-22) + + +#### Bug Fixes + +* check path existence ([d8431cc2](https://github.com/linuxdeepin/deepin-screenshot/commit/d8431cc2a94a9f1d49021f279fe688727802d2c0)) + + + ### 4.1.8 (2019-02-25) diff -Nru deepin-screenshot-4.1.8/CMakeLists.txt deepin-screenshot-5.0.0/CMakeLists.txt --- deepin-screenshot-4.1.8/CMakeLists.txt 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/CMakeLists.txt 2019-07-08 05:43:20.000000000 +0000 @@ -39,6 +39,7 @@ "src/utils/shortcut.cpp" "src/utils/configsettings.cpp" "src/utils/tempfile.cpp" + "src/utils/saveutils.h" # widgets "src/widgets/bigcolorbutton.h" diff -Nru deepin-screenshot-4.1.8/debian/changelog deepin-screenshot-5.0.0/debian/changelog --- deepin-screenshot-4.1.8/debian/changelog 2019-02-25 09:28:37.000000000 +0000 +++ deepin-screenshot-5.0.0/debian/changelog 2020-03-23 09:25:36.000000000 +0000 @@ -1,3 +1,16 @@ +deepin-screenshot (5.0.0-1build1) focal; urgency=medium + + * No-change rebuild for libgcc-s1 package name change. + + -- Matthias Klose Mon, 23 Mar 2020 10:25:36 +0100 + +deepin-screenshot (5.0.0-1) unstable; urgency=medium + + * New upstream release 5.0.0. + * debian/control: Bump Standards-Version to 4.4.1. + + -- Boyuan Yang Sat, 05 Oct 2019 15:22:44 -0400 + deepin-screenshot (4.1.8-1) unstable; urgency=medium * New upstream version 4.1.8 diff -Nru deepin-screenshot-4.1.8/debian/control deepin-screenshot-5.0.0/debian/control --- deepin-screenshot-4.1.8/debian/control 2019-02-25 09:23:29.000000000 +0000 +++ deepin-screenshot-5.0.0/debian/control 2019-10-05 19:22:44.000000000 +0000 @@ -33,7 +33,7 @@ x11proto-record-dev, x11proto-xext-dev, Rules-Requires-Root: no -Standards-Version: 4.3.0 +Standards-Version: 4.4.1 Homepage: https://github.com/linuxdeepin/deepin-screenshot Vcs-Git: https://salsa.debian.org/pkg-deepin-team/deepin-screenshot.git Vcs-Browser: https://salsa.debian.org/pkg-deepin-team/deepin-screenshot diff -Nru deepin-screenshot-4.1.8/README.md deepin-screenshot-5.0.0/README.md --- deepin-screenshot-4.1.8/README.md 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/README.md 2019-07-08 05:43:20.000000000 +0000 @@ -1,6 +1,6 @@ # Deepin screenshot -## Description +## Description This is a default screenshot app for Linux Deepin. @@ -8,12 +8,11 @@ - Qt (>=5.6), - debhelper (>=9), -- qt5-qmake, qt5-default, qtbase5-dev, pkg-config, libqt5svg5-dev, libqt5x11extras5-dev, qttools5-dev-tools, +- cmake, qt5-default, qtbase5-dev, pkg-config, libqt5svg5-dev, libqt5x11extras5-dev, qttools5-dev-tools, - libxcb-util0-dev, libstartup-notification0-dev, -- qtbase5-private-dev,qtmultimedia5-dev, x11proto-xext-dev, libmtdev-dev, libegl1-mesa-dev, x11proto-record-dev,libxtst-dev, -- libudev-dev, libfontconfig1-dev, libfreetype6-dev, libglib2.0-dev, libxrender-dev, libdtkwidget-dev - -- deepin-notifications (>2.3.8-1) +- qtbase5-private-dev, qtmultimedia5-dev, x11proto-xext-dev, libmtdev-dev, libegl1-mesa-dev, x11proto-record-dev,libxtst-dev, +- libudev-dev, libfontconfig1-dev, libfreetype6-dev, libglib2.0-dev, libxrender-dev, +- libdtkwidget-dev, libdtkwm-dev, deepin-gettext-tools ## Installation @@ -21,7 +20,7 @@ - On other operation system, you could download the source code of deepin screenshot: - firstly, install the dependencies rightly; - secondly, run `cd deepin-screenshot`; - - thirdly, make a directory: build; run `qmake ..`; `make`;`make install` + - thirdly, make a directory: build; run `cmake ../`; `make`; `make install` ## Usage Run the command: `deepin-screenshot` @@ -30,10 +29,11 @@ Any usage issues can ask for help via +* [Official Forum](https://bbs.deepin.org/) +* [Developer Center](https://github.com/linuxdeepin/developer-center) +* [WiKi](https://wiki.deepin.org/) * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC channel](https://webchat.freenode.net/?channels=deepin) -* [Forum](https://bbs.deepin.org) -* [WiKi](https://wiki.deepin.org/) ## Getting involved diff -Nru deepin-screenshot-4.1.8/src/controller/menucontroller.cpp deepin-screenshot-5.0.0/src/controller/menucontroller.cpp --- deepin-screenshot-4.1.8/src/controller/menucontroller.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/controller/menucontroller.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -19,10 +19,12 @@ #include "menucontroller.h" #include "src/utils/configsettings.h" +#include "src/utils/saveutils.h" #include #include #include +#include const QSize MENU_ICON_SIZE = QSize(14, 14); @@ -101,22 +103,28 @@ QAction* saveAct3 = new QAction(tr("Save to specified folder"), this); QAction* saveAct4 = new QAction(tr("Copy to clipboard"), this); QAction* saveAct5 = new QAction(tr("Autosave and copy to clipboard"), this); - QList actionList; - actionList.append(saveAct1); - actionList.append(saveAct2); - actionList.append(saveAct3); - actionList.append(saveAct4); - actionList.append(saveAct5); - for(int k = 0; k < actionList.length(); k++) { - saveMenu->addAction(actionList[k]); - connect(actionList[k], &QAction::triggered, [=]{ - emit saveBtnPressed(k); + + std::map actionMaps; + actionMaps[SaveAction::SaveToDesktop] = saveAct1; + actionMaps[SaveAction::AutoSave] = saveAct2; + actionMaps[SaveAction::SaveToSpecificDir] = saveAct3; + actionMaps[SaveAction::SaveToClipboard] = saveAct4; + actionMaps[SaveAction::SaveToAutoClipboard] = saveAct5; + + SaveAction action = ConfigSettings::instance()->value("save", "save_op").value(); + + for (auto it = actionMaps.begin(); it != actionMaps.end(); ++it) { + saveMenu->addAction(it->second); + + connect(it->second, &QAction::triggered, this, [=] { + emit saveBtnPressed(action); }); - } - int saveOptionIndex = ConfigSettings::instance()->value("save", "save_op").toInt(); - actionList[saveOptionIndex]->setCheckable(true); - actionList[saveOptionIndex]->setChecked(true); + if (action == it->first) { + it->second->setCheckable(true); + it->second->setChecked(true); + } + } QIcon exitIcon; exitIcon.addFile(":/image/menu_icons/exit-menu-norml.svg", MENU_ICON_SIZE, QIcon::Normal); diff -Nru deepin-screenshot-4.1.8/src/controller/menucontroller.h deepin-screenshot-5.0.0/src/controller/menucontroller.h --- deepin-screenshot-4.1.8/src/controller/menucontroller.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/controller/menucontroller.h 2019-07-08 05:43:20.000000000 +0000 @@ -22,6 +22,7 @@ #include +enum SaveAction:unsigned int; class MenuController : public QObject { Q_OBJECT public: @@ -31,7 +32,7 @@ signals: void shapePressed(QString currentShape); void unDoAction(); - void saveBtnPressed(int index); + void saveBtnPressed(SaveAction action); void menuNoFocus(); public slots: diff -Nru deepin-screenshot-4.1.8/src/dbusservice/dbusscreenshotservice.cpp deepin-screenshot-5.0.0/src/dbusservice/dbusscreenshotservice.cpp --- deepin-screenshot-4.1.8/src/dbusservice/dbusscreenshotservice.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/dbusservice/dbusscreenshotservice.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -56,6 +56,10 @@ // destructor } +void DBusScreenshotService::setSingleInstance(bool instance) { + m_singleInstance = instance; +} + void DBusScreenshotService::StartScreenshot() { qDebug() << "DBus screenshot service! start screenshot"; if (!m_singleInstance) @@ -107,4 +111,3 @@ parent()->savePathScreenshot(in0); m_singleInstance = true; } - diff -Nru deepin-screenshot-4.1.8/src/dbusservice/dbusscreenshotservice.h deepin-screenshot-5.0.0/src/dbusservice/dbusscreenshotservice.h --- deepin-screenshot-4.1.8/src/dbusservice/dbusscreenshotservice.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/dbusservice/dbusscreenshotservice.h 2019-07-08 05:43:20.000000000 +0000 @@ -72,6 +72,8 @@ DBusScreenshotService(Screenshot *parent); ~DBusScreenshotService(); + void setSingleInstance(bool instance); + inline Screenshot *parent() const { return static_cast(QObject::parent()); } diff -Nru deepin-screenshot-4.1.8/src/eventcontainer.cpp deepin-screenshot-5.0.0/src/eventcontainer.cpp --- deepin-screenshot-4.1.8/src/eventcontainer.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/eventcontainer.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -19,8 +19,8 @@ #include "eventcontainer.h" -EventContainer::EventContainer(QWidget *parent) - : QWidget(parent) { +EventContainer::EventContainer(QObject *parent) + : QObject(parent) { } diff -Nru deepin-screenshot-4.1.8/src/eventcontainer.h deepin-screenshot-5.0.0/src/eventcontainer.h --- deepin-screenshot-4.1.8/src/eventcontainer.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/eventcontainer.h 2019-07-08 05:43:20.000000000 +0000 @@ -20,13 +20,13 @@ #ifndef EVENTCONTAINER_H #define EVENTCONTAINER_H -#include +#include #include -class EventContainer : public QWidget { +class EventContainer : public QObject { Q_OBJECT public: - EventContainer(QWidget* parent = 0); + EventContainer(QObject* parent = 0); ~EventContainer(); public slots: diff -Nru deepin-screenshot-4.1.8/src/main.cpp deepin-screenshot-5.0.0/src/main.cpp --- deepin-screenshot-4.1.8/src/main.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/main.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -57,7 +57,7 @@ QCommandLineOption topWindowOption(QStringList() << "w" << "top-window", "Take a screenshot of the most top window."); QCommandLineOption savePathOption(QStringList() << "s" << "save-path", - "Specifiy a path to save the screenshot.", "PATH"); + "Specify a path to save the screenshot.", "PATH"); QCommandLineOption prohibitNotifyOption(QStringList() << "n" << "no-notification", "Don't send notifications."); QCommandLineOption iconOption(QStringList() << "i" << "icon", @@ -78,7 +78,6 @@ cmdParser.process(a); Screenshot w; - w.hide(); DBusScreenshotService dbusService (&w); Q_UNUSED(dbusService); @@ -94,9 +93,10 @@ if (cmdParser.isSet(dbusOption)) { - qDebug() << "dbus register wating!"; + qDebug() << "dbus register waiting!"; return a.exec(); } else { + dbusService.setSingleInstance(true); if (cmdParser.isSet(delayOption)) { qDebug() << "cmd delay screenshot"; w.delayScreenshot(cmdParser.value(delayOption).toInt()); diff -Nru deepin-screenshot-4.1.8/src/mainwindow.cpp deepin-screenshot-5.0.0/src/mainwindow.cpp --- deepin-screenshot-4.1.8/src/mainwindow.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/mainwindow.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -32,6 +32,10 @@ #include #include #include +#include +#include +#include +#include #include @@ -58,7 +62,20 @@ MainWindow::MainWindow(QWidget *parent) : QLabel(parent) { -// startScreenshot(); + setAttribute(Qt::WA_TranslucentBackground); + setWindowFlags(Qt::X11BypassWindowManagerHint); + + installEventFilter(this); + + connect(this, &MainWindow::releaseEvent, this, [=]{ + qDebug() << "release event !!!"; + m_keyboardReleased = true; + m_keyboardGrabbed = windowHandle()->setKeyboardGrabEnabled(false); + qDebug() << "keyboardGrabbed:" << m_keyboardGrabbed; + removeEventFilter(this); + }); + + connect(this, &MainWindow::hideScreenshotUI, this, &MainWindow::hide); } MainWindow::~MainWindow() @@ -72,10 +89,13 @@ QPoint curPos = this->cursor().pos(); + const qreal ratio = devicePixelRatioF(); m_swUtil = DScreenWindowsUtil::instance(curPos); m_screenNum = m_swUtil->getScreenNum(); m_backgroundRect = m_swUtil->backgroundRect(); - this->move(m_backgroundRect.x(), m_backgroundRect.y()); + m_backgroundRect = QRect(m_backgroundRect.topLeft() / ratio, m_backgroundRect.size()); + + move(m_backgroundRect.topLeft() * ratio); this->setFixedSize(m_backgroundRect.size()); initBackground(); @@ -113,10 +133,17 @@ void MainWindow::initSecondUI() { - if (m_screenNum == 0) { - m_windowRects = m_swUtil->windowsRect(); - m_windowNames = m_swUtil->windowsName(); + for (auto wid : DWindowManagerHelper::instance()->currentWorkspaceWindowIdList()) { + if (wid == winId()) continue; + + DForeignWindow * window = DForeignWindow::fromWinId(wid); + if (window) { + window->deleteLater(); + m_windowRects << window->geometry(); + m_windowNames << window->wmClass(); + } } + m_configSettings = ConfigSettings::instance(); m_toolBar = new ToolBar(this); m_toolBar->hide(); @@ -241,7 +268,7 @@ } else if (keyEvent->key() == Qt::Key_Down) { m_shapesWidget->microAdjust("Ctrl+Down"); } else if (keyEvent->key() == Qt::Key_C) { - ConfigSettings::instance()->setValue("save", "save_op", 3); + ConfigSettings::instance()->setValue("save", "save_op", SaveAction::SaveToClipboard); saveScreenshot(); } else if (keyEvent->key() == Qt::Key_S) { expressSaveScreenshot(); @@ -298,7 +325,7 @@ } if (keyEvent->key() == Qt::Key_C) { - ConfigSettings::instance()->setValue("save", "save_op", 3); + ConfigSettings::instance()->setValue("save", "save_op", SaveAction::SaveToClipboard); saveScreenshot(); } @@ -507,6 +534,16 @@ QLabel::hideEvent(event); } +bool MainWindow::eventFilter(QObject *watched, QEvent *event) +{ + if (!m_keyboardGrabbed && this->windowHandle() != NULL) { + m_keyboardGrabbed = this->windowHandle()->setKeyboardGrabEnabled(true); + qDebug() << "m_keyboardGrabbed:" << m_keyboardGrabbed; + } + + return QLabel::eventFilter(watched, event); +} + void MainWindow::mouseMoveEvent(QMouseEvent *ev) { bool needRepaint = false; @@ -526,22 +563,24 @@ if (!m_toolBar->isVisible() && !m_isFirstReleaseButton) { QPoint curPos = this->cursor().pos(); QPoint tmpPos; - if (curPos.x() + INDICATOR_WIDTH + CURSOR_WIDTH > m_backgroundRect.x() + QPoint topLeft = m_backgroundRect.topLeft() * devicePixelRatioF(); + + if (curPos.x() + INDICATOR_WIDTH + CURSOR_WIDTH > topLeft.x() + m_backgroundRect.width()) { tmpPos.setX(curPos.x() - INDICATOR_WIDTH); } else { tmpPos.setX(curPos.x() + CURSOR_WIDTH); } - if (curPos.y() + INDICATOR_WIDTH > m_backgroundRect.y() + m_backgroundRect.height()) { + if (curPos.y() + INDICATOR_WIDTH > topLeft.y() + m_backgroundRect.height()) { tmpPos.setY(curPos.y() - INDICATOR_WIDTH); } else { tmpPos.setY(curPos.y() + CURSOR_HEIGHT); } m_zoomIndicator->showMagnifier(QPoint( - std::max(tmpPos.x() - m_backgroundRect.x(), 0), - std::max(tmpPos.y() - m_backgroundRect.y(), 0))); + std::max(tmpPos.x() - topLeft.x(), 0), + std::max(tmpPos.y() - topLeft.y(), 0))); } } else { m_isFirstMove = true; @@ -601,30 +640,17 @@ needRepaint = true; } } else { - if (m_screenNum == 0) { - for (int i = 0; i < m_windowRects.length(); i++) { - int wx = m_windowRects[i].x(); - int wy = m_windowRects[i].y(); - int ww = m_windowRects[i].width(); - int wh = m_windowRects[i].height(); - int ex = ev->x(); - int ey = ev->y(); - if (ex > wx && ex < wx + ww && ey > wy && ey < wy + wh) { - m_recordX = wx; - m_recordY = wy; - m_recordWidth = ww; - m_recordHeight = wh; + const QPoint mousePoint = QCursor::pos(); + for (auto it = m_windowRects.rbegin(); it != m_windowRects.rend(); ++it) { + if (it->contains(mousePoint)) { + m_recordX = it->x() - static_cast(m_backgroundRect.x() * devicePixelRatioF()); + m_recordY = it->y() - static_cast(m_backgroundRect.y() * devicePixelRatioF()); + m_recordWidth = it->width(); + m_recordHeight = it->height(); - needRepaint = true; - break; - } + needRepaint = true; + break; } - } else { - m_recordX = 0; - m_recordY = 0; - m_recordWidth = m_backgroundRect.width(); - m_recordHeight = m_backgroundRect.height(); - needRepaint = true; } } @@ -1128,10 +1154,16 @@ QPixmap MainWindow::getPixmapofRect(const QRect &rect) { - const qreal dpr = qApp->devicePixelRatio(); - return m_swUtil->primaryScreen()->grabWindow( - m_swUtil->rootWindowId(), - rect.x() / dpr, rect.y() / dpr, rect.width(), rect.height()); + QRect r(rect.topLeft() * devicePixelRatioF(), rect.size()); + + QList screenList = qApp->screens(); + for (auto it = screenList.constBegin(); it != screenList.constEnd(); ++it) { + if ((*it)->geometry().contains(r)) { + return (*it)->grabWindow(m_swUtil->rootWindowId(), rect.x(), rect.y(), rect.width(), rect.height()); + } + } + + return QPixmap(); } void MainWindow::initBackground() @@ -1189,7 +1221,9 @@ // eventloop.exec(); qDebug() << m_toolBar->isVisible() << m_sizeTips->isVisible(); - m_resultPixmap = getPixmapofRect(m_shapesWidget->geometry()); + const qreal ratio = devicePixelRatioF(); + const QRect rect(m_shapesWidget->geometry().topLeft() * ratio, m_shapesWidget->geometry().size() * ratio); + m_resultPixmap = m_backgroundPixmap.copy(rect); m_drawNothing = false; update(); } @@ -1227,25 +1261,27 @@ QStandardPaths::StandardLocation saveOption = QStandardPaths::TempLocation; bool copyToClipboard = false; - if (ConfigSettings::instance()->hasTemporarySaveAction()) { - m_saveIndex = ConfigSettings::instance()->getAndResetTemporarySaveAction(); - } else { - m_saveIndex = ConfigSettings::instance()->value("save", "save_op").toInt(); + std::pair temporarySaveAction = ConfigSettings::instance()->getTemporarySaveAction(); + if (temporarySaveAction.first) { + m_saveIndex = temporarySaveAction.second; + } + else { + m_saveIndex = ConfigSettings::instance()->value("save", "save_op").value(); } switch (m_saveIndex) { - case 0: { + case SaveToDesktop: { saveOption = QStandardPaths::DesktopLocation; ConfigSettings::instance()->setValue("common", "default_savepath", QStandardPaths::writableLocation( QStandardPaths::DesktopLocation)); break; } - case 1: { + case AutoSave: { QString defaultSaveDir = ConfigSettings::instance()->value("common", "default_savepath").toString(); if (defaultSaveDir.isEmpty()) { saveOption = QStandardPaths::DesktopLocation; } else if (defaultSaveDir == "clipboard") { copyToClipboard = true; - m_saveIndex = 3; + m_saveIndex = SaveToSpecificDir; } else { if (m_selectAreaName.isEmpty()) { m_saveFileName = QString("%1/%2_%3.png").arg(defaultSaveDir).arg(tr( @@ -1257,20 +1293,27 @@ } break; } - case 2: { + case SaveToSpecificDir: { this->hide(); this->releaseKeyboard(); - QFileDialog fileDialog; - QString lastFileName; - if (m_selectAreaName.isEmpty()) { - lastFileName = QString("%1/%2_%3.png").arg(QStandardPaths::writableLocation( - QStandardPaths::PicturesLocation)).arg(tr("DeepinScreenshot")).arg(currentTime); - } else { - lastFileName = QString("%1/%2_%3_%4.png").arg(QStandardPaths::writableLocation( - QStandardPaths::PicturesLocation)).arg(tr("DeepinScreenshot") - ).arg(m_selectAreaName).arg(currentTime); + + QString path = ConfigSettings::instance()->value("common", "default_savepath").toString(); + QString fileName = m_selectAreaName; + + if (path.isEmpty() || !QDir(path).exists()) { + path = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation); + } + + if (fileName.isEmpty()) { + fileName = QString("%1_%2").arg(tr("DeepinScreenshot")).arg(currentTime); } + else { + fileName = QString("%1_%2_%3").arg(tr("DeepinScreenshot")).arg(m_selectAreaName).arg(currentTime); + } + + QString lastFileName = QString("%1/%2.png").arg(path).arg(fileName); + QFileDialog fileDialog; m_saveFileName = fileDialog.getSaveFileName(this, "Save", lastFileName, tr("PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;" "XBM (*.xbm);;XPM(*.xpm)")); @@ -1290,18 +1333,18 @@ QFileInfo(m_saveFileName).dir().absolutePath()); break; } - case 3: { + case SaveToClipboard: { copyToClipboard = true; ConfigSettings::instance()->setValue("common", "default_savepath", "clipboard"); break; } - case 4: { + case SaveToAutoClipboard: { copyToClipboard = true; QString defaultSaveDir = ConfigSettings::instance()->value("common", "default_savepath").toString(); if (defaultSaveDir.isEmpty()) { saveOption = QStandardPaths::DesktopLocation; } else if (defaultSaveDir == "clipboard") { - m_saveIndex = 3; + m_saveIndex = SaveToSpecificDir; } else { if (m_selectAreaName.isEmpty()) { m_saveFileName = QString("%1/%2_%3.png").arg(defaultSaveDir).arg(tr( @@ -1331,18 +1374,26 @@ Qt::KeepAspectRatio, Qt::FastTransformation); } - if (m_saveIndex == 2 && m_saveFileName.isEmpty()) { + if (m_saveIndex == SaveToSpecificDir && m_saveFileName.isEmpty()) { return false; - } else if (m_saveIndex == 2 || !m_saveFileName.isEmpty()) { + } else if (m_saveIndex == SaveToSpecificDir || !m_saveFileName.isEmpty()) { if (!screenShotPix.save(m_saveFileName, QFileInfo(m_saveFileName).suffix().toLocal8Bit())) return false; } else if (saveOption != QStandardPaths::TempLocation && m_saveFileName.isEmpty()) { + QString savePath = QStandardPaths::writableLocation(saveOption); + QDir saveDir(savePath); + if (!saveDir.exists()) { + bool mkdirSucc = saveDir.mkpath("."); + if (!mkdirSucc) { + qCritical() << "Save path not exist and cannot be created:" << savePath; + qCritical() << "Fall back to temp location!"; + savePath = QDir::tempPath(); + } + } if (m_selectAreaName.isEmpty()) { - m_saveFileName = QString("%1/%2_%3.png").arg(QStandardPaths::writableLocation( - saveOption)).arg(tr("DeepinScreenshot")).arg(currentTime); + m_saveFileName = QString("%1/%2_%3.png").arg(savePath, tr("DeepinScreenshot"), currentTime); } else { - m_saveFileName = QString("%1/%2_%3_%4.png").arg(QStandardPaths::writableLocation( - saveOption)).arg(tr("DeepinScreenshot")).arg(m_selectAreaName).arg(currentTime); + m_saveFileName = QString("%1/%2_%3_%4.png").arg(savePath, tr("DeepinScreenshot"), m_selectAreaName, currentTime); } if (!screenShotPix.save(m_saveFileName, "PNG")) return false; @@ -1357,7 +1408,7 @@ return true; } -void MainWindow::sendNotify(int saveIndex, QString saveFilePath, const bool succeed) +void MainWindow::sendNotify(SaveAction saveAction, QString saveFilePath, const bool succeed) { // failed notify if (!succeed) @@ -1395,17 +1446,17 @@ qDebug() << "saveFilePath:" << saveFilePath; QString summary; - if (saveIndex == 3) { + if (saveAction == SaveAction::SaveToClipboard) { summary = QString(tr("Picture has been saved to clipboard")); } else { summary = QString(tr("Picture has been saved to %1")).arg(saveFilePath); } - if (saveIndex == 3 && !m_noNotify) { + if (saveAction == SaveAction::SaveToClipboard && !m_noNotify) { QVariantMap emptyMap; m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "", summary, QStringList(), emptyMap, 0); - } else if ( !m_noNotify && !(m_saveIndex == 2 && m_saveFileName.isEmpty())) { + } else if ( !m_noNotify && !(m_saveIndex == SaveAction::SaveToSpecificDir && m_saveFileName.isEmpty())) { m_notifyDBInterface->Notify("Deepin Screenshot", 0, "deepin-screenshot", "", summary, actions, hints, 0); } @@ -1472,7 +1523,7 @@ iface.call("ShowManual", "deepin-screenshot"); exitApp(); } else { - qWarning() << "manual service not avilable, cannot open manual"; + qWarning() << "manual service not available, cannot open manual"; } } diff -Nru deepin-screenshot-4.1.8/src/mainwindow.h deepin-screenshot-5.0.0/src/mainwindow.h --- deepin-screenshot-4.1.8/src/mainwindow.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/mainwindow.h 2019-07-08 05:43:20.000000000 +0000 @@ -38,6 +38,7 @@ #include "src/widgets/shapeswidget.h" #include "src/utils/baseutils.h" #include "src/utils/shortcut.h" +#include "src/utils/saveutils.h" #include "src/utils/configsettings.h" #include "controller/menucontroller.h" @@ -97,7 +98,7 @@ void shotImgWidthEffect(); void saveScreenshot(); bool saveAction(const QPixmap &pix); - void sendNotify(int saveIndex, QString saveFilePath, const bool succeed); + void sendNotify(SaveAction saveAction, QString saveFilePath, const bool succeed); void reloadImage(QString effect); void onViewShortcut(); void onHelp(); @@ -118,6 +119,7 @@ void mouseMoveEvent(QMouseEvent *ev) Q_DECL_OVERRIDE; void mouseReleaseEvent(QMouseEvent *ev) Q_DECL_OVERRIDE; void hideEvent(QHideEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject* watched, QEvent* event) override; private: QPixmap getPixmapofRect(const QRect &rect); @@ -127,8 +129,7 @@ QPixmap m_backgroundPixmap; QList m_windowNames; - //SaveIndex indicate the save option(save to desktop, save to Picture dir,...) - int m_saveIndex = 0; + SaveAction m_saveIndex; //m_saveFileName is the storage path of the screenshot image. QString m_saveFileName; @@ -160,6 +161,8 @@ bool m_isShiftPressed = false; bool m_noNotify = false; bool m_needSaveScreenshot = false; + bool m_keyboardGrabbed = false; + bool m_keyboardReleased = false; QString m_selectAreaName; QPixmap m_resizeBigPix; diff -Nru deepin-screenshot-4.1.8/src/screenshot.cpp deepin-screenshot-5.0.0/src/screenshot.cpp --- deepin-screenshot-4.1.8/src/screenshot.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/screenshot.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -30,45 +30,20 @@ DWM_USE_NAMESPACE -Screenshot::Screenshot(QWidget *parent) - : QMainWindow(parent) +Screenshot::Screenshot(QObject *parent) + : QObject(parent) { } void Screenshot::initUI() { - setWindowFlags(Qt::X11BypassWindowManagerHint | Qt::WindowStaysOnTopHint| - Qt::FramelessWindowHint); - setAttribute(Qt::WA_TranslucentBackground); - - QPoint curPos = this->cursor().pos(); - DScreenWindowsUtil* swUtil = DScreenWindowsUtil::instance(curPos); - QRect bgRect = swUtil->backgroundRect(); - - this->move(bgRect.x(), bgRect.y()); - this->setFixedSize(bgRect.size()); - m_eventContainer = new EventContainer(this); - m_window = new MainWindow(m_eventContainer); - - setCentralWidget(m_window); - this->installEventFilter(this); - - connect(m_window, &MainWindow::releaseEvent, this, [=]{ - qDebug() << "release event !!!"; - m_keyboardReleased = true; - m_keyboardGrabbed = this->windowHandle()->setKeyboardGrabEnabled(false); - qDebug() << "keyboardGrabbed:" << m_keyboardGrabbed; - removeEventFilter(this); - }); - connect(m_window, &MainWindow::hideScreenshotUI, this, [=]{ - this->hide(); - }); + m_window = new MainWindow; } void Screenshot::startScreenshot() { initUI(); - this->show(); + m_window->show(); m_window->startScreenshot(); } @@ -96,58 +71,29 @@ void Screenshot::fullscreenScreenshot() { initUI(); - this->show(); + m_window->show(); m_window->fullScreenshot(); } void Screenshot::topWindowScreenshot() { initUI(); - this->show(); + m_window->show(); m_window->topWindow(); } void Screenshot::noNotifyScreenshot() { initUI(); - this->show(); + m_window->show(); m_window->noNotify(); } void Screenshot::savePathScreenshot(const QString &path) { initUI(); - this->show(); + m_window->show(); m_window->savePath(path); } -bool Screenshot::eventFilter(QObject* watched, QEvent *event) -{ - Q_UNUSED(watched); -#undef KeyPress -#undef KeyRelease - if (!m_keyboardGrabbed &&this->windowHandle() != NULL) - { - m_keyboardGrabbed = this->windowHandle()->setKeyboardGrabEnabled(true); - qDebug() << "m_keyboardGrabbed:" << m_keyboardGrabbed; - } - - if (m_keyboardGrabbed) - { - if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) { - m_eventContainer->handleEvent(event); - - return true; - } - - if (event->type() == QEvent::Paint) { - m_eventContainer->handleEvent(event); - return true; - } - } - - return false; -} - Screenshot::~Screenshot() {} - diff -Nru deepin-screenshot-4.1.8/src/screenshot.h deepin-screenshot-5.0.0/src/screenshot.h --- deepin-screenshot-4.1.8/src/screenshot.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/screenshot.h 2019-07-08 05:43:20.000000000 +0000 @@ -18,15 +18,15 @@ #ifndef SCREENSHOT_H #define SCREENSHOT_H -#include +#include #include "mainwindow.h" #include "eventcontainer.h" -class Screenshot : public QMainWindow { +class Screenshot : public QObject { Q_OBJECT public: - Screenshot(QWidget* parent = 0); + Screenshot(QObject* parent = 0); ~Screenshot(); public slots: @@ -37,16 +37,10 @@ void noNotifyScreenshot(); void savePathScreenshot(const QString &path); -protected: - bool eventFilter(QObject* watched, QEvent* event) override; - private: void initUI(); EventContainer* m_eventContainer = nullptr; - bool m_keyboardGrabbed = false; - bool m_keyboardReleased = false; - MainWindow* m_window = nullptr; }; diff -Nru deepin-screenshot-4.1.8/src/utils/configsettings.cpp deepin-screenshot-5.0.0/src/utils/configsettings.cpp --- deepin-screenshot-4.1.8/src/utils/configsettings.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/utils/configsettings.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -16,6 +16,7 @@ */ #include "configsettings.h" +#include "saveutils.h" #include #include @@ -45,7 +46,7 @@ setValue("text", "color_index", 3); setValue("text", "fontsize", 12); - setValue("save", "save_op", 0); + setValue("save", "save_op", SaveAction::SaveToDesktop); setValue("save", "save_quality", 100); } @@ -64,22 +65,10 @@ return m_configSettings; } -void ConfigSettings::setTemporarySaveAction(int save_op) +// TODO(justforlxz): use qApp to check shift +void ConfigSettings::setTemporarySaveAction(const std::pair temporarySaveAction) { - m_temporary_save_op = save_op; -} - -bool ConfigSettings::hasTemporarySaveAction() -{ - return m_temporary_save_op >= 0; -} - -int ConfigSettings::getAndResetTemporarySaveAction() -{ - int ret = m_temporary_save_op; - m_temporary_save_op = -1; - - return ret; + m_temporarySaveOp = temporarySaveAction; } void ConfigSettings::setValue(const QString &group, const QString &key, diff -Nru deepin-screenshot-4.1.8/src/utils/configsettings.h deepin-screenshot-5.0.0/src/utils/configsettings.h --- deepin-screenshot-4.1.8/src/utils/configsettings.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/utils/configsettings.h 2019-07-08 05:43:20.000000000 +0000 @@ -23,15 +23,16 @@ #include #include #include +#include +enum SaveAction:unsigned int; class ConfigSettings : public QObject { Q_OBJECT public: static ConfigSettings *instance(); - void setTemporarySaveAction(int save_op); - bool hasTemporarySaveAction(); - int getAndResetTemporarySaveAction(); + void setTemporarySaveAction(const std::pair temporarySaveAction); + inline std::pair getTemporarySaveAction() { return m_temporarySaveOp; } void setValue(const QString &group, const QString &key, QVariant val); QVariant value(const QString &group, const QString &key, @@ -48,7 +49,7 @@ ~ConfigSettings(); static ConfigSettings* m_configSettings; - int m_temporary_save_op = -1; + std::pair m_temporarySaveOp; QSettings* m_settings; QMutex m_mutex; }; diff -Nru deepin-screenshot-4.1.8/src/utils/saveutils.h deepin-screenshot-5.0.0/src/utils/saveutils.h --- deepin-screenshot-4.1.8/src/utils/saveutils.h 1970-01-01 00:00:00.000000000 +0000 +++ deepin-screenshot-5.0.0/src/utils/saveutils.h 2019-07-08 05:43:20.000000000 +0000 @@ -0,0 +1,16 @@ +#ifndef SAVEUTILS_H +#define SAVEUTILS_H + +#include + +enum SaveAction:unsigned int { + SaveToDesktop, + AutoSave, + SaveToSpecificDir, + SaveToClipboard, + SaveToAutoClipboard +}; + +Q_DECLARE_METATYPE(SaveAction); + +#endif // SAVEUTILS_H diff -Nru deepin-screenshot-4.1.8/src/widgets/fontsizewidget.cpp deepin-screenshot-5.0.0/src/widgets/fontsizewidget.cpp --- deepin-screenshot-4.1.8/src/widgets/fontsizewidget.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/fontsizewidget.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -28,13 +28,13 @@ const QSize BUTTON_SIZE = QSize(20, 16); const QSize LINE_EDIT_SIZE = QSize(43, 16); -Seperator::Seperator(QWidget *parent) +Separator::Separator(QWidget *parent) : QLabel(parent) { setFixedSize(1, 16); } -Seperator::~Seperator(){} +Separator::~Separator(){} FontSizeWidget::FontSizeWidget(QWidget *parent) : QLabel(parent) @@ -66,9 +66,9 @@ layout->addSpacing(4); layout->addWidget(m_fontSizeEdit); layout->addSpacing(0); - layout->addWidget( new Seperator(this)); + layout->addWidget( new Separator(this)); layout->addWidget(m_addSizeBtn); - layout->addWidget( new Seperator(this)); + layout->addWidget( new Separator(this)); layout->addSpacing(0); layout->addWidget(m_reduceSizeBtn); layout->addStretch(); diff -Nru deepin-screenshot-4.1.8/src/widgets/fontsizewidget.h deepin-screenshot-5.0.0/src/widgets/fontsizewidget.h --- deepin-screenshot-4.1.8/src/widgets/fontsizewidget.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/fontsizewidget.h 2019-07-08 05:43:20.000000000 +0000 @@ -25,12 +25,12 @@ #include #include -class Seperator : public QLabel +class Separator : public QLabel { Q_OBJECT public: - Seperator(QWidget* parent); - ~Seperator(); + Separator(QWidget* parent); + ~Separator(); }; class FontSizeWidget : public QLabel diff -Nru deepin-screenshot-4.1.8/src/widgets/resources/qss/fontsizewidget.qss deepin-screenshot-5.0.0/src/widgets/resources/qss/fontsizewidget.qss --- deepin-screenshot-4.1.8/src/widgets/resources/qss/fontsizewidget.qss 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/resources/qss/fontsizewidget.qss 2019-07-08 05:43:20.000000000 +0000 @@ -7,7 +7,7 @@ background-color: transparent; } -Seperator { +Separator { border: 1px solid rgba(0, 0, 0, 0.05); } QPushButton#AddSizeBtn { diff -Nru deepin-screenshot-4.1.8/src/widgets/resources/qss/subtoolbar.qss deepin-screenshot-5.0.0/src/widgets/resources/qss/subtoolbar.qss --- deepin-screenshot-4.1.8/src/widgets/resources/qss/subtoolbar.qss 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/resources/qss/subtoolbar.qss 2019-07-08 05:43:20.000000000 +0000 @@ -61,7 +61,7 @@ border-image: url(:/resources/images/size/thick_checked.png); } -QLabel#VerticalSeperatorLine { +QLabel#VerticalSeparatorLine { border: 1px solid rgba(0, 0, 0, 0.05); } diff -Nru deepin-screenshot-4.1.8/src/widgets/resources/qss/toolbar.qss deepin-screenshot-5.0.0/src/widgets/resources/qss/toolbar.qss --- deepin-screenshot-4.1.8/src/widgets/resources/qss/toolbar.qss 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/resources/qss/toolbar.qss 2019-07-08 05:43:20.000000000 +0000 @@ -1,3 +1,3 @@ -QLabel#HorSeperatorLine { +QLabel#HorSeparatorLine { border: 1px solid rgba(0, 0, 0, 0.05); } diff -Nru deepin-screenshot-4.1.8/src/widgets/shapeswidget.h deepin-screenshot-5.0.0/src/widgets/shapeswidget.h --- deepin-screenshot-4.1.8/src/widgets/shapeswidget.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/shapeswidget.h 2019-07-08 05:43:20.000000000 +0000 @@ -55,7 +55,7 @@ void reloadEffectImg(QString effect); void requestScreenshot(); void shapePressed(QString shape); - void saveBtnPressed(int index); + void saveBtnPressed(SaveAction action); void requestExit(); void menuNoFocus(); diff -Nru deepin-screenshot-4.1.8/src/widgets/subtoolbar.cpp deepin-screenshot-5.0.0/src/widgets/subtoolbar.cpp --- deepin-screenshot-4.1.8/src/widgets/subtoolbar.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/subtoolbar.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -23,6 +23,7 @@ #include "textbutton.h" #include "src/utils/baseutils.h" #include "src/utils/configsettings.h" +#include "src/utils/saveutils.h" #include @@ -83,10 +84,10 @@ thickLine->setObjectName("ThickLine"); rectBtnGroup->addButton(thickLine); btnList.append(thickLine); - //seperator line... - QLabel* vSeperatorLine = new QLabel(); - vSeperatorLine->setFixedSize(1, 16); - vSeperatorLine->setObjectName("VerticalSeperatorLine"); + //separator line... + QLabel* vSeparatorLine = new QLabel(); + vSeparatorLine->setFixedSize(1, 16); + vSeparatorLine->setObjectName("VerticalSeparatorLine"); //blur, mosaic... ToolButton* blurBtn = new ToolButton(); blurBtn->setObjectName("BlurBtn"); @@ -122,7 +123,7 @@ }); } rectLayout->addSpacing(16); - rectLayout->addWidget(vSeperatorLine); + rectLayout->addWidget(vSeparatorLine); rectLayout->addSpacing(16); rectLayout->addWidget(blurBtn); rectLayout->addSpacing(BUTTON_SPACING); @@ -172,10 +173,10 @@ thickLine->setObjectName("ArrowThickLine"); lineBtnGroup->addButton(thickLine); arrowBtnList.append(thickLine); - //seperator line... - QLabel* vSeperatorLine = new QLabel(); - vSeperatorLine->setFixedSize(1, 16); - vSeperatorLine->setObjectName("VerticalSeperatorLine"); + //separator line... + QLabel* vSeparatorLine = new QLabel(); + vSeparatorLine->setFixedSize(1, 16); + vSeparatorLine->setObjectName("VerticalSeparatorLine"); QButtonGroup* styleBtnGroup = new QButtonGroup; styleBtnGroup->setExclusive(true); ToolButton* lineBtn = new ToolButton(); @@ -211,7 +212,7 @@ }); } arrowLayout->addSpacing(16); - arrowLayout->addWidget(vSeperatorLine); + arrowLayout->addWidget(vSeparatorLine); arrowLayout->addSpacing(16); arrowLayout->addWidget(lineBtn); arrowLayout->addWidget(arrowBtn); @@ -390,35 +391,35 @@ void SubToolBar::initSaveLabel() { //save to... - QList toolBtnList; + std::map toolBtnMap; ToolButton* saveDesktopBtn = new ToolButton(); saveDesktopBtn->setFixedSize(SAVEBTN_SIZE); saveDesktopBtn->setObjectName("SaveToDesktop"); saveDesktopBtn->setTips(tr("Save to desktop")); - toolBtnList.append(saveDesktopBtn); + toolBtnMap[SaveAction::SaveToDesktop] = saveDesktopBtn; ToolButton* savePicBtn = new ToolButton(); savePicBtn->setFixedSize(SAVEBTN_SIZE); savePicBtn->setObjectName("SaveToPictureDir"); savePicBtn->setTips(tr("Autosave")); - toolBtnList.append(savePicBtn); + toolBtnMap[SaveAction::AutoSave] = savePicBtn; ToolButton* saveSpecificDirBtn = new ToolButton(); saveSpecificDirBtn->setFixedSize(SAVEBTN_SIZE); saveSpecificDirBtn->setObjectName("SaveToSpecificDir"); saveSpecificDirBtn->setTips(tr("Save to specified folder")); - toolBtnList.append(saveSpecificDirBtn); + toolBtnMap[SaveAction::SaveToSpecificDir] = saveSpecificDirBtn; ToolButton* saveClipboardBtn = new ToolButton(); saveClipboardBtn->setFixedSize(SAVEBTN_SIZE); saveClipboardBtn->setObjectName("SaveToClipboard"); saveClipboardBtn->setTips(tr("Copy to clipboard")); - toolBtnList.append(saveClipboardBtn); + toolBtnMap[SaveAction::SaveToClipboard] = saveClipboardBtn; ToolButton* saveAutoClipboardBtn = new ToolButton(); saveAutoClipboardBtn->setObjectName("SaveToAutoClipboard"); saveAutoClipboardBtn->setTips(tr("Autosave and copy to clipboard")); - toolBtnList.append(saveAutoClipboardBtn); + toolBtnMap[SaveAction::SaveToAutoClipboard] = saveAutoClipboardBtn; QLabel* lowQualityText = new QLabel(); lowQualityText->setObjectName("LowQualityLabel"); @@ -443,26 +444,38 @@ saveLayout->setMargin(0); saveLayout->setSpacing(0); saveLayout->addSpacing(1); - foreach (ToolButton* btn, toolBtnList) { - saveLayout->addWidget(btn); -// saveLayout->addSpacing(1); - connect(btn, &ToolButton::clicked, this, [=]{ - qDebug() << "saveButtonList:" << toolBtnList.indexOf(btn); - setSaveOption(toolBtnList.indexOf(btn)); - }); - connect(btn, &ToolButton::onEnter, this, [=]{ - emit showSaveTip(btn->getTips()); + + SaveAction saveAction = ConfigSettings::instance()->value("save", "save_op").value(); + + for (auto it = toolBtnMap.cbegin(); it != toolBtnMap.cend(); ++it) { + SaveAction action = it->first; + ToolButton* button = it->second; + + saveLayout->addWidget(button); + + connect(button, &ToolButton::clicked, this, [=] { + setSaveOption(action); }); - connect(btn, &ToolButton::onExist, this, [=]{ - emit hideSaveTip(); + + connect(button, &ToolButton::onEnter, this, [=] { + emit showSaveTip(button->getTips()); }); + + connect(button, &ToolButton::onExist, this, &SubToolBar::hideSaveTip); + + if (saveAction == action) { + button->setChecked(true); + } } - connect(this, &SubToolBar::saveBtnPressed, this, [=](int index){ - if (index < toolBtnList.length()) - toolBtnList[index]->click(); + + connect(this, &SubToolBar::saveBtnPressed, this, [=](int index) -> void { + for (auto it = toolBtnMap.cbegin(); it != toolBtnMap.cend(); ++it) { + if (static_cast(index) == it->first) { + return it->second->click(); + } + } }); - int saveOptionIndex = ConfigSettings::instance()->value("save", "save_op").toInt(); - toolBtnList[saveOptionIndex]->setChecked(true); + saveLayout->addStretch(); saveLayout->addWidget(lowQualityText); saveLayout->addWidget(saveQualitySlider); @@ -501,12 +514,12 @@ qDebug() << "subToolBar shape:" << shapeType; } -void SubToolBar::setSaveOption(int saveOption) { +void SubToolBar::setSaveOption(SaveAction action) { if (QGuiApplication::keyboardModifiers().testFlag(Qt::ShiftModifier)) { qDebug() << "Shift key holded: temporary action, will not remember the save_op."; - ConfigSettings::instance()->setTemporarySaveAction(saveOption); + ConfigSettings::instance()->setTemporarySaveAction(std::pair(true, action)); } else { - ConfigSettings::instance()->setValue("save", "save_op", saveOption); + ConfigSettings::instance()->setValue("save", "save_op", action); } emit saveAction(); diff -Nru deepin-screenshot-4.1.8/src/widgets/subtoolbar.h deepin-screenshot-5.0.0/src/widgets/subtoolbar.h --- deepin-screenshot-4.1.8/src/widgets/subtoolbar.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/subtoolbar.h 2019-07-08 05:43:20.000000000 +0000 @@ -23,6 +23,7 @@ #include #include +enum SaveAction:unsigned int; class SubToolBar : public QStackedWidget{ Q_OBJECT public: @@ -39,9 +40,9 @@ public slots: void switchContent(QString shapeType); - void setSaveOption(int saveOption); + void setSaveOption(SaveAction action); void setSaveQualityIndex(int saveQuality); - int getSaveQualityIndex(); + int getSaveQualityIndex(); void updateColor(QColor color); signals: @@ -50,7 +51,7 @@ void saveAction(); void showSaveTip(QString tips); void hideSaveTip(); - void saveBtnPressed(int index = 0); + void saveBtnPressed(SaveAction index); void defaultColorIndexChanged(int index); private: diff -Nru deepin-screenshot-4.1.8/src/widgets/toolbar.cpp deepin-screenshot-5.0.0/src/widgets/toolbar.cpp --- deepin-screenshot-4.1.8/src/widgets/toolbar.cpp 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/toolbar.cpp 2019-07-08 05:43:20.000000000 +0000 @@ -19,6 +19,7 @@ #include "toolbar.h" #include "src/utils/baseutils.h" +#include "src/utils/saveutils.h" #include #include @@ -52,9 +53,9 @@ setFixedSize(TOOLBAR_WIDGET_SIZE); qDebug() << "~~~~~~" << this->size(); - m_hSeperatorLine = new QLabel(this); - m_hSeperatorLine->setObjectName("HorSeperatorLine"); - m_hSeperatorLine->setFixedHeight(1); + m_hSeparatorLine = new QLabel(this); + m_hSeparatorLine->setObjectName("HorSeparatorLine"); + m_hSeparatorLine->setFixedHeight(1); m_majToolbar = new MajToolBar(this); m_subToolbar = new SubToolBar(this); @@ -63,11 +64,11 @@ vLayout->setMargin(0); vLayout->setSpacing(0); vLayout->addWidget(m_majToolbar, 0, Qt::AlignVCenter); - vLayout->addWidget(m_hSeperatorLine, 0, Qt::AlignVCenter); + vLayout->addWidget(m_hSeparatorLine, 0, Qt::AlignVCenter); vLayout->addWidget(m_subToolbar, 0, Qt::AlignVCenter); setLayout(vLayout); - m_hSeperatorLine->hide(); + m_hSeparatorLine->hide(); m_subToolbar->hide(); connect(m_majToolbar, &MajToolBar::buttonChecked, this, &ToolBarWidget::setExpand); @@ -126,7 +127,7 @@ m_expanded = true; setFixedSize(TOOLBAR_WIDGET_SIZE.width(), TOOLBAR_WIDGET_SIZE.height()*2+1); - m_hSeperatorLine->show(); + m_hSeparatorLine->show(); m_subToolbar->show(); } diff -Nru deepin-screenshot-4.1.8/src/widgets/toolbar.h deepin-screenshot-5.0.0/src/widgets/toolbar.h --- deepin-screenshot-4.1.8/src/widgets/toolbar.h 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/src/widgets/toolbar.h 2019-07-08 05:43:20.000000000 +0000 @@ -32,6 +32,7 @@ DWIDGET_USE_NAMESPACE +enum SaveAction:unsigned int; class ToolBarWidget : public DBlurEffectWidget { Q_OBJECT public: @@ -44,7 +45,7 @@ void colorChanged(QColor color); void saveImage(); void shapePressed(QString tool); - void saveBtnPressed(int index = 0); + void saveBtnPressed(SaveAction index); void saveSpecifiedPath(); void closed(); @@ -59,7 +60,7 @@ private: MajToolBar* m_majToolbar; - QLabel* m_hSeperatorLine; + QLabel* m_hSeparatorLine; SubToolBar* m_subToolbar; bool m_expanded; @@ -77,7 +78,7 @@ void updateColor(QColor color); void requestSaveScreenshot(); void shapePressed(QString tool); - void saveBtnPressed(int index = 0); + void saveBtnPressed(SaveAction index); void saveSpecifiedPath(); void closed(); diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_ar.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_ar.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_ar.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_ar.ts 2019-07-08 05:43:20.000000000 +0000 @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - + لقد فشل الحفظ . الرجاء قم بحفظه فى مجلدك الرئيسى . diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_el.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_el.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_el.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_el.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - + Επιλέξτε περιοχή @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - + Η αποθήκευση απέτυχε. Παρακαλώ, αποθηκεύστε το στον φάκελο "home" diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_es_419.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_es_419.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_es_419.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_es_419.ts 2019-07-08 05:43:20.000000000 +0000 @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - + Error al guardar. Por favor guárdelo en su directorio personal. diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_fi.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_fi.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_fi.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_fi.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - + valitse-alue @@ -18,7 +18,7 @@ DeepinScreenshot - DeepinKuvankaappaus + DeepinRuudunkaappaus @@ -30,17 +30,17 @@ Picture has been saved to %1 - + Kuva on tallennettu %1 PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) - + PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) Save failed. Please save it in your home directory. - + Tallennus epäonnistui. Tallenna se kotihakemistoon. @@ -68,7 +68,7 @@ Pencil - + Kynä @@ -78,7 +78,7 @@ Undo - + Unohda @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - + Deepin kuvakaappaus alkaa %1 sekunnin kuluttua @@ -165,7 +165,7 @@ Undo - + Unohda @@ -195,7 +195,7 @@ Pencil - + Kynä diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_fr.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_fr.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_fr.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_fr.ts 2019-07-08 05:43:20.000000000 +0000 @@ -18,7 +18,7 @@ DeepinScreenshot - Deepin Capture-écran + Capture d'écran Deepin @@ -113,7 +113,7 @@ Exit - Arrêter + Quitter @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - Deepin Capture-écran démarrera après %1 secondes + Capture d'écran Deepin démarrera après %1 secondes @@ -135,7 +135,7 @@ Save - Sauvegarder + Enregistrer @@ -155,7 +155,7 @@ Full screenshot - Capture d'écran complète + Capture plein écran @@ -170,7 +170,7 @@ Exit - Arrêter + Quitter @@ -273,7 +273,7 @@ Autosave and copy to clipboard - Sauvegarder et copier dans le presse-papiers + Sauvegarder automatiquement et copier dans le presse-papiers diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_hu.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_hu.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_hu.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_hu.ts 2019-07-08 05:43:20.000000000 +0000 @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - Mentés meghiúsult. Kérem, próbálja meg a saját home könyvtárába menteni. + A mentés meghiúsult. Kérlek, próbálj meg a saját home könyvtáradba menteni. diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_ko.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_ko.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_ko.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_ko.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - + 선택 영역 @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - + 저장 실패. 홈 디렉토리에 저장하세요. @@ -78,7 +78,7 @@ Undo - + 되돌리기 @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - + Deepin 스크린샷이 %1초 후 시작됩니다 @@ -165,7 +165,7 @@ Undo - + 되돌리기 diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_pt_BR.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_pt_BR.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_pt_BR.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_pt_BR.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - selecionar área + Área de Seleção @@ -40,12 +40,12 @@ Save failed. Please save it in your home directory. - Falha ao salvar. Por favor, salve-o em seu diretório pessoal. + Falha ao salvar. Por favor, salve em seu diretório pessoal. Picture has been saved to clipboard - A captura foi copiada para a área de tranferência + A imagem foi salva na área de tranferência @@ -98,7 +98,7 @@ Save to specified folder - Salvar na pasta específica + Salvar em pasta específica @@ -108,7 +108,7 @@ Autosave and copy to clipboard - Salvar automaticamente e copiar para área de transferência + Salvar e copiar para a área de transferência @@ -129,7 +129,7 @@ Start/Screenshot - Iniciar captura de tela + Iniciar Captura de Tela @@ -145,7 +145,7 @@ Size Adjustment - Ajuste de tamanho + Ajuste de Tamanho @@ -155,12 +155,12 @@ Full screenshot - Captura de tela cheia + Captura em tela cheia Delay screenshot - Captura com atraso + Atraso em captura da tela @@ -263,7 +263,7 @@ Save to specified folder - Salvar na pasta específica + Salvar em pasta específica @@ -273,7 +273,7 @@ Autosave and copy to clipboard - Salvar automaticamente e copiar para área de transferência + Salvar e copiar para área de transferência diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_pt.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_pt.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_pt.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_pt.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - select-area + selecione a área @@ -30,7 +30,7 @@ Picture has been saved to %1 - A fotografia foi guardada em %1 + A imagem foi guardada em %1 @@ -45,7 +45,7 @@ Picture has been saved to clipboard - A imagem foi guardada para o clipboard + A imagem foi guardada para a área de transferência @@ -68,7 +68,7 @@ Pencil - Pincel + Lápis @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - O Deepin Screenshot será iniciado em %1 segundos + Capturar Ecrã será iniciado em %1 segundos @@ -195,7 +195,7 @@ Pencil - Pincel + Lápis @@ -210,42 +210,42 @@ Increase height up - Aumentar a altura de cima + Aumentar a altura acima Increase height down - Aumentar a altura de baixo + Aumentar a altura abaixo Increase width left - Aumentar a largura da esquerda + Aumentar a largura à esquerda Increase width right - Aumentar a largura da direita + Aumentar a largura à direita Decrease height up - Diminuir a altura de cima + Diminuir a altura acima Decrease height down - Diminuir a altura de baixo + Diminuir a altura abaixo Decrease width left - Diminuir a largura da esquerda + Diminuir a largura à esquerda Decrease width right - Diminuir a largura da direita + Diminuir a largura à direita @@ -253,7 +253,7 @@ Save to desktop - Guardar para o ambiente de trabalho + Guardar no ambiente de trabalho diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_sr.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_sr.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_sr.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_sr.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - одабери-површину + изабери-површину @@ -108,7 +108,7 @@ Autosave and copy to clipboard - Аутоматски сачувај и копирај у бележницу + Ауто. сачувај и копирај у бележницу @@ -145,7 +145,7 @@ Size Adjustment - Прилагођавање Величине + Прилагођавање величине @@ -175,7 +175,7 @@ Copy to clipboard - Налепи у клипборд + Копирај у бележницу @@ -268,12 +268,12 @@ Copy to clipboard - Налепи у клипборд + Копирај у бележницу Autosave and copy to clipboard - Аутоматски сачувај и копирај у бележницу + Ауто. сачувај и копирај у бележницу diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_sv.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_sv.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_sv.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_sv.ts 2019-07-08 05:43:20.000000000 +0000 @@ -30,7 +30,7 @@ Picture has been saved to %1 - + Bilden har sparats till %1 @@ -68,7 +68,7 @@ Pencil - + Penna @@ -78,7 +78,7 @@ Undo - + Ångra @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - + Deepin Skärmdump startar efter %1 sekunder. @@ -165,7 +165,7 @@ Undo - + Ångra @@ -195,7 +195,7 @@ Pencil - + Penna diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_tr.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_tr.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_tr.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_tr.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - alan-seçin + alan-seç @@ -24,7 +24,7 @@ View - Göster + Görünüm @@ -40,7 +40,7 @@ Save failed. Please save it in your home directory. - Kaydedilemedi. Lütfen ana klasörünüze kaydedin. + Kayıt başarısız. Lütfen giriş dizinine kaydedin. @@ -113,7 +113,7 @@ Exit - Çık + Çıkış @@ -170,7 +170,7 @@ Exit - Çık + Çıkış diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot.ts deepin-screenshot-5.0.0/translations/deepin-screenshot.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1,12 +1,10 @@ - - - + MainWindow select-area - + select-area @@ -20,34 +18,34 @@ DeepinScreenshot - + DeepinScreenshot View - + View Picture has been saved to %1 - + Picture has been saved to %1 PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) - + PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) Save failed. Please save it in your home directory. - + Save failed. Please save it in your home directory. Picture has been saved to clipboard - + Picture has been saved to clipboard @@ -55,67 +53,67 @@ Rectangle - + Rectangle Ellipse - + Ellipse Arrow - + Arrow Pencil - + Pencil Text - + Text Undo - + Undo Save - + Save Save to desktop - + Save to desktop Autosave - + Autosave Save to specified folder - + Save to specified folder Copy to clipboard - + Copy to clipboard Autosave and copy to clipboard - + Autosave and copy to clipboard Exit - + Exit @@ -123,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - + Deepin Screenshot will start after %1 seconds @@ -131,123 +129,123 @@ Start/Screenshot - + Start/Screenshot Save - + Save Painting - + Painting Size Adjustment - + Size Adjustment Quick start - + Quick start Full screenshot - + Full screenshot Delay screenshot - + Delay screenshot Undo - + Undo Exit - + Exit Copy to clipboard - + Copy to clipboard Rectangle - + Rectangle Ellipse - + Ellipse Arrow - + Arrow Pencil - + Pencil Text - + Text Color - + Color Increase height up - + Increase height up Increase height down - + Increase height down Increase width left - + Increase width left Increase width right - + Increase width right Decrease height up - + Decrease height up Decrease height down - + Decrease height down Decrease width left - + Decrease width left Decrease width right - + Decrease width right @@ -255,37 +253,37 @@ Save to desktop - + Save to desktop Autosave - + Autosave Save to specified folder - + Save to specified folder Copy to clipboard - + Copy to clipboard Autosave and copy to clipboard - + Autosave and copy to clipboard Low - + Low High - + High - + \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/deepin-screenshot_zh_HK.ts deepin-screenshot-5.0.0/translations/deepin-screenshot_zh_HK.ts --- deepin-screenshot-4.1.8/translations/deepin-screenshot_zh_HK.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/deepin-screenshot_zh_HK.ts 2019-07-08 05:43:20.000000000 +0000 @@ -4,7 +4,7 @@ select-area - + select-area @@ -30,17 +30,17 @@ Picture has been saved to %1 - + 圖片已儲存到 %1 PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) - + PNG (*.png);;JPEG (*.jpg *.jpeg);; BMP (*.bmp);; PGM (*.pgm);;XBM (*.xbm);;XPM(*.xpm) Save failed. Please save it in your home directory. - + 儲存失敗。請將其儲存到您的主目錄中。 @@ -68,7 +68,7 @@ Pencil - + 鉛筆 @@ -121,7 +121,7 @@ Deepin Screenshot will start after %1 seconds - + Deepin 截圖將會於 %1 秒後啟動 @@ -195,7 +195,7 @@ Pencil - + 鉛筆 diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop_fi.ts deepin-screenshot-5.0.0/translations/desktop/desktop_fi.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop_fi.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop_fi.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1 +1 @@ -desktopDeepin ScreenshotDeepin-ruudunkaappausDelay ScreenshotFull ScreenshotScreen capturing applicationKuvakaappaus ohjelmaScreenshotRuudunkaappaus \ No newline at end of file +desktopDeepin ScreenshotDeepin ruudunkaappaajaDelay ScreenshotKaappaus viiveelläFull ScreenshotKokoruudun kaappausScreen capturing applicationRuudunkaappausohjelmaScreenshotRuudunkaappaus \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop_pt_BR.ts deepin-screenshot-5.0.0/translations/desktop/desktop_pt_BR.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop_pt_BR.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop_pt_BR.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1 +1 @@ -desktopDeepin ScreenshotCaptura de TelaDelay ScreenshotAtraso em captura de telaFull ScreenshotCaptura em tela cheiaScreen capturing applicationAplicação de captura de telaScreenshotCaptura de tela \ No newline at end of file +desktopDeepin ScreenshotCaptura de TelaDelay ScreenshotAtraso na Captura de TelaFull ScreenshotCaptura em Tela CheiaScreen capturing applicationAplicativo de Captura de TelaScreenshotCaptura de Tela \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop_sr.ts deepin-screenshot-5.0.0/translations/desktop/desktop_sr.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop_sr.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop_sr.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1 +1 @@ -desktopDeepin ScreenshotДипин Слика ЕкранаDelay ScreenshotОдложи усликавањеFull ScreenshotУсликавање целог екранаScreen capturing applicationПрограм за усликавање екранаScreenshotСлика екрана \ No newline at end of file +desktopDeepin ScreenshotДипин Слика ЕкранаDelay ScreenshotОдложи усликавањеFull ScreenshotУсликавање целог екранаScreen capturing applicationПрограм за усликавање екранаScreenshotСлика Екрана \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop_sv.ts deepin-screenshot-5.0.0/translations/desktop/desktop_sv.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop_sv.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop_sv.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1 +1 @@ -desktopDeepin ScreenshotDeepin skärmdumpDelay ScreenshotFull ScreenshotScreen capturing applicationSkärmbildsprogramScreenshotSkärmdump \ No newline at end of file +desktopDeepin ScreenshotDeepin skärmdumpDelay ScreenshotFördröj skärmdumpFull ScreenshotFullskärmdumpScreen capturing applicationSkärmbildsprogramScreenshotSkärmdump \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop.ts deepin-screenshot-5.0.0/translations/desktop/desktop.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1,3 +1 @@ - - -desktopDeepin ScreenshotDelay ScreenshotFull ScreenshotScreen capturing applicationScreenshot +desktopDeepin ScreenshotDeepin ScreenshotDelay ScreenshotDelay ScreenshotFull ScreenshotFull ScreenshotScreen capturing applicationScreen capturing applicationScreenshotScreenshot \ No newline at end of file diff -Nru deepin-screenshot-4.1.8/translations/desktop/desktop_zh_HK.ts deepin-screenshot-5.0.0/translations/desktop/desktop_zh_HK.ts --- deepin-screenshot-4.1.8/translations/desktop/desktop_zh_HK.ts 2019-02-25 07:54:37.000000000 +0000 +++ deepin-screenshot-5.0.0/translations/desktop/desktop_zh_HK.ts 2019-07-08 05:43:20.000000000 +0000 @@ -1 +1 @@ -desktopDeepin ScreenshotDeepin 截圖Delay ScreenshotFull ScreenshotScreen capturing application螢幕擷取程式Screenshot截圖設定 \ No newline at end of file +desktopDeepin ScreenshotDeepin 截圖Delay Screenshot延時截圖Full Screenshot全螢幕截圖Screen capturing application螢幕擷取程式Screenshot截圖 \ No newline at end of file