author | llornkcor <llornkcor> | 2002-11-03 17:59:00 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-03 17:59:00 (UTC) |
commit | 16e8fad81f7ee6045990f48edc84542638bf07d7 (patch) (unidiff) | |
tree | 96d836f914e0d1104d7c84830acac08a43ee4ac2 /noncore/multimedia/showimg/ImageFileSelector.cpp | |
parent | 2981b8f55f4a33860452f4571ef9f04781267489 (diff) | |
download | opie-16e8fad81f7ee6045990f48edc84542638bf07d7.zip opie-16e8fad81f7ee6045990f48edc84542638bf07d7.tar.gz opie-16e8fad81f7ee6045990f48edc84542638bf07d7.tar.bz2 |
added preferences dialog, and added slidshow
Diffstat (limited to 'noncore/multimedia/showimg/ImageFileSelector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/showimg/ImageFileSelector.cpp | 72 |
1 files changed, 33 insertions, 39 deletions
diff --git a/noncore/multimedia/showimg/ImageFileSelector.cpp b/noncore/multimedia/showimg/ImageFileSelector.cpp index 347300f..7872c09 100644 --- a/noncore/multimedia/showimg/ImageFileSelector.cpp +++ b/noncore/multimedia/showimg/ImageFileSelector.cpp | |||
@@ -23,6 +23,4 @@ | |||
23 | 23 | ||
24 | 24 | ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) | |
25 | 25 | : QWidget( parent ),fl(f) | |
26 | |||
27 | ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent,int w) : QWidget( parent ),fl(f) | ||
28 | { | 26 | { |
@@ -40,3 +38,3 @@ ThumbWidget::ThumbWidget(QPixmap p,QString text,const DocLnk& f,QWidget *parent, | |||
40 | 38 | ||
41 | void ThumbWidget::resizeEvent(QResizeEvent *e) | 39 | void ThumbWidget::resizeEvent(QResizeEvent *) |
42 | { | 40 | { |
@@ -55,3 +53,3 @@ void ThumbWidget::paintEvent( QPaintEvent *e ) | |||
55 | 53 | ||
56 | void ThumbWidget::mouseReleaseEvent(QMouseEvent* event) | 54 | void ThumbWidget::mouseReleaseEvent(QMouseEvent* ) |
57 | { | 55 | { |
@@ -62,4 +60,4 @@ void ThumbWidget::mouseReleaseEvent(QMouseEvent* event) | |||
62 | 60 | ||
63 | 61 | ImageFileSelectorItem::ImageFileSelectorItem( QListView *parent, const DocLnk &f) | |
64 | ImageFileSelectorItem::ImageFileSelectorItem( QListView *parent, const DocLnk &f): QListViewItem( parent ), fl( f ) | 62 | : QListViewItem( parent ), fl( f ) |
65 | { | 63 | { |
@@ -80,3 +78,4 @@ ImageFileSelectorItem::~ImageFileSelectorItem() | |||
80 | 78 | ||
81 | ImageFileSelector::ImageFileSelector( CURRENT_VIEW scv,QWidget *parent,const char *name ):QWidgetStack(parent) | 79 | ImageFileSelector::ImageFileSelector( CURRENT_VIEW scv,QWidget *parent,const char * ) |
80 | : QWidgetStack(parent) | ||
82 | { | 81 | { |
@@ -167,4 +166,5 @@ void ImageFileSelector::updateSizes() | |||
167 | 166 | ||
168 | void ImageFileSelector::reread(bool purgeCache) | 167 | void ImageFileSelector::reread(bool) |
169 | { | 168 | { |
169 | // qDebug("reread"); | ||
170 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); | 170 | ImageFileSelectorItem *item = (ImageFileSelectorItem *)detailed->selectedItem(); |
@@ -179,5 +179,5 @@ void ImageFileSelector::reread(bool purgeCache) | |||
179 | QListIterator<DocLnk> dit( files.children() ); | 179 | QListIterator<DocLnk> dit( files.children() ); |
180 | int y=0; | 180 | // int y=0; |
181 | int x=4; | 181 | // int x=4; |
182 | int totalHeight=4; | 182 | // int totalHeight=4; |
183 | ThumbWidget *l=0; | 183 | ThumbWidget *l=0; |
@@ -185,11 +185,8 @@ void ImageFileSelector::reread(bool purgeCache) | |||
185 | gl->expand(dit.count()/2,2); | 185 | gl->expand(dit.count()/2,2); |
186 | |||
187 | int i,j; | 186 | int i,j; |
188 | |||
189 | i=j=0; | 187 | i=j=0; |
190 | |||
191 | detailed->setUpdatesEnabled(false); | 188 | detailed->setUpdatesEnabled(false); |
192 | thumb->setUpdatesEnabled(false); | 189 | thumb->setUpdatesEnabled(false); |
193 | for ( ; dit.current(); ++dit ) | 190 | |
194 | { | 191 | for ( ; dit.current(); ++dit ) { |
195 | item = new ImageFileSelectorItem( detailed, **dit ); | 192 | item = new ImageFileSelectorItem( detailed, **dit ); |
@@ -201,26 +198,23 @@ void ImageFileSelector::reread(bool purgeCache) | |||
201 | ImageFileSelectorItem *ii; | 198 | ImageFileSelectorItem *ii; |
202 | // iterate through all items of the listview | 199 | // iterate through all items of the listview |
203 | for ( ; it.current(); ++it ) | 200 | for ( ; it.current(); ++it ) { |
204 | { | ||
205 | ii=(ImageFileSelectorItem *)it.current(); | 201 | ii=(ImageFileSelectorItem *)it.current(); |
206 | QImage img(ii->file().file()); | 202 | QImage img( ii->file().file() ); |
207 | img=img.smoothScale(64,64); | 203 | if( !img.isNull()) { |
208 | QPixmap pix; | 204 | img=img.smoothScale(64,64); |
209 | pix.convertFromImage(img); | 205 | QPixmap pix; |
210 | l=new ThumbWidget(pix,ii->file().name(),ii->file(),background,width); | 206 | pix.convertFromImage(img); |
211 | l->setBackgroundColor(colorGroup().base()); | 207 | l=new ThumbWidget(pix,ii->file().name(),ii->file(),background,width); |
212 | gl->addWidget(l,j,i); | 208 | l->setBackgroundColor(colorGroup().base()); |
213 | i++; | 209 | gl->addWidget(l,j,i); |
214 | if ( i==2 ) | 210 | i++; |
215 | { | 211 | if ( i==2 ) { |
216 | i=0; | 212 | i=0; |
217 | j++; | 213 | j++; |
214 | } | ||
215 | tList.append(l); | ||
216 | connect(l,SIGNAL(clicked(const DocLnk &)),this,SLOT(thumbClicked(const DocLnk &))); | ||
218 | } | 217 | } |
219 | tList.append(l); | ||
220 | connect(l,SIGNAL(clicked(const DocLnk &)),this,SLOT(thumbClicked(const DocLnk &))); | ||
221 | |||
222 | } | 218 | } |
223 | 219 | ||
224 | |||
225 | |||
226 | if ( !detailed->selectedItem() ) | 220 | if ( !detailed->selectedItem() ) |
@@ -232,3 +226,2 @@ void ImageFileSelector::reread(bool purgeCache) | |||
232 | thumb->update(); | 226 | thumb->update(); |
233 | |||
234 | } | 227 | } |
@@ -241,2 +234,3 @@ const DocLnk * ImageFileSelector::selected() | |||
241 | { | 234 | { |
235 | qDebug("image selected"); | ||
242 | ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); | 236 | ImageFileSelectorItem *item = (ImageFileSelectorItem *) detailed->selectedItem(); |