rev 3119 - in kde-extras/digikam/trunk/debian: . patches
Tom Albers
tomalbers-guest at costa.debian.org
Sun Feb 12 19:12:02 UTC 2006
Author: tomalbers-guest
Date: 2006-02-12 19:12:01 +0000 (Sun, 12 Feb 2006)
New Revision: 3119
Added:
kde-extras/digikam/trunk/debian/patches/11_kdesvn_r508791_add_more_options_to_albumproperties.diff
Modified:
kde-extras/digikam/trunk/debian/changelog
Log:
Add 11_kdesvn_r508791_add_more_options_to_albumproperties.diff
Modified: kde-extras/digikam/trunk/debian/changelog
===================================================================
--- kde-extras/digikam/trunk/debian/changelog 2006-02-12 17:47:44 UTC (rev 3118)
+++ kde-extras/digikam/trunk/debian/changelog 2006-02-12 19:12:01 UTC (rev 3119)
@@ -9,6 +9,11 @@
* patches/10_kdesvn_r507545_fix_jpeg_on_ppc.diff: fix endiness problem
with jpeg. Fix: (Closes: #351931)
+ [ Tom Albers ]
+ * patches/11_kdesvn_r508791_add_more_options_to_albumproperties.diff
+ adds two buttons to album properties to set the date picker to oldest
+ or newest image in the album.
+
-- Debian KDE Extras Team <pkg-kde-extras at lists.alioth.debian.org> Wed, 8 Feb 2006 01:46:51 +0100
digikam (0.8.1-2) unstable; urgency=low
Added: kde-extras/digikam/trunk/debian/patches/11_kdesvn_r508791_add_more_options_to_albumproperties.diff
===================================================================
--- kde-extras/digikam/trunk/debian/patches/11_kdesvn_r508791_add_more_options_to_albumproperties.diff 2006-02-12 17:47:44 UTC (rev 3118)
+++ kde-extras/digikam/trunk/debian/patches/11_kdesvn_r508791_add_more_options_to_albumproperties.diff 2006-02-12 19:12:01 UTC (rev 3119)
@@ -0,0 +1,168 @@
+Index: digikam/digikam/albumpropsedit.cpp
+===================================================================
+--- digikam/digikam/albumpropsedit.cpp (revision 508790)
++++ digikam/digikam/albumpropsedit.cpp (revision 508791)
+@@ -33,6 +33,7 @@
+ #include <qlistview.h>
+ #include <qframe.h>
+ #include <qheader.h>
++#include <qhbox.h>
+ #include <qpushbutton.h>
+
+ // KDE includes.
+@@ -129,11 +130,22 @@
+ topLayout->addWidget( datePicker_, 5, 1 );
+ dateLabel->setBuddy( datePicker_ );
+
+- QPushButton *avgButton = new QPushButton(
+- i18n("This is a button which calculates "
+- "the average date",
+- "&Average" ), plainPage( ) );
+- topLayout->addWidget( avgButton, 6, 1);
++ QHBox *buttonRow = new QHBox( plainPage( ) );
++ QPushButton *dateLowButton = new QPushButton(
++ i18n("Button to select the date of the first image",
++ "&Lowest" ),
++ buttonRow );
++ QPushButton *dateAvgButton = new QPushButton(
++ i18n("This is a button which calculates the average date",
++ "&Average" ),
++ buttonRow );
++ QPushButton *dateHighButton = new QPushButton(
++ i18n("Button to select the date of the last image",
++ "&Highest" ),
++ buttonRow );
++
++
++ topLayout->addWidget( buttonRow, 6, 1);
+
+ setTabOrder(titleEdit_, collectionCombo_);
+ setTabOrder(collectionCombo_, commentsEdit_);
+@@ -174,8 +186,12 @@
+
+ connect(titleEdit_, SIGNAL(textChanged(const QString&)),
+ SLOT(slotTitleChanged(const QString&)));
+- connect(avgButton, SIGNAL( clicked() ),
+- SLOT( slotAverageButtonClicked()));
++ connect(dateLowButton, SIGNAL( clicked() ),
++ SLOT( slotDateLowButtonClicked()));
++ connect(dateAvgButton, SIGNAL( clicked() ),
++ SLOT( slotDateAverageButtonClicked()));
++ connect(dateHighButton, SIGNAL( clicked() ),
++ SLOT( slotDateHighButtonClicked()));
+
+ adjustSize();
+ }
+@@ -272,11 +288,35 @@
+ enableButtonOK(!newtitle.isEmpty());
+ }
+
+-void AlbumPropsEdit::slotAverageButtonClicked()
++void AlbumPropsEdit::slotDateLowButtonClicked()
+ {
+ setCursor( KCursor::waitCursor() );
+
+ AlbumDB* db = AlbumManager::instance()->albumDB();
++ QDate avDate = db->getAlbumLowestDate( album_->id() );
++ setCursor( KCursor::arrowCursor() );
++
++ if ( avDate.isValid() )
++ datePicker_->setDate( avDate );
++}
++
++void AlbumPropsEdit::slotDateHighButtonClicked()
++{
++ setCursor( KCursor::waitCursor() );
++
++ AlbumDB* db = AlbumManager::instance()->albumDB();
++ QDate avDate = db->getAlbumHighestDate( album_->id() );
++ setCursor( KCursor::arrowCursor() );
++
++ if ( avDate.isValid() )
++ datePicker_->setDate( avDate );
++}
++
++void AlbumPropsEdit::slotDateAverageButtonClicked()
++{
++ setCursor( KCursor::waitCursor() );
++
++ AlbumDB* db = AlbumManager::instance()->albumDB();
+ QDate avDate = db->getAlbumAverageDate( album_->id() );
+ setCursor( KCursor::arrowCursor() );
+
+Index: digikam/digikam/albumdb.cpp
+===================================================================
+--- digikam/digikam/albumdb.cpp (revision 508790)
++++ digikam/digikam/albumdb.cpp (revision 508791)
+@@ -1060,6 +1060,26 @@
+ return values[0];
+ }
+
++QDate AlbumDB::getAlbumLowestDate(int albumID)
++{
++ QStringList values;
++ execSql( QString("SELECT MIN(datetime) FROM Images "
++ "WHERE dirid=%1 GROUP BY dirid")
++ .arg( albumID ), &values);
++ QDate itemDate = QDate::fromString( values[0], Qt::ISODate );
++ return itemDate;
++}
++
++QDate AlbumDB::getAlbumHighestDate(int albumID)
++{
++ QStringList values;
++ execSql( QString("SELECT MAX(datetime) FROM Images "
++ "WHERE dirid=%1 GROUP BY dirid")
++ .arg( albumID ), &values);
++ QDate itemDate = QDate::fromString( values[0], Qt::ISODate );
++ return itemDate;
++}
++
+ QDate AlbumDB::getAlbumAverageDate(int albumID)
+ {
+ QStringList values;
+Index: digikam/digikam/albumpropsedit.h
+===================================================================
+--- digikam/digikam/albumpropsedit.h (revision 508790)
++++ digikam/digikam/albumpropsedit.h (revision 508791)
+@@ -84,7 +84,9 @@
+
+ private slots:
+ void slotTitleChanged(const QString& newtitle);
+- void slotAverageButtonClicked();
++ void slotDateLowButtonClicked();
++ void slotDateAverageButtonClicked();
++ void slotDateHighButtonClicked();
+ };
+
+ #endif /* ALBUMPROPSEDIT_H */
+Index: digikam/digikam/albumdb.h
+===================================================================
+--- digikam/digikam/albumdb.h (revision 508790)
++++ digikam/digikam/albumdb.h (revision 508791)
+@@ -442,9 +442,23 @@
+ QString getAlbumURL(int albumID);
+
+ /**
++ * Returns the lowest/oldest date of all images for that album.
++ * @param albumID the id of the album to calculate
++ * @return the date.
++ */
++ QDate getAlbumLowestDate(int albumID);
++
++ /**
++ * Returns the highest/newest date of all images for that album.
++ * @param albumID the id of the album to calculate
++ * @return the date.
++ */
++ QDate getAlbumHighestDate(int albumID);
++
++ /**
+ * Returns the average date of all images for that album.
+- * @param albumID the id of the album to calculate the average in
+- * @return the average date.
++ * @param albumID the id of the album to calculate
++ * @return the date.
+ */
+ QDate getAlbumAverageDate(int albumID);
+
More information about the pkg-kde-commits
mailing list