summaryrefslogtreecommitdiffstats
path: root/pictureswidget.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2012-03-03 09:57:26 +0100
committerArno <am@disconnect.de>2012-03-03 09:57:26 +0100
commit42890664aef1588a92fe9cf816766aae06e3aedb (patch)
tree59472c13a1fbe55816ac6c198a7c876f8bee9a88 /pictureswidget.cpp
parent969d923fa3cb5197b6cda9b60fc4abf8552e24f6 (diff)
downloadSheMov-42890664aef1588a92fe9cf816766aae06e3aedb.tar.gz
SheMov-42890664aef1588a92fe9cf816766aae06e3aedb.tar.bz2
SheMov-42890664aef1588a92fe9cf816766aae06e3aedb.zip
Customize menus and toolbar for PictureView
* Added 4 new icons for PictureView-actions. * simplified SheMov::tabChanged(int) * fix long standing bug with QActionGroups in SheMov. Enable and disable all actions according to the active tab
Diffstat (limited to 'pictureswidget.cpp')
-rw-r--r--pictureswidget.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/pictureswidget.cpp b/pictureswidget.cpp
index 22bf840..fdcba30 100644
--- a/pictureswidget.cpp
+++ b/pictureswidget.cpp
@@ -27,12 +27,14 @@
#include "mappingtreemodel.h"
#include "smglobals.h"
-PicturesWidget::PicturesWidget(QWidget *parent) : QWidget(parent) {
+PicturesWidget::PicturesWidget(QWidget *parent) : QWidget(parent), mWindowTitleBase(tr("Picture archive")) {
//setup gui
QSplitter *splitter = new QSplitter;
mMappingTree = new MappingTreeWidget;
mPictureView = new PictureView;
connect(mMappingTree, SIGNAL(mappingChanged(int)), mPictureView, SLOT(mappingChanged(int)));
+ //emit needWindowtitleChange(QString) when mapping selection changes
+ connect(mMappingTree, SIGNAL(mappingChanged(int)), this, SLOT(constructWindowTitle()));
connect(mPictureView, SIGNAL(newFileMappigs()), this, SLOT(setMappingColors()));
connect(mPictureView, SIGNAL(editPicsMappings()), this, SLOT(editMappings()));
splitter->addWidget(mMappingTree);
@@ -40,9 +42,8 @@ PicturesWidget::PicturesWidget(QWidget *parent) : QWidget(parent) {
splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 3);
- //mis
+ //misc
mEditDialog = new MappingEditDialog(this);
- //connect()
//put it all togehter
QHBoxLayout *mainLayout = new QHBoxLayout;
@@ -74,6 +75,15 @@ void PicturesWidget::editMappings(){
}
}
+void PicturesWidget::constructWindowTitle(){
+ QString windowTitle = mWindowTitleBase;
+ MappingData selected = mMappingTree->selectedItem();
+ if(selected.id != -1){
+ windowTitle = QString("%1 - [%2]").arg(mWindowTitleBase).arg(selected.path.join("/"));
+ }
+ emit needWindowTitleChange(windowTitle);
+}
+
PictureView::PictureView(QWidget *parent) : QTreeView(parent) {
//setup model
mModel = new PicFilesModel(QStringList() << tr("Filename") << tr("SizeNum") << tr("Format") << tr("Full Path") << tr("Id") << tr("Added") << tr("Md5Sum") << tr("Size"), this);