37 :
39{
40
41 QColor white(255, 255, 255);
42 QColor darkBlue(35, 75, 139);
43
44
46
47
48 int albumSize = 0;
50 QFileInfo info;
51 while(curSubalbum != NULL)
52 {
54 while(curPhoto != NULL)
55 {
57 albumSize+=info.size();
58
60 albumSize+=info.size();
61
63 }
64 curSubalbum = curSubalbum->
getNext();
65 }
66
67
68 setCaption( tr("Album Statistics"));
69
70
72
74 titleFont.setWeight(QFont::Bold);
75 titleFont.setPointSize( titleFont.pointSize() + 2 );
76
78 statsFont.setWeight(QFont::Bold);
79
81
82
83
89
95
100 if(albumSize < 1024)
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) ) );
106 else
107 sizeOnDiskVal->setText( QString(tr(
"~%1 Gigs")).arg( ((
float)albumSize)/(1024*1024*1024) ) );
108
109 QString months[] = { tr("January"),
110 tr("February"),
111 tr("March"),
112 tr("April"),
113 tr("May"),
114 tr("June"),
115 tr("July"),
116 tr("August"),
117 tr("September"),
118 tr("October"),
119 tr("November"),
120 tr("December") };
121
128 cVal = cVal + "st";
131 cVal = cVal + "nd";
134 cVal = cVal + "rd";
135 else
136 cVal = cVal + "th";
138
141
145
149 mVal = mVal + "st";
152 mVal = mVal + "nd";
155 mVal = mVal + "rd";
156 else
157 mVal = mVal + "th";
161
162
165
166
168 {
170 int newWidth, newHeight;
172 300, 300,
173 newWidth, newHeight);
174 QImage tImage2 = tImage.smoothScale( newWidth, newHeight );
175 albumImage =
new QPixmap( newWidth, newHeight );
178 }
179
182 {
184 }
186
187
188 closeButton =
new QPushButton( tr(
"Close"),
this );
189 closeButton->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
192 connect(
closeButton, SIGNAL(clicked()), SLOT(close()) );
193
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 );
221
222
223 grid =
new Q3GridLayout(
this, 10, 3, 0);
226
227 grid->addRowSpacing( 0, 10 );
228 grid->setRowStretch( 0, 1 );
229
230
232
233
234 grid->addRowSpacing( 2, 10 );
235 grid->setRowStretch( 2, 1 );
236
247
248 grid->setRowStretch( 8, 1 );
249
250
251
254
258
259
261
262
263 show();
264 setFixedSize(size());
265
266}
QPushButton * closeButton
Close button.
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.