aboutsummaryrefslogtreecommitdiffstats
path: root/Plugins/MultiEditorImage
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
committerLibravatarUnit 193 <unit193@unit193.net>2021-12-17 07:06:30 -0500
commit1fdc150116cad39aae5c5da407c3312b47a59e3a (patch)
tree123c79a4d7ad2d45781ba03ce939f7539fb428d8 /Plugins/MultiEditorImage
parentfeda8a7db8d1d7c5439aa8f8feef7cc0dd2b59a0 (diff)
New upstream version 3.3.3+dfsg1.upstream/3.3.3+dfsg1
Diffstat (limited to 'Plugins/MultiEditorImage')
-rw-r--r--Plugins/MultiEditorImage/MultiEditorImage_ru.ts30
-rw-r--r--Plugins/MultiEditorImage/multieditorimage.cpp16
-rw-r--r--Plugins/MultiEditorImage/package.xml10
3 files changed, 29 insertions, 27 deletions
diff --git a/Plugins/MultiEditorImage/MultiEditorImage_ru.ts b/Plugins/MultiEditorImage/MultiEditorImage_ru.ts
index f383c0f..a43e653 100644
--- a/Plugins/MultiEditorImage/MultiEditorImage_ru.ts
+++ b/Plugins/MultiEditorImage/MultiEditorImage_ru.ts
@@ -1,73 +1,73 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
-<TS version="2.1" language="ru_RU">
+<TS version="2.0" language="ru_RU">
<context>
<name>MultiEditorImage</name>
<message>
<location filename="multieditorimage.cpp" line="26"/>
<source>Load from file</source>
- <translation type="unfinished"></translation>
+ <translation>Загрузить из файла</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="27"/>
<source>Store in a file</source>
- <translation type="unfinished"></translation>
+ <translation>Сохранить в файл</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="28"/>
<source>Zoom in by 25%</source>
- <translation type="unfinished"></translation>
+ <translation>Приблизить на 25%</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="29"/>
<source>Zoom out by 25%</source>
- <translation type="unfinished"></translation>
+ <translation>Отдалить на 25%</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="30"/>
<source>Reset zoom</source>
- <translation type="unfinished"></translation>
+ <translation>Сбросить масштаб</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="100"/>
<source>Images (*.jpeg *.jpg *.png *.bmp *.gif *.tiff *.jp2 *.svg *.tga *.icns *.webp *.wbmp *.mng);;All files (*)</source>
- <translation type="unfinished"></translation>
+ <translation>Изображения (*.jpeg *.jpg *.png *.bmp *.gif *.tiff *.jp2 *.svg *.tga *.icns *.webp *.wbmp *.mng);;Все файлы (*)</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="101"/>
<source>Open image</source>
- <translation type="unfinished"></translation>
+ <translation>Открыть изображение</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="110"/>
<source>Could not open file %1 for reading.</source>
<oldsource>Could not nopen file %1 for reading.</oldsource>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть файл %1 для чтения.</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="130"/>
<source>All files (*)</source>
- <translation type="unfinished"></translation>
+ <translation>Все файлы (*)</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="132"/>
<source>Save image</source>
- <translation type="unfinished"></translation>
+ <translation>Сохранить изображение</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="143"/>
<source>Tried to save image under different format (%1) than original (%2), but application failed to convert it. The image with unchanged format (%3) will be saved under the given name (%4)</source>
- <translation type="unfinished"></translation>
+ <translation>Осуществлена попытка сохранить изображение в формате (%1), отличном от исходного (%2), однако приложению не удалось произвести конвертацию. Изображение в исходном формате (%3) будет сохранено с указанным именем (%4)</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="154"/>
<source>Could not nopen file %1 for writting.</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно открыть файл %1 для записи.</translation>
</message>
<message>
<location filename="multieditorimage.cpp" line="159"/>
<source>Could not write image into the file %1</source>
- <translation type="unfinished"></translation>
+ <translation>Невозможно записать изображение в файл %1</translation>
</message>
</context>
<context>
@@ -75,7 +75,7 @@
<message>
<location filename="multieditorimage.cpp" line="250"/>
<source>Image</source>
- <translation type="unfinished"></translation>
+ <translation>Изображение</translation>
</message>
</context>
</TS>
diff --git a/Plugins/MultiEditorImage/multieditorimage.cpp b/Plugins/MultiEditorImage/multieditorimage.cpp
index 59b5a49..68ed77b 100644
--- a/Plugins/MultiEditorImage/multieditorimage.cpp
+++ b/Plugins/MultiEditorImage/multieditorimage.cpp
@@ -89,7 +89,11 @@ void MultiEditorImage::notifyAboutUnload()
void MultiEditorImage::scale(double factor)
{
currentZoom *= factor;
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+ imgLabel->resize(currentZoom * imgLabel->pixmap(Qt::ReturnByValue).size());
+#else
imgLabel->resize(currentZoom * imgLabel->pixmap()->size());
+#endif
zoomInAct->setEnabled(currentZoom < 10.0);
zoomOutAct->setEnabled(currentZoom > 0.1);
}
@@ -135,9 +139,17 @@ void MultiEditorImage::saveFile()
setFileDialogInitPathByFile(fileName);
- if (!format.isEmpty() && !fileName.endsWith(format, Qt::CaseInsensitive) && imgLabel->pixmap())
+ QPixmap thePixmap =
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
+ imgLabel->pixmap(Qt::ReturnByValue);
+#else
+ *(imgLabel->pixmap());
+#endif
+
+ imgLabel->resize(currentZoom * thePixmap.size());
+ if (!format.isEmpty() && !fileName.endsWith(format, Qt::CaseInsensitive) && !thePixmap.isNull())
{
- if (!imgLabel->pixmap()->save(fileName))
+ if (!thePixmap.save(fileName))
{
QString requestedFormat = QFileInfo(fileName).completeSuffix();
notifyWarn(tr("Tried to save image under different format (%1) than original (%2), "
diff --git a/Plugins/MultiEditorImage/package.xml b/Plugins/MultiEditorImage/package.xml
deleted file mode 100644
index c638c22..0000000
--- a/Plugins/MultiEditorImage/package.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0"?>
-<Package>
- <DisplayName>Image editor/viewer plugin</DisplayName>
- <Description>Plugin that introduces image editor/viewer tab for cell editor and form view.</Description>
- <Version>%VERSION%</Version>
- <ReleaseDate>%DATE%</ReleaseDate>
- <Name>pl.com.salsoft.sqlitestudio.plugins.multieditorimage</Name>
- <Dependencies>pl.com.salsoft.sqlitestudio.plugins</Dependencies>
- <Default>true</Default>
-</Package> \ No newline at end of file