Update translations

pull/1/head
reionwong 5 years ago
parent 32c63566b4
commit 4b6e20f416

@ -80,7 +80,39 @@ void ScreenshotView::saveFile(QRect rect)
QImage image("/tmp/cutefish-screenshot.png");
QImage cropped = image.copy(rect);
cropped.save(fileName);
bool saved = cropped.save(fileName);
if (saved) {
QDBusInterface iface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
"org.freedesktop.Notifications",
QDBusConnection::sessionBus());
if (iface.isValid()) {
QList<QVariant> args;
args << "cutefish-screenshot";
args << ((unsigned int) 0);
args << "cutefish-screenshot";
args << "";
args << tr("The picture has been saved to %1").arg(fileName);
args << QStringList();
args << QVariantMap();
args << (int) 10;
iface.asyncCallWithArgumentList("Notify", args);
}
}
removeTmpFile();
this->quit();
}
void ScreenshotView::copyToClipboard(QRect rect)
{
setVisible(false);
QImage image("/tmp/cutefish-screenshot.png");
QImage cropped = image.copy(rect);
QClipboard *clipboard = qGuiApp->clipboard();
clipboard->setImage(cropped);
QDBusInterface iface("org.freedesktop.Notifications",
"/org/freedesktop/Notifications",
@ -92,7 +124,7 @@ void ScreenshotView::saveFile(QRect rect)
args << ((unsigned int) 0);
args << "cutefish-screenshot";
args << "";
args << tr("The picture has been saved to %1").arg(fileName);
args << tr("The picture has been saved to the clipboard");
args << QStringList();
args << QVariantMap();
args << (int) 10;
@ -103,19 +135,6 @@ void ScreenshotView::saveFile(QRect rect)
this->quit();
}
void ScreenshotView::copyToClipboard(QRect rect)
{
setVisible(false);
QImage image("/tmp/cutefish-screenshot.png");
QImage cropped = image.copy(rect);
QClipboard *clipboard = qGuiApp->clipboard();
clipboard->setImage(cropped);
removeTmpFile();
this->quit();
}
void ScreenshotView::removeTmpFile()
{
bool success = QFile("/tmp/cutefish-screenshot.png").remove();

@ -4,9 +4,14 @@
<context>
<name>ScreenshotView</name>
<message>
<location filename="../src/screenshotview.cpp" line="95"/>
<location filename="../src/screenshotview.cpp" line="96"/>
<source>The picture has been saved to %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../src/screenshotview.cpp" line="127"/>
<source>The picture has been saved to the clipboard</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

@ -4,9 +4,14 @@
<context>
<name>ScreenshotView</name>
<message>
<location filename="../src/screenshotview.cpp" line="95"/>
<location filename="../src/screenshotview.cpp" line="96"/>
<source>The picture has been saved to %1</source>
<translation> %1</translation>
</message>
<message>
<location filename="../src/screenshotview.cpp" line="127"/>
<source>The picture has been saved to the clipboard</source>
<translation></translation>
</message>
</context>
</TS>

Loading…
Cancel
Save