17 #include <qpushbutton.h>
18 #include <qfileinfo.h>
20 #include <qtoolbutton.h>
22 #include <QCloseEvent>
23 #include <Q3GridLayout>
28 #include "../../config.h"
29 #include "../../backend/album.h"
30 #include "../../backend/subalbum.h"
31 #include "../../backend/photo.h"
32 #include "../../backend/tools/imageTools.h"
41 QColor white(255, 255, 255);
42 QColor darkBlue(35, 75, 139);
51 while(curSubalbum != NULL)
54 while(curPhoto != NULL)
57 albumSize+=info.size();
60 albumSize+=info.size();
64 curSubalbum = curSubalbum->
getNext();
68 setCaption( tr(
"Album Statistics"));
74 titleFont.setWeight(QFont::Bold);
75 titleFont.setPointSize( titleFont.pointSize() + 2 );
78 statsFont.setWeight(QFont::Bold);
101 sizeOnDiskVal->setText( QString(tr(
"~%1 Bytes")).arg(albumSize) );
102 else if( albumSize/1024 < 1024)
103 sizeOnDiskVal->setText( QString(tr(
"~%1 Kb")).arg( ((
float)albumSize)/1024 ) );
104 else if( albumSize/(1024*1024) < 1024)
105 sizeOnDiskVal->setText( QString(tr(
"~%1 Mb")).arg( ((
float)albumSize)/(1024*1024) ) );
107 sizeOnDiskVal->setText( QString(tr(
"~%1 Gigs")).arg( ((
float)albumSize)/(1024*1024*1024) ) );
109 QString months[] = { tr(
"January"),
170 int newWidth, newHeight;
173 newWidth, newHeight);
174 QImage tImage2 = tImage.smoothScale( newWidth, newHeight );
175 albumImage =
new QPixmap( newWidth, newHeight );
188 closeButton =
new QPushButton( tr(
"Close"),
this );
189 closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
192 connect(
closeButton, SIGNAL(clicked()), SLOT(close()) );
194 setPaletteBackgroundColor( darkBlue );
201 numPhotos->setPaletteForegroundColor( white );
202 numPhotos->setPaletteBackgroundColor( darkBlue );
205 sizeOnDisk->setPaletteForegroundColor( white );
206 sizeOnDisk->setPaletteBackgroundColor( darkBlue );
209 created->setPaletteForegroundColor( white );
210 created->setPaletteBackgroundColor( darkBlue );
211 createdVal->setPaletteForegroundColor( white );
212 createdVal->setPaletteBackgroundColor( darkBlue );
213 modified->setPaletteForegroundColor( white );
214 modified->setPaletteBackgroundColor( darkBlue );
216 modifiedVal->setPaletteBackgroundColor( darkBlue );
217 albumTitle->setPaletteForegroundColor( white );
218 albumTitle->setPaletteBackgroundColor( darkBlue );
223 grid =
new Q3GridLayout(
this, 10, 3, 0);
227 grid->addRowSpacing( 0, 10 );
228 grid->setRowStretch( 0, 1 );
234 grid->addRowSpacing( 2, 10 );
235 grid->setRowStretch( 2, 1 );
248 grid->setRowStretch( 8, 1 );
264 setFixedSize(size());
275 QWidget::closeEvent( e );
void closeEvent(QCloseEvent *e)
AlbumStatistics(Album *album, QWidget *parent=0, const char *name=0)
QPushButton * closeButton
Close button.
An album contains Subalbums.
int getModificationDay()
Returns the last modified day.
Subalbum * getFirstSubalbum()
Returns a pointer to the first Subalbum.
int getCreationDay()
Returnst he creation day.
int getModificationYear()
Returns the last modified year.
int getNumSubalbums()
Returns number of subalbums.
int getModificationMonth()
Returns the last modified month.
int getCreationMonth()
Returns the creation month.
int getNumPhotos()
Returns the number of photos.
int getCreationYear()
Returns the creation year.
QString getName()
Gets the album name.
QPixmap * getRepresentativeImage(int size)
Returns the representative image.
A photo consists of a full size image, a smaller slide show image, a very small thumbnail image,...
Photo * getNext()
Returns next photo pointer.
QString getImageFilename()
Gets the image filename.
QString getSlideshowFilename()
Gets the slideshow filename.
A subalbum contains photos.
Subalbum * getNext()
Returns pointer to next subalbum.
Photo * getFirst()
Returns first photo in subalbum.