Re: Full Screen Information
Carles Pina i Estany <[email protected]> Sat, 26 Jan 2008 19:47:25 +0100
| Newsgroups | gmane.comp.kde.gwenview |
|---|---|
| Message-ID | <[email protected]> |
Hello, On Jan/26/2008, Carles Pina i Estany wrote: > Patch is attached again. As always: any suggestion of change is patch was not attached, now yes :-) -- Carles Pina i Estany GPG id: 0x8CBDAE64 http://pinux.info Manresa - Barcelona ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Gwenview-general mailing list Gwenview-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/gwenview-general
exifinformation3.path
(text/plain, 10.2 KB)
Index: app/configdialog.ui
===================================================================
--- app/configdialog.ui (revision 766794)
+++ app/configdialog.ui (working copy)
@@ -5,29 +5,32 @@
<rect>
<x>0</x>
<y>0</y>
- <width>316</width>
- <height>198</height>
+ <width>313</width>
+ <height>331</height>
</rect>
</property>
- <layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string/>
</property>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>9</number>
+ </property>
+ <property name="topMargin" >
+ <number>9</number>
+ </property>
+ <property name="rightMargin" >
+ <number>9</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>9</number>
+ </property>
<item>
<widget class="QLabel" name="label" >
<property name="text" >
@@ -61,26 +64,44 @@
</layout>
</widget>
</item>
- <item>
+ <item row="1" column="0" >
<widget class="KButtonGroup" name="kcfg_AlphaBackgroundMode" >
<property name="title" >
<string>Transparent Image Background</string>
</property>
<layout class="QVBoxLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>9</number>
+ </property>
+ <property name="topMargin" >
+ <number>9</number>
+ </property>
+ <property name="rightMargin" >
+ <number>9</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>9</number>
+ </property>
<item>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QRadioButton" name="checkBoardRadioButton" >
<property name="text" >
@@ -108,12 +129,21 @@
</item>
<item>
<layout class="QHBoxLayout" >
- <property name="margin" >
- <number>0</number>
- </property>
<property name="spacing" >
<number>6</number>
</property>
+ <property name="leftMargin" >
+ <number>0</number>
+ </property>
+ <property name="topMargin" >
+ <number>0</number>
+ </property>
+ <property name="rightMargin" >
+ <number>0</number>
+ </property>
+ <property name="bottomMargin" >
+ <number>0</number>
+ </property>
<item>
<widget class="QRadioButton" name="solidColorRadioButton" >
<property name="text" >
@@ -149,15 +179,56 @@
</layout>
</widget>
</item>
- <item>
+ <item row="2" column="0" >
+ <widget class="QGroupBox" name="groupBox_2" >
+ <property name="title" >
+ <string>Full Screen Information:</string>
+ </property>
+ <layout class="QGridLayout" >
+ <item row="0" column="0" >
+ <layout class="QHBoxLayout" >
+ <item>
+ <widget class="QLineEdit" name="kcfg_FullScreenInfo" />
+ </item>
+ <item>
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Minimum</enum>
+ </property>
+ <property name="sizeHint" >
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </item>
+ <item row="1" column="0" >
+ <widget class="QLabel" name="label_2" >
+ <property name="text" >
+ <string>Filenname: %f
+Aperture. %a || Exposure Time: %t
+ISO: %i || Focal Length: %t</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item row="3" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
- <width>75</width>
- <height>51</height>
+ <width>20</width>
+ <height>40</height>
</size>
</property>
</spacer>
@@ -174,6 +245,7 @@
<class>KButtonGroup</class>
<extends>QGroupBox</extends>
<header>kbuttongroup.h</header>
+ <container>1</container>
</customwidget>
</customwidgets>
<resources/>
Index: app/mainwindow.h
===================================================================
--- app/mainwindow.h (revision 766794)
+++ app/mainwindow.h (working copy)
@@ -132,6 +132,8 @@
void editLocation();
+ void updateFullScreenInformation();
+
private:
class Private;
std::auto_ptr<Private> d;
Index: app/mainwindow.cpp
===================================================================
--- app/mainwindow.cpp (revision 766794)
+++ app/mainwindow.cpp (working copy)
@@ -22,6 +22,7 @@
// Qt
#include <QApplication>
#include <QDesktopWidget>
+#include <QLabel>
#include <QTimer>
#include <QShortcut>
#include <QSplitter>
@@ -69,6 +70,7 @@
#include <lib/cropsidebar.h>
#include <lib/document/documentfactory.h>
#include <lib/fullscreenbar.h>
+#include <lib/imagemetainfomodel.h>
#include <lib/gwenviewconfig.h>
#include <lib/imageviewpart.h>
#include <lib/mimetypeutils.h>
@@ -166,6 +168,8 @@
QString mCaption;
+ QLabel *mInformationLabel;
+
void setupWidgets() {
QWidget* centralWidget = new QWidget(mWindow);
mWindow->setCentralWidget(centralWidget);
@@ -191,6 +195,8 @@
mSlideShow = new SlideShow(mWindow);
+ mInformationLabel = new QLabel();
+
connect(mSaveBar, SIGNAL(requestSave(const KUrl&)),
mWindow, SLOT(save(const KUrl&)) );
connect(mSaveBar, SIGNAL(goToUrl(const KUrl&)),
@@ -472,6 +478,8 @@
mFullScreenBar->addWidget(mSlideShow->intervalWidget());
mFullScreenBar->addWidget(mSlideShow->optionsWidget());
+ mFullScreenBar->addWidget(mInformationLabel);
+
mFullScreenBar->resize(mFullScreenBar->sizeHint());
}
@@ -790,10 +798,57 @@
if (!d->mDocumentView->openUrl(url)) {
return;
}
+
+ Document::Ptr doc = DocumentFactory::instance()->load(url);
+ connect(doc.data(),SIGNAL(metaDataLoaded()),
+ SLOT(updateFullScreenInformation()) );
+
+ if (doc->isMetaDataLoaded()) {
+ updateFullScreenInformation();
+ }
+
+
d->mUrlToSelect = url;
d->selectUrlToSelect();
}
+void MainWindow::updateFullScreenInformation() {
+ if (!d->mFullScreenAction->isChecked()) {
+ return;
+ }
+
+ KUrl url = d->currentUrl();
+
+ Document::Ptr doc = DocumentFactory::instance()->load(url);
+
+ ImageMetaInfoModel *imageMetaInfo;
+ imageMetaInfo = doc->metaInfo();
+
+ QString aperture,exposuretime,iso,focallength;
+ QString filename;
+ QString label;
+
+ imageMetaInfo->getInfoForKey("Exif.Photo.FNumber",&label,&aperture);
+ imageMetaInfo->getInfoForKey("Exif.Photo.ExposureTime",&label,&exposuretime);
+ imageMetaInfo->getInfoForKey("Exif.Photo.ISOSpeedRatings",&label,&iso);
+ imageMetaInfo->getInfoForKey("Exif.Photo.FocalLength",&label,&focallength);
+
+ imageMetaInfo->getInfoForKey("General.Name",&label,&filename);
+
+ QString info = GwenviewConfig::fullScreenInfo();
+ info.replace("%a", aperture);
+ info.replace("%t", exposuretime);
+ info.replace("%i", iso);
+ info.replace("%l", focallength);
+ info.replace("%f", filename);
+
+ d->mInformationLabel->setText(info);
+
+ if (d->mFullScreenBar!=NULL) {
+ d->mFullScreenBar->resize(d->mFullScreenBar->sizeHint());
+ }
+}
+
void MainWindow::slotSetStatusBarText(const QString& message) {
d->mDocumentView->statusBar()->showMessage(message);
}
Index: lib/slideshow.cpp
===================================================================
--- lib/slideshow.cpp (revision 766794)
+++ lib/slideshow.cpp (working copy)
@@ -164,8 +164,6 @@
d->mRandomAction->setChecked(GwenviewConfig::random());
d->mIntervalSpinBox->setValue(GwenviewConfig::interval());
}
-
-
SlideShow::~SlideShow() {
GwenviewConfig::self()->writeConfig();
delete d;
@@ -201,14 +199,12 @@
GwenviewConfig::setInterval(sInterval);
}
-
void SlideShow::stop() {
d->mTimer->stop();
d->mStarted=false;
stateChanged(false);
}
-
void SlideShow::slotTimeout() {
LOG("");
KUrl url = d->findNextUrl();
@@ -235,12 +231,10 @@
return d->mIntervalSpinBox;
}
-
QWidget* SlideShow::optionsWidget() const {
return d->mOptionsButton;
}
-
void SlideShow::updateConfig() {
GwenviewConfig::setLoop(d->mLoopAction->isChecked());
GwenviewConfig::setRandom(d->mRandomAction->isChecked());
Index: lib/fullscreenbar.cpp
===================================================================
--- lib/fullscreenbar.cpp (revision 766794)
+++ lib/fullscreenbar.cpp (working copy)
@@ -95,6 +95,9 @@
" stop:0 #222, stop: 0.6 black, stop:1 black);"
" border: 1px solid #444;"
"}"
+ "QLabel {"
+ " color:lightgray;"
+ "}"
);
d->mTimeLine = new QTimeLine(SLIDE_DURATION, this);
Index: lib/gwenviewconfig.kcfg
===================================================================
--- lib/gwenviewconfig.kcfg (revision 766794)
+++ lib/gwenviewconfig.kcfg (working copy)
@@ -16,6 +16,12 @@
</entry>
</group>
+ <group name="FullScreen">
+ <entry name="FullScreenInfo" type="String">
+ <default>%f</default>
+ </entry>
+ </group>
+
<group name="ImageView">
<entry name="AlphaBackgroundMode" type="Enum">
<choices name="Gwenview::ImageView::AlphaBackgroundMode">