summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2015-03-21 10:29:09 +0100
committerArno <am@disconnect.de>2015-03-21 10:29:09 +0100
commitac814248b52912a366d2eb62e8ff00f2caa7e4d7 (patch)
treee0f5957dd8fbb2572342fcbab4cf02e8a3a15ee1
parent6116312ed547b9fa14e43b9f7a0e3d4d2007d2af (diff)
downloadSheMov-ac814248b52912a366d2eb62e8ff00f2caa7e4d7.tar.gz
SheMov-ac814248b52912a366d2eb62e8ff00f2caa7e4d7.tar.bz2
SheMov-ac814248b52912a366d2eb62e8ff00f2caa7e4d7.zip
Move NewPicsDialog to topLeft + selectAll
When calling NewPicsDialog from PictureViewer, move it to the top left corner to not cover the pic itself. Also, select all pics from current directory when no files are marked.
-rw-r--r--filesystemwidget.cpp2
-rw-r--r--pictureviewer2.cpp19
-rw-r--r--pictureviewer2.h2
3 files changed, 18 insertions, 5 deletions
diff --git a/filesystemwidget.cpp b/filesystemwidget.cpp
index eadbac8..461780f 100644
--- a/filesystemwidget.cpp
+++ b/filesystemwidget.cpp
@@ -223,6 +223,8 @@ void FilesystemWidget::fileViewActivated(const QModelIndex &idx){
mPicViewer->setShowMappingItem(false);
mPicViewer->setShowMarkItem(true);
selectAllPV();
+ QFileInfo fi(path);
+ mPicViewer->setCurrentDir(fi.absolutePath());
mPicViewer->selectPic(path);
return;
}
diff --git a/pictureviewer2.cpp b/pictureviewer2.cpp
index dbb1763..7a8e2b2 100644
--- a/pictureviewer2.cpp
+++ b/pictureviewer2.cpp
@@ -317,15 +317,24 @@ void PictureViewer2::deleteCurrent(){
}
void PictureViewer2::showNewPicsDialog(){
- if(mMarkedFiles.isEmpty()){
- return;
- }
mNewPicsDlg->clearFiles();
QStringList fileList;
- foreach(QVariantList v, mMarkedFiles){
- fileList << v.at(PicFilesModel::FullPath).toString();;
+ if(mMarkedFiles.isEmpty()){
+ if(!mCurrentDir.isEmpty()){
+ QDir d(mCurrentDir);
+ foreach(QFileInfo fi, d.entryInfoList()){
+ fileList << fi.absoluteFilePath();
+ }
+ }else{
+ return;
+ }
+ }else{
+ foreach(QVariantList v, mMarkedFiles){
+ fileList << v.at(PicFilesModel::FullPath).toString();
+ }
}
mNewPicsDlg->addFiles(fileList);
+ mNewPicsDlg->move(0, 20);
mNewPicsDlg->exec();
}
diff --git a/pictureviewer2.h b/pictureviewer2.h
index 99405e0..c9c7688 100644
--- a/pictureviewer2.h
+++ b/pictureviewer2.h
@@ -45,6 +45,7 @@ class PictureViewer2 : public QGraphicsView {
void setShowInfoItem(bool show) { mShowInfoItem = show; }
void setShowMappingItem(bool show) { mShowMappingItem = show; }
void setShowMarkItem(bool show) { mShowMarkItem = show; }
+ void setCurrentDir(const QString &curDir) { mCurrentDir = curDir; }
const PicDataList marked() { return mMarkedFiles; }
PicData picData(const QString &fullPath);
virtual QSize sizeHint() const;
@@ -115,6 +116,7 @@ class PictureViewer2 : public QGraphicsView {
bool mShowInfoItem;
bool mShowMappingItem;
bool mShowMarkItem;
+ QString mCurrentDir;
};
class PictureViewer2Item : public QGraphicsItem {