-rw-r--r-- | noncore/multimedia/showimg/showimg.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index 0fbffe7..d6f0733 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp | |||
@@ -490,97 +490,97 @@ void ImageViewer::switchToImageView() | |||
490 | iconToolBar->show(); | 490 | iconToolBar->show(); |
491 | 491 | ||
492 | imagePanel->setPosition(0,0); | 492 | imagePanel->setPosition(0,0); |
493 | 493 | ||
494 | } | 494 | } |
495 | 495 | ||
496 | 496 | ||
497 | void ImageViewer::setDocument(const QString& fileref) | 497 | void ImageViewer::setDocument(const QString& fileref) |
498 | { | 498 | { |
499 | delayLoad = fileref; | 499 | delayLoad = fileref; |
500 | switchToImageView(); | 500 | switchToImageView(); |
501 | QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) ); | 501 | QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) ); |
502 | } | 502 | } |
503 | 503 | ||
504 | void ImageViewer::doDelayedLoad() | 504 | void ImageViewer::doDelayedLoad() |
505 | { | 505 | { |
506 | show(delayLoad); | 506 | show(delayLoad); |
507 | } | 507 | } |
508 | 508 | ||
509 | void ImageViewer::show() | 509 | void ImageViewer::show() |
510 | { | 510 | { |
511 | normalView(); | 511 | normalView(); |
512 | QMainWindow::show(); | 512 | QMainWindow::show(); |
513 | } | 513 | } |
514 | 514 | ||
515 | void ImageViewer::show(const QString& fileref) | 515 | void ImageViewer::show(const QString& fileref) |
516 | { | 516 | { |
517 | // qDebug("Show "+fileref); | 517 | // qDebug("Show "+fileref); |
518 | bFromDocView = TRUE; | 518 | bFromDocView = TRUE; |
519 | closeFileSelector(); | 519 | closeFileSelector(); |
520 | DocLnk link(fileref); | 520 | DocLnk link(fileref); |
521 | if ( link.isValid() ) { | 521 | if ( link.isValid() ) { |
522 | openFile(link); | 522 | openFile(link); |
523 | } else { | 523 | } else { |
524 | filename = fileref; | 524 | filename = fileref; |
525 | updateCaption( fileref ); | 525 | updateCaption( fileref ); |
526 | loadImage( fileref ); | 526 | loadImage( fileref ); |
527 | } | 527 | } |
528 | } | 528 | } |
529 | 529 | ||
530 | void ImageViewer::openFile() { | 530 | void ImageViewer::openFile() { |
531 | MimeTypes types; | 531 | MimeTypes types; |
532 | QStringList image; | 532 | QStringList image; |
533 | image << "image/*"; | 533 | image << "image/*"; |
534 | types.insert("Images", image); | 534 | types.insert("Images", image); |
535 | 535 | ||
536 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); | 536 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); |
537 | DocLnk link(str); | 537 | DocLnk link(str); |
538 | if ( link.isValid() ) | 538 | // if ( link.isValid() ) |
539 | openFile(link); | 539 | openFile(link); |
540 | 540 | ||
541 | } | 541 | } |
542 | 542 | ||
543 | void ImageViewer::openFile( const DocLnk &link ) | 543 | void ImageViewer::openFile( const DocLnk &link ) |
544 | { | 544 | { |
545 | closeFileSelector(); | 545 | closeFileSelector(); |
546 | // DocLnk link(file); | 546 | // DocLnk link(file); |
547 | qDebug("open "+link.name()); | 547 | qDebug("open "+link.name()); |
548 | updateCaption( link.name() ); | 548 | updateCaption( link.name() ); |
549 | loadImage( link.file() ); | 549 | loadImage( link.file() ); |
550 | if (slideTimer->isActive()) { | 550 | if (slideTimer->isActive()) { |
551 | slideTimer->start(slideDelay * 1000, FALSE); | 551 | slideTimer->start(slideDelay * 1000, FALSE); |
552 | } | 552 | } |
553 | 553 | ||
554 | } | 554 | } |
555 | 555 | ||
556 | void ImageViewer::open() | 556 | void ImageViewer::open() |
557 | { | 557 | { |
558 | switchToFileSelector(); | 558 | switchToFileSelector(); |
559 | } | 559 | } |
560 | 560 | ||
561 | void ImageViewer::closeFileSelector() | 561 | void ImageViewer::closeFileSelector() |
562 | { | 562 | { |
563 | switchToImageView(); | 563 | switchToImageView(); |
564 | } | 564 | } |
565 | 565 | ||
566 | void ImageViewer::updateCaption( QString name ) | 566 | void ImageViewer::updateCaption( QString name ) |
567 | { | 567 | { |
568 | int sep = name.findRev( '/' ); | 568 | int sep = name.findRev( '/' ); |
569 | if ( sep >= 0 ) | 569 | if ( sep >= 0 ) |
570 | name = name.mid( sep+1 ); | 570 | name = name.mid( sep+1 ); |
571 | setCaption( name + tr(" - Image Viewer") ); | 571 | setCaption( name + tr(" - Image Viewer") ); |
572 | } | 572 | } |
573 | 573 | ||
574 | /* | 574 | /* |
575 | This function loads an image from a file. | 575 | This function loads an image from a file. |
576 | */ | 576 | */ |
577 | 577 | ||
578 | void ImageViewer::loadImage( const char *fileName ) | 578 | void ImageViewer::loadImage( const char *fileName ) |
579 | { | 579 | { |
580 | filename = fileName; | 580 | filename = fileName; |
581 | if ( filename ) { | 581 | if ( filename ) { |
582 | QApplication::setOverrideCursor( waitCursor ); // this might take time | 582 | QApplication::setOverrideCursor( waitCursor ); // this might take time |
583 | //imagePanel->statusLabel()->setText( tr("Loading image...") ); | 583 | //imagePanel->statusLabel()->setText( tr("Loading image...") ); |
584 | qApp->processEvents(); | 584 | qApp->processEvents(); |
585 | bool ok = image.load(filename, 0); | 585 | bool ok = image.load(filename, 0); |
586 | if ( ok ) { | 586 | if ( ok ) { |