author | mickeyl <mickeyl> | 2003-12-20 17:47:08 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-20 17:47:08 (UTC) |
commit | d552ce3a94b53ae0fdb226411bd8f9e5bab6596a (patch) (unidiff) | |
tree | ca9f1edd3ed945c98a6cd4587a5094fe9b2b3d36 /libopie2/opieui/oversatileview.cpp | |
parent | 8e96eec63c67cfcd1fb202fe7346e5408a142f2e (diff) | |
download | opie-d552ce3a94b53ae0fdb226411bd8f9e5bab6596a.zip opie-d552ce3a94b53ae0fdb226411bd8f9e5bab6596a.tar.gz opie-d552ce3a94b53ae0fdb226411bd8f9e5bab6596a.tar.bz2 |
- start cleaning up (lot of stuff left)
- use odebug classes
Diffstat (limited to 'libopie2/opieui/oversatileview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opieui/oversatileview.cpp | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 6808539..65fe3d8 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp | |||
@@ -19,46 +19,47 @@ | |||
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | /* OPIE */ | ||
32 | |||
33 | #include <opie2/odebug.h> | ||
34 | #include <opie2/oversatileview.h> | ||
35 | #include <opie2/oversatileviewitem.h> | ||
36 | #include <opie2/olistview.h> | ||
37 | |||
31 | /* QT */ | 38 | /* QT */ |
32 | 39 | ||
33 | #include <qaction.h> | 40 | #include <qaction.h> |
34 | #include <qbrush.h> | 41 | #include <qbrush.h> |
35 | #include <qfont.h> | 42 | #include <qfont.h> |
36 | #include <qiconset.h> | 43 | #include <qiconset.h> |
37 | #include <qiconview.h> | 44 | #include <qiconview.h> |
38 | #include <qlistview.h> | 45 | #include <qlistview.h> |
39 | #include <qpalette.h> | 46 | #include <qpalette.h> |
40 | #include <qpoint.h> | 47 | #include <qpoint.h> |
41 | #include <qpopupmenu.h> | 48 | #include <qpopupmenu.h> |
42 | #include <qrect.h> | 49 | #include <qrect.h> |
43 | #include <qsize.h> | 50 | #include <qsize.h> |
44 | #include <qstring.h> | 51 | #include <qstring.h> |
45 | #include <qwidgetstack.h> | 52 | #include <qwidgetstack.h> |
46 | 53 | ||
47 | /* OPIE */ | ||
48 | |||
49 | #include <opie2/oversatileview.h> | ||
50 | #include <opie2/oversatileviewitem.h> | ||
51 | #include <opie2/olistview.h> | ||
52 | |||
53 | /* XPM */ | 54 | /* XPM */ |
54 | static const char * view_icon_xpm[] = { | 55 | static const char * view_icon_xpm[] = { |
55 | "16 16 16 1", | 56 | "16 16 16 1", |
56 | " c None", | 57 | " c None", |
57 | ".c #87BD88", | 58 | ".c #87BD88", |
58 | "+c #8BBE8B", | 59 | "+c #8BBE8B", |
59 | "@c #81BA81", | 60 | "@c #81BA81", |
60 | "#c #6DAF6D", | 61 | "#c #6DAF6D", |
61 | "$c #87BD87", | 62 | "$c #87BD87", |
62 | "%c #FCFDFC", | 63 | "%c #FCFDFC", |
63 | "&c #AED0AE", | 64 | "&c #AED0AE", |
64 | "*c #4E9C4C", | 65 | "*c #4E9C4C", |
@@ -280,25 +281,25 @@ void OVersatileView::setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened | |||
280 | _treeleaf = leaf; | 281 | _treeleaf = leaf; |
281 | _treeopened = opened; | 282 | _treeopened = opened; |
282 | _treeclosed = closed; | 283 | _treeclosed = closed; |
283 | } | 284 | } |
284 | else if ( mode == Icons ) | 285 | else if ( mode == Icons ) |
285 | { | 286 | { |
286 | _iconleaf = leaf; | 287 | _iconleaf = leaf; |
287 | _iconopened = opened; | 288 | _iconopened = opened; |
288 | _iconclosed = closed; | 289 | _iconclosed = closed; |
289 | } | 290 | } |
290 | else | 291 | else |
291 | { | 292 | { |
292 | qDebug( "OVersatileView::setDefaultPixmaps(): invalid mode" ); | 293 | odebug << "OVersatileView::setDefaultPixmaps(): invalid mode" << oendl; |
293 | } | 294 | } |
294 | } | 295 | } |
295 | 296 | ||
296 | QIconView* OVersatileView::iconView() const | 297 | QIconView* OVersatileView::iconView() const |
297 | { | 298 | { |
298 | return _iconview; | 299 | return _iconview; |
299 | } | 300 | } |
300 | 301 | ||
301 | OListView* OVersatileView::listView() const | 302 | OListView* OVersatileView::listView() const |
302 | { | 303 | { |
303 | return _listview; | 304 | return _listview; |
304 | } | 305 | } |
@@ -308,25 +309,25 @@ void OVersatileView::setViewMode( int mode ) | |||
308 | if ( mode == Tree ) | 309 | if ( mode == Tree ) |
309 | { | 310 | { |
310 | _viewmode = mode; | 311 | _viewmode = mode; |
311 | raiseWidget( _listview ); | 312 | raiseWidget( _listview ); |
312 | } | 313 | } |
313 | else if ( mode == Icons ) | 314 | else if ( mode == Icons ) |
314 | { | 315 | { |
315 | _viewmode = mode; | 316 | _viewmode = mode; |
316 | raiseWidget( _iconview ); | 317 | raiseWidget( _iconview ); |
317 | } | 318 | } |
318 | else | 319 | else |
319 | { | 320 | { |
320 | qDebug( "OVersatileView::setViewMode(): invalid mode" ); | 321 | odebug << "OVersatileView::setViewMode(): invalid mode" << oendl; |
321 | } | 322 | } |
322 | } | 323 | } |
323 | 324 | ||
324 | void OVersatileView::setIconViewMode() | 325 | void OVersatileView::setIconViewMode() |
325 | { | 326 | { |
326 | setViewMode( Icons ); | 327 | setViewMode( Icons ); |
327 | } | 328 | } |
328 | 329 | ||
329 | void OVersatileView::setTreeViewMode() | 330 | void OVersatileView::setTreeViewMode() |
330 | { | 331 | { |
331 | setViewMode( Tree ); | 332 | setViewMode( Tree ); |
332 | } | 333 | } |
@@ -334,39 +335,39 @@ void OVersatileView::setTreeViewMode() | |||
334 | bool OVersatileView::isValidViewMode( int mode ) const | 335 | bool OVersatileView::isValidViewMode( int mode ) const |
335 | { | 336 | { |
336 | switch ( _warningpolicy ) | 337 | switch ( _warningpolicy ) |
337 | { | 338 | { |
338 | case OVersatileView::None: | 339 | case OVersatileView::None: |
339 | { | 340 | { |
340 | return true; | 341 | return true; |
341 | } | 342 | } |
342 | case OVersatileView::Warn: | 343 | case OVersatileView::Warn: |
343 | { | 344 | { |
344 | if ( _viewmode != mode ) | 345 | if ( _viewmode != mode ) |
345 | { | 346 | { |
346 | qDebug( "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." ); | 347 | odebug << "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." << oendl; |
347 | return true; | 348 | return true; |
348 | } | 349 | } |
349 | } | 350 | } |
350 | case OVersatileView::WarnReturn: | 351 | case OVersatileView::WarnReturn: |
351 | { | 352 | { |
352 | if ( _viewmode != mode ) | 353 | if ( _viewmode != mode ) |
353 | { | 354 | { |
354 | qDebug( "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." ); | 355 | odebug << "OVersatileView::isValidViewMode(): Requested operation not valid in current mode." << oendl; |
355 | return false; | 356 | return false; |
356 | } | 357 | } |
357 | } | 358 | } |
358 | default: | 359 | default: |
359 | { | 360 | { |
360 | qWarning( "OVersatileView::isValidViewMode(): Inconsistent object state!" ); | 361 | owarn << "OVersatileView::isValidViewMode(): Inconsistent object state!" << oendl; |
361 | return true; | 362 | return true; |
362 | } | 363 | } |
363 | } | 364 | } |
364 | } | 365 | } |
365 | void OVersatileView::setWarningPolicy( int policy ) const | 366 | void OVersatileView::setWarningPolicy( int policy ) const |
366 | { | 367 | { |
367 | _warningpolicy = policy; | 368 | _warningpolicy = policy; |
368 | } | 369 | } |
369 | bool OVersatileView::warningPolicy() const | 370 | bool OVersatileView::warningPolicy() const |
370 | { | 371 | { |
371 | return _warningpolicy; | 372 | return _warningpolicy; |
372 | } | 373 | } |
@@ -439,25 +440,25 @@ void OVersatileView::returnPressed( QIconViewItem * item ) | |||
439 | void OVersatileView::onItem( QListViewItem * item ) | 440 | void OVersatileView::onItem( QListViewItem * item ) |
440 | { | 441 | { |
441 | emit( onItem( static_cast<OVersatileViewItem*>( item ) ) ); | 442 | emit( onItem( static_cast<OVersatileViewItem*>( item ) ) ); |
442 | } | 443 | } |
443 | 444 | ||
444 | void OVersatileView::onItem( QIconViewItem * item ) | 445 | void OVersatileView::onItem( QIconViewItem * item ) |
445 | { | 446 | { |
446 | emit( onItem( static_cast<OVersatileViewItem*>( item ) ) ); | 447 | emit( onItem( static_cast<OVersatileViewItem*>( item ) ) ); |
447 | } | 448 | } |
448 | 449 | ||
449 | void OVersatileView::expanded( QListViewItem *item ) // QListView | 450 | void OVersatileView::expanded( QListViewItem *item ) // QListView |
450 | { | 451 | { |
451 | //qDebug( "OVersatileView::expanded(): opening tree..." ); | 452 | //odebug << "OVersatileView::expanded(): opening tree..." << oendl; |
452 | if ( !_treeopened.isNull() ) | 453 | if ( !_treeopened.isNull() ) |
453 | item->setPixmap( 0, _treeopened ); | 454 | item->setPixmap( 0, _treeopened ); |
454 | emit( expanded( static_cast<OVersatileViewItem*>( item ) ) ); | 455 | emit( expanded( static_cast<OVersatileViewItem*>( item ) ) ); |
455 | } | 456 | } |
456 | void OVersatileView::collapsed( QListViewItem *item ) // QListView | 457 | void OVersatileView::collapsed( QListViewItem *item ) // QListView |
457 | { | 458 | { |
458 | if ( !_treeclosed.isNull() ) | 459 | if ( !_treeclosed.isNull() ) |
459 | item->setPixmap( 0, _treeclosed ); | 460 | item->setPixmap( 0, _treeclosed ); |
460 | emit( collapsed( static_cast<OVersatileViewItem*>( item ) ) ); | 461 | emit( collapsed( static_cast<OVersatileViewItem*>( item ) ) ); |
461 | } | 462 | } |
462 | 463 | ||
463 | //=============================================================================================// | 464 | //=============================================================================================// |