[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeplasma-addons/applets/frame
From: Sujith Haridasan <sujith.h () gmail ! com>
Date: 2010-09-16 19:24:25
Message-ID: 20100916192425.90C66AC871 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1176132 by sujithh:
Fixing an issue with frame applet. The issue was when a folder is dropped,
and if the folder doesn't have image(s),proper message wasn't displayed. The message \
has been improved.
M +11 -1 picture.cpp
M +2 -0 picture.h
M +4 -1 slideshow.cpp
M +1 -0 slideshow.h
--- trunk/KDE/kdeplasma-addons/applets/frame/picture.cpp #1176131:1176132
@@ -39,6 +39,7 @@
: QObject(parent)
{
m_defaultImage = KGlobal::dirs()->findResource("data", \
"plasma-applet-frame/picture-frame-default.jpg"); + m_checkDir = false;
// listen for changes to the file we're displaying
m_fileWatch = new KDirWatch(this);
@@ -82,8 +83,12 @@
connect(m_job, SIGNAL(finished(KJob*)), this, SLOT(slotFinished(KJob*)));
emit pictureLoaded(defaultPicture(i18n("Loading image...")));
} else {
- if (currentUrl.isEmpty()) {
+ if (m_checkDir) {
loader = new ImageLoader(m_defaultImage);
+ m_message = i18nc("Info", "Dropped folder is empty. Please drop a folder \
with image(s)"); + m_checkDir = false;
+ } else if (currentUrl.isEmpty()) {
+ loader = new ImageLoader(m_defaultImage);
m_message = i18nc("Info", "Put your photo here or drop a folder to start \
a slideshow"); kDebug() << "default image ...";
} else {
@@ -121,6 +126,11 @@
QThreadPool::globalInstance()->start(loader);
}
+void Picture::customizeEmptyMessage()
+{
+ m_checkDir = true;
+}
+
void Picture::slotFinished( KJob *job )
{
QString filename = m_currentUrl.fileName();
--- trunk/KDE/kdeplasma-addons/applets/frame/picture.h #1176131:1176132
@@ -62,6 +62,7 @@
void slotFinished(KJob *job);
void reload();
void checkImageLoaded(QImage newImage);
+ void customizeEmptyMessage();
private:
void setPath(const QString &path);
@@ -70,6 +71,7 @@
KDirWatch *m_fileWatch;
QString m_message;
QString m_defaultImage;
+ bool m_checkDir;
};
--- trunk/KDE/kdeplasma-addons/applets/frame/slideshow.cpp #1176131:1176132
@@ -37,6 +37,7 @@
m_picture = new Picture(this);
connect(m_picture, SIGNAL(pictureLoaded(QImage)), this, \
SLOT(pictureLoaded(QImage))); + connect(this, SIGNAL(emptyDirMessage()), \
m_picture, SLOT(customizeEmptyMessage()));
m_timer = new QTimer(this);
connect(m_timer, SIGNAL(timeout()), this, SLOT(nextPicture()));
@@ -72,9 +73,11 @@
// select 1st picture
firstPicture();
- // TODO do something meaningful if m_picturePaths.empty()
kDebug() << "Loaded " << m_picturePaths.size() << " pictures in " << \
setDirStart.secsTo(QDateTime::currentDateTime()) << " seconds"; + if( \
m_picturePaths.isEmpty()) { + emit emptyDirMessage();
}
+}
void SlideShow::setImage(const QString &imagePath)
{
--- trunk/KDE/kdeplasma-addons/applets/frame/slideshow.h #1176131:1176132
@@ -57,6 +57,7 @@
Q_SIGNALS:
void pictureUpdated();
+ QString emptyDirMessage();
private Q_SLOTS:
void clearPicture();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic