summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/showimg/showimg.cpp2
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 )