author | llornkcor <llornkcor> | 2002-11-03 18:14:36 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-03 18:14:36 (UTC) |
commit | 7d282e8e721d4c7c71a6d308d082da7138139484 (patch) (side-by-side diff) | |
tree | cd37bc23214230258054562657a1d5eff49232b7 | |
parent | 8b3893f3b11731151c19274d2c9ed22d7a00a2b3 (diff) | |
download | opie-7d282e8e721d4c7c71a6d308d082da7138139484.zip opie-7d282e8e721d4c7c71a6d308d082da7138139484.tar.gz opie-7d282e8e721d4c7c71a6d308d082da7138139484.tar.bz2 |
fix ofileselector open
-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 @@ -442,193 +442,193 @@ void ImageViewer::settings() } void ImageViewer::switchSizeToScreen() { isSized=!isSized; sss->setOn(isSized); updateImage(); } void ImageViewer::updateImage() { if ( isSized ) { imagePanel->setPixmap(pmScaled); } else { imagePanel->setPixmap(pm); } } void ImageViewer::switchThumbView() { showThumbView=!showThumbView; viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView ); fileSelector->switchView(); } void ImageViewer::switchToFileSelector() { stack->raiseWidget(fileSelector); menuBar->clear(); menuBar->insertItem( tr("File"), fileMenuFile ); menuBar->insertItem( tr("View"), viewMenuFile ); menuBar->insertItem( tr("Options"), optionsMenuFile ); iconToolBar->hide(); imagePanel->disable(); slideShow(false); } void ImageViewer::switchToImageView() { stack->raiseWidget(imagePanel); menuBar->clear(); menuBar->insertItem( tr("File"), fileMenuView ); menuBar->insertItem( tr("View"), viewMenuView ); viewMenuView->setItemEnabled(BLACKANDWHITE,true); iconToolBar->show(); imagePanel->setPosition(0,0); } void ImageViewer::setDocument(const QString& fileref) { delayLoad = fileref; switchToImageView(); QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) ); } void ImageViewer::doDelayedLoad() { show(delayLoad); } void ImageViewer::show() { normalView(); QMainWindow::show(); } void ImageViewer::show(const QString& fileref) { // qDebug("Show "+fileref); bFromDocView = TRUE; closeFileSelector(); DocLnk link(fileref); if ( link.isValid() ) { openFile(link); } else { filename = fileref; updateCaption( fileref ); loadImage( fileref ); } } void ImageViewer::openFile() { MimeTypes types; QStringList image; image << "image/*"; types.insert("Images", image); QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); DocLnk link(str); - if ( link.isValid() ) +// if ( link.isValid() ) openFile(link); } void ImageViewer::openFile( const DocLnk &link ) { closeFileSelector(); // DocLnk link(file); qDebug("open "+link.name()); updateCaption( link.name() ); loadImage( link.file() ); if (slideTimer->isActive()) { slideTimer->start(slideDelay * 1000, FALSE); } } void ImageViewer::open() { switchToFileSelector(); } void ImageViewer::closeFileSelector() { switchToImageView(); } void ImageViewer::updateCaption( QString name ) { int sep = name.findRev( '/' ); if ( sep >= 0 ) name = name.mid( sep+1 ); setCaption( name + tr(" - Image Viewer") ); } /* This function loads an image from a file. */ void ImageViewer::loadImage( const char *fileName ) { filename = fileName; if ( filename ) { QApplication::setOverrideCursor( waitCursor ); // this might take time //imagePanel->statusLabel()->setText( tr("Loading image...") ); qApp->processEvents(); bool ok = image.load(filename, 0); if ( ok ) { ok = reconvertImage(); updateImageInfo(filename); } if ( !ok ) { pm.resize(0,0); // couldn't load image update(); } QApplication::restoreOverrideCursor(); // restore original cursor } // fastLoad ? ", Fast" : "", // fastLoad ? QMAX(imagewidth/maxsize, imageheight/maxsize) : 1); // matrix.reset(); rotated90 = FALSE; if (rotateOnLoad) { rotated90 = TRUE; rot90(); // matrix.rotate( -90.0 ); } switchToImageView(); updateImage(); } bool ImageViewer::loadSelected() { bool ok = false; if ( stack->visibleWidget() == fileSelector ) { const DocLnk *link = fileSelector->selected(); if ( link ) { if ( link->file() != filename ) { updateCaption( link->name() ); filename = link->file(); qApp->processEvents(); ok = image.load(filename, 0); if ( ok ) { updateImageInfo(filename); ok = reconvertImage(); } if ( !ok ) |