Diffstat (limited to 'noncore/multimedia/showimg/showimg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/showimg/showimg.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index 696a57b..24377ed 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp | |||
@@ -17,41 +17,43 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | // | 21 | // |
22 | // Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> | 22 | // Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> |
23 | // | 23 | // |
24 | 24 | ||
25 | #include "showimg.h" | 25 | #include "showimg.h" |
26 | #include "ImageFileSelector.h" | 26 | #include "ImageFileSelector.h" |
27 | #include "settingsdialog.h" | 27 | #include "settingsdialog.h" |
28 | 28 | ||
29 | 29 | /* OPIE */ | |
30 | #include <opie2/odebug.h> | ||
30 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
31 | |||
32 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
33 | #include <qpe/config.h> | 33 | #include <qpe/config.h> |
34 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
35 | #include <qtoolbar.h> | 35 | using namespace Opie::Core; |
36 | using namespace Opie::Ui; | ||
36 | 37 | ||
38 | /* QT */ | ||
39 | #include <qtoolbar.h> | ||
37 | #include <qaction.h> | 40 | #include <qaction.h> |
38 | #include <qfiledialog.h> | 41 | #include <qfiledialog.h> |
39 | #include <qmenubar.h> | 42 | #include <qmenubar.h> |
40 | #include <qspinbox.h> | 43 | #include <qspinbox.h> |
41 | 44 | ||
45 | /* STD */ | ||
42 | #include <math.h> | 46 | #include <math.h> |
43 | 47 | ||
44 | |||
45 | using namespace Opie::Ui; | ||
46 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) | 48 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) |
47 | : QDialog(parent,0,true) | 49 | : QDialog(parent,0,true) |
48 | { | 50 | { |
49 | setCaption(caption); | 51 | setCaption(caption); |
50 | 52 | ||
51 | if ( parent ) { | 53 | if ( parent ) { |
52 | setPalette(parent->palette()); | 54 | setPalette(parent->palette()); |
53 | } | 55 | } |
54 | 56 | ||
55 | b=brightness; | 57 | b=brightness; |
56 | img=image; | 58 | img=image; |
57 | 59 | ||
@@ -277,25 +279,25 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ ) | |||
277 | 279 | ||
278 | 280 | ||
279 | imagePanel = new ImagePane( stack ); | 281 | imagePanel = new ImagePane( stack ); |
280 | connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView())); | 282 | connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView())); |
281 | 283 | ||
282 | 284 | ||
283 | ImageFileSelector::CURRENT_VIEW cv; | 285 | ImageFileSelector::CURRENT_VIEW cv; |
284 | if(showThumbView) | 286 | if(showThumbView) |
285 | cv=ImageFileSelector::THUMBNAIL; | 287 | cv=ImageFileSelector::THUMBNAIL; |
286 | else | 288 | else |
287 | cv=ImageFileSelector::DETAILED; | 289 | cv=ImageFileSelector::DETAILED; |
288 | 290 | ||
289 | qDebug("cv = %d",cv); | 291 | odebug << "cv = " << cv << "" << oendl; |
290 | 292 | ||
291 | fileSelector = new ImageFileSelector( cv,stack, "fs"); | 293 | fileSelector = new ImageFileSelector( cv,stack, "fs"); |
292 | 294 | ||
293 | //switchThumbView(); | 295 | //switchThumbView(); |
294 | 296 | ||
295 | 297 | ||
296 | //fileSelector = new ImageFileSelector("image/*", stack, "fs"); | 298 | //fileSelector = new ImageFileSelector("image/*", stack, "fs"); |
297 | //fileSelector->setNewVisible(FALSE); | 299 | //fileSelector->setNewVisible(FALSE); |
298 | //fileSelector->setCloseVisible(FALSE); | 300 | //fileSelector->setCloseVisible(FALSE); |
299 | connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( closeFileSelector() ) ); | 301 | connect( fileSelector, SIGNAL( closeMe() ), this, SLOT( closeFileSelector() ) ); |
300 | connect( fileSelector, SIGNAL( fileSelected(const DocLnk&) ), | 302 | connect( fileSelector, SIGNAL( fileSelected(const DocLnk&) ), |
301 | this, SLOT( openFile(const DocLnk&) ) ); | 303 | this, SLOT( openFile(const DocLnk&) ) ); |
@@ -404,25 +406,25 @@ void ImageViewer::help() { | |||
404 | 406 | ||
405 | 407 | ||
406 | void ImageViewer::settings() | 408 | void ImageViewer::settings() |
407 | { | 409 | { |
408 | SettingsDialog dlg( this, 0, TRUE ); | 410 | SettingsDialog dlg( this, 0, TRUE ); |
409 | dlg.setDelay( slideDelay ); | 411 | dlg.setDelay( slideDelay ); |
410 | dlg.setRepeat( slideRepeat ); | 412 | dlg.setRepeat( slideRepeat ); |
411 | dlg.setReverse( slideReverse ); | 413 | dlg.setReverse( slideReverse ); |
412 | dlg.setRotate(rotateOnLoad); | 414 | dlg.setRotate(rotateOnLoad); |
413 | dlg.setFastLoad(fastLoad); | 415 | dlg.setFastLoad(fastLoad); |
414 | 416 | ||
415 | if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { | 417 | if ( QPEApplication::execDialog(&dlg) == QDialog::Accepted ) { |
416 | qDebug("<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>"); | 418 | odebug << "<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>" << oendl; |
417 | slideDelay = dlg.delay(); | 419 | slideDelay = dlg.delay(); |
418 | slideRepeat = dlg.repeat(); | 420 | slideRepeat = dlg.repeat(); |
419 | slideReverse = dlg.reverse(); | 421 | slideReverse = dlg.reverse(); |
420 | rotateOnLoad = dlg.rotate(); | 422 | rotateOnLoad = dlg.rotate(); |
421 | fastLoad = dlg.fastLoad(); | 423 | fastLoad = dlg.fastLoad(); |
422 | 424 | ||
423 | Config config( "ImageViewer" ); | 425 | Config config( "ImageViewer" ); |
424 | config.setGroup( "SlideShow" ); | 426 | config.setGroup( "SlideShow" ); |
425 | config.writeEntry( "Delay", slideDelay ); | 427 | config.writeEntry( "Delay", slideDelay ); |
426 | config.writeEntry( "Repeat", slideRepeat ); | 428 | config.writeEntry( "Repeat", slideRepeat ); |
427 | config.writeEntry("Reverse", slideReverse); | 429 | config.writeEntry("Reverse", slideReverse); |
428 | 430 | ||
@@ -496,25 +498,25 @@ void ImageViewer::doDelayedLoad() | |||
496 | { | 498 | { |
497 | show(delayLoad); | 499 | show(delayLoad); |
498 | } | 500 | } |
499 | 501 | ||
500 | void ImageViewer::show() | 502 | void ImageViewer::show() |
501 | { | 503 | { |
502 | normalView(); | 504 | normalView(); |
503 | QMainWindow::show(); | 505 | QMainWindow::show(); |
504 | } | 506 | } |
505 | 507 | ||
506 | void ImageViewer::show(const QString& fileref) | 508 | void ImageViewer::show(const QString& fileref) |
507 | { | 509 | { |
508 | // qDebug("Show "+fileref); | 510 | // odebug << "Show "+fileref << oendl; |
509 | bFromDocView = TRUE; | 511 | bFromDocView = TRUE; |
510 | closeFileSelector(); | 512 | closeFileSelector(); |
511 | DocLnk link(fileref); | 513 | DocLnk link(fileref); |
512 | if ( link.isValid() ) { | 514 | if ( link.isValid() ) { |
513 | openFile(link); | 515 | openFile(link); |
514 | } else { | 516 | } else { |
515 | filename = fileref; | 517 | filename = fileref; |
516 | updateCaption( fileref ); | 518 | updateCaption( fileref ); |
517 | loadImage( fileref ); | 519 | loadImage( fileref ); |
518 | } | 520 | } |
519 | } | 521 | } |
520 | 522 | ||
@@ -526,25 +528,25 @@ void ImageViewer::openFile() { | |||
526 | 528 | ||
527 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); | 529 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); |
528 | DocLnk link(str); | 530 | DocLnk link(str); |
529 | // if ( link.isValid() ) | 531 | // if ( link.isValid() ) |
530 | openFile(link); | 532 | openFile(link); |
531 | 533 | ||
532 | } | 534 | } |
533 | 535 | ||
534 | void ImageViewer::openFile( const DocLnk &link ) | 536 | void ImageViewer::openFile( const DocLnk &link ) |
535 | { | 537 | { |
536 | closeFileSelector(); | 538 | closeFileSelector(); |
537 | // DocLnk link(file); | 539 | // DocLnk link(file); |
538 | qDebug("open "+link.name()); | 540 | odebug << "open "+link.name() << oendl; |
539 | updateCaption( link.name() ); | 541 | updateCaption( link.name() ); |
540 | loadImage( link.file() ); | 542 | loadImage( link.file() ); |
541 | if (slideTimer->isActive()) { | 543 | if (slideTimer->isActive()) { |
542 | slideTimer->start(slideDelay * 1000, FALSE); | 544 | slideTimer->start(slideDelay * 1000, FALSE); |
543 | } | 545 | } |
544 | 546 | ||
545 | } | 547 | } |
546 | 548 | ||
547 | void ImageViewer::open() | 549 | void ImageViewer::open() |
548 | { | 550 | { |
549 | switchToFileSelector(); | 551 | switchToFileSelector(); |
550 | } | 552 | } |