Adding upstream version 0.5.1.

Signed-off-by: Alf Gaida <agaida@siduction.org>
upstream/0.5.1
Alf Gaida 8 years ago
parent d53be78755
commit 4a8f2ba14a
No known key found for this signature in database
GPG Key ID: CD280A0B4D72827C

3
.gitignore vendored

@ -1,3 +0,0 @@
build
*.kdev4
src/translations/lximage-qt

@ -1,7 +1,22 @@
lximage-qt-0.5.0 / 2016-09-24
lximage-qt-0.5.1 / 2016-12-21
=============================
* Bump patch version and (#82)
* Create lximage-qt-screenshot_it.desktop (#83)
* Add *da.desktop files
* Desktop entry files: Fix typo in French translation
* [MRG] Display first image when loading a directory (v2) (#75)
* Desktop entry files: Add French translation
* Use lxqt-build-tools
* Use the new lxqt-build-tools package
* Fixed A Cast (#71)
* Remove cpack (#70)
0.5.0 / 2016-09-24
==================
* Release 0.5.0: Add changelog
* Bump version to 0.5.0 (#67)
* Remove Core and Qt from Categories in desktop file (#64)
* Extend README.md

@ -1,17 +1,18 @@
cmake_minimum_required(VERSION 3.0.2)
project(lximage-qt)
include(GNUInstallDirs)
set(MAJOR_VERSION 0)
set(MINOR_VERSION 5)
set(PATCH_VERSION 0)
set(PATCH_VERSION 1)
set(LXIMAGE_VERSION ${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION})
set(LXQTBT_MINIMUM_VERSION "0.3.0")
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_AUTOMOC ON)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5DBus REQUIRED)
@ -20,7 +21,7 @@ find_package(Qt5X11Extras REQUIRED QUIET)
find_package(Qt5LinguistTools REQUIRED QUIET)
find_package(Qt5Svg REQUIRED QUIET)
find_package(fm-qt REQUIRED QUIET)
find_package(lxqt REQUIRED) #just a build dependency for .desktop files translation
find_package(lxqt-build-tools ${LXQTBT_MINIMUM_VERSION} REQUIRED)
message(STATUS "Building with Qt ${Qt5Core_VERSION_STRING}")
include(LXQtCompilerSettings NO_POLICY_SCOPE)
@ -46,12 +47,3 @@ install(
DESTINATION "${CMAKE_INSTALL_DATADIR}/icons/hicolor/48x48/apps"
)
# building tarball with CPack -------------------------------------------------
include(InstallRequiredSystemLibraries)
set(CPACK_PACKAGE_VERSION_MAJOR ${MAJOR_VERSION})
set(CPACK_PACKAGE_VERSION_MINOR ${MINOR_VERSION})
set(CPACK_PACKAGE_VERSION_PATCH ${PATCH_VERSION})
set(CPACK_GENERATOR TBZ2)
set(CPACK_SOURCE_GENERATOR TBZ2)
set(CPACK_SOURCE_IGNORE_FILES /build/;.gitignore;.*~;.git;.kdev4;temp)
include(CPack)

@ -19,6 +19,8 @@
#include "mainwindow.h"
#include <QDir>
#include <QFileInfo>
#include <QMessageBox>
#include <QFileDialog>
#include <QImage>
@ -184,6 +186,9 @@ void MainWindow::onFolderLoaded(FmFolder* folder) {
thumbnailsView_->childView()->scrollTo(currentIndex_, QAbstractItemView::EnsureVisible);
}
}
// this is used to open the first image of a folder
else if (currentFile_ == nullptr)
on_actionFirst_triggered();
}
void MainWindow::openImageFile(QString fileName) {
@ -193,9 +198,31 @@ void MainWindow::openImageFile(QString fileName) {
fm_path_unref(path);
return;
}
// load the image file asynchronously
loadImage(path);
loadFolder(fm_path_get_parent(path));
if (QFileInfo(fileName).isDir()) {
if(fm_path_equal(path, folderPath_)) {
fm_path_unref(path);
return;
}
QList<QByteArray> formats = QImageReader::supportedImageFormats();
QStringList formatsFilters;
for (const QByteArray& format: formats)
formatsFilters << QString("*.") + format;
QDir dir(fileName);
dir.setNameFilters(formatsFilters);
dir.setFilter(QDir::Files | QDir::NoDotAndDotDot);
if(dir.entryList().isEmpty()) {
fm_path_unref(path);
return;
}
if(currentFile_)
fm_path_unref(currentFile_);
currentFile_ = nullptr;
loadFolder(path);
} else {
// load the image file asynchronously
loadImage(path);
loadFolder(fm_path_get_parent(path));
}
fm_path_unref(path);
}
@ -243,6 +270,12 @@ QString MainWindow::openFileName() {
return fileName;
}
QString MainWindow::openDirectory() {
QString directory = QFileDialog::getExistingDirectory(this,
tr("Open directory"), QString());
return directory;
}
// popup a file dialog and retrieve the selected image file name
QString MainWindow::saveFileName(QString defaultName) {
QString filterStr;
@ -275,6 +308,13 @@ void MainWindow::on_actionOpenFile_triggered() {
}
}
void MainWindow::on_actionOpenDirectory_triggered() {
QString directory = openDirectory();
if(!directory.isEmpty()) {
openImageFile(directory);
}
}
void MainWindow::on_actionNewWindow_triggered() {
Application* app = static_cast<Application*>(qApp);
MainWindow* window = new MainWindow();
@ -646,19 +686,19 @@ QGraphicsItem* MainWindow::getGraphicsItem() {
void MainWindow::on_actionRotateClockwise_triggered() {
QGraphicsItem *graphItem = getGraphicsItem();
bool isGifOrSvg (graphItem->isWidget() // we have gif animation
|| dynamic_cast<QGraphicsSvgItem*>(graphItem)); // an SVG image;
if(!image_.isNull()) {
QTransform transform;
transform.rotate(90.0);
image_ = image_.transformed(transform, Qt::SmoothTransformation);
/* when this is GIF or SVG, we need to rotate its corresponding QImage
without showing it to have the right measure for auto-zooming */
ui.view->setImage(image_, graphItem->isWidget() // we have gif animation
|| static_cast<QGraphicsSvgItem*>(graphItem) // an SVG image
? false : true);
ui.view->setImage(image_, isGifOrSvg ? false : true);
setModified(true);
}
if(graphItem) {
if(isGifOrSvg) {
QTransform transform;
transform.translate(graphItem->sceneBoundingRect().height(), 0);
transform.rotate(90);
@ -671,16 +711,17 @@ void MainWindow::on_actionRotateClockwise_triggered() {
void MainWindow::on_actionRotateCounterclockwise_triggered() {
QGraphicsItem *graphItem = getGraphicsItem();
bool isGifOrSvg (graphItem->isWidget()
|| dynamic_cast<QGraphicsSvgItem*>(graphItem));
if(!image_.isNull()) {
QTransform transform;
transform.rotate(-90.0);
image_ = image_.transformed(transform, Qt::SmoothTransformation);
ui.view->setImage(image_, graphItem->isWidget() || static_cast<QGraphicsSvgItem*>(graphItem)
? false : true);
ui.view->setImage(image_, isGifOrSvg ? false : true);
setModified(true);
}
if(graphItem) {
if(isGifOrSvg) {
QTransform transform;
transform.translate(0, graphItem->sceneBoundingRect().width());
transform.rotate(-90);

@ -74,6 +74,7 @@ protected:
void saveImage(FmPath* filePath); // save current image to a file
void loadFolder(FmPath* newFolderPath);
QString openFileName();
QString openDirectory();
QString saveFileName(QString defaultName = QString());
virtual void changeEvent(QEvent * event);
virtual void resizeEvent(QResizeEvent *event);
@ -87,6 +88,7 @@ private Q_SLOTS:
void on_actionAbout_triggered();
void on_actionOpenFile_triggered();
void on_actionOpenDirectory_triggered();
void on_actionNewWindow_triggered();
void on_actionSave_triggered();
void on_actionSaveAs_triggered();

@ -56,6 +56,7 @@
</property>
<addaction name="actionNewWindow"/>
<addaction name="actionOpenFile"/>
<addaction name="actionOpenDirectory"/>
<addaction name="actionScreenshot"/>
<addaction name="actionSave"/>
<addaction name="actionSaveAs"/>
@ -454,6 +455,17 @@
<string>File Properties</string>
</property>
</action>
<action name="actionOpenDirectory">
<property name="icon">
<iconset theme="document-open"/>
</property>
<property name="text">
<string>Open &amp;Directory</string>
</property>
<property name="shortcut">
<string>Ctrl+D</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>

@ -0,0 +1,3 @@
Name[da]=Skærmbillede
GenericName[da]=Skærmbillede
Comment[da]=Tag et skærmbillede

@ -0,0 +1,4 @@
#Translations
Name[fr]=Copie d'écran
GenericName[fr]=Copie d'écran
Comment[fr]=Faire une copie d'écran

@ -0,0 +1,4 @@
#Translations
Name[it]=Cattura schermata
GenericName[it]=Cattura una schermata
Comment[it]=Catturare una schermata

@ -0,0 +1,3 @@
Name[da]=LXImage
GenericName[da]=Billedfremviser
Comment[da]=LXQt-billedfremviseren

@ -0,0 +1,4 @@
#Translation
Name[fr]=LXImage
GenericName[fr]=Visionneuse d'images
Comment[fr]=Visionneuse d'images de LXQt
Loading…
Cancel
Save