summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/showimg/main.cpp10
-rw-r--r--noncore/multimedia/showimg/showimg.cpp90
-rw-r--r--noncore/multimedia/showimg/showimg.h1
-rw-r--r--noncore/multimedia/showimg/showimg.pro4
4 files changed, 50 insertions, 55 deletions
diff --git a/noncore/multimedia/showimg/main.cpp b/noncore/multimedia/showimg/main.cpp
index c28cc85..efb1c68 100644
--- a/noncore/multimedia/showimg/main.cpp
+++ b/noncore/multimedia/showimg/main.cpp
@@ -24,10 +24,4 @@
-int main( int argc, char **argv )
-{
- QPEApplication a( argc, argv );
-
- ImageViewer w(0, "new window", Qt::WResizeNoErase );
- a.showMainDocumentWidget(&w);
+#include <opie/oapplicationfactory.h>
- return a.exec();
-}
+OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> ) \ No newline at end of file
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp
index d6f0733..56bdecf 100644
--- a/noncore/multimedia/showimg/showimg.cpp
+++ b/noncore/multimedia/showimg/showimg.cpp
@@ -28,3 +28,3 @@
-
+
#include <opie/ofiledialog.h>
@@ -77,7 +77,7 @@ ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightne
pixmap->setMinimumSize(pm.width(),pm.height());
- gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter);
+ gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter);
QLabel *l=new QLabel(tr("Brightness")+":",this);
- gl->addWidget(l,1,0,AlignLeft);
- spb=new QSpinBox(-100,100,2,this);
- gl->addWidget(spb,1,1,AlignRight);
+ gl->addWidget(l,1,0,AlignLeft);
+ spb=new QSpinBox(-100,100,2,this);
+ gl->addWidget(spb,1,1,AlignRight);
@@ -104,3 +104,3 @@ void ControlsDialog::accept()
{
- *b=spb->value();
+ *b=spb->value();
done(1);
@@ -120,3 +120,5 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
- const char *labels[]={"File Name","Format","File Size","Size","Colors","Alpha"};
+
+
+ QString labels[]={ tr("File Name"),tr("Format"),tr("File Size"),tr("Size"),tr("Colors"),tr("Alpha") };
@@ -135,3 +137,3 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
frm->setFrameStyle(QFrame::HLine|QFrame::Sunken);
- gl->addMultiCellWidget(frm,i,i,0,1);
+ gl->addMultiCellWidget(frm,i,i,0,1);
}
@@ -139,4 +141,4 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
{
- l=new QLabel(tr(labels[count])+":",this);
- gl->addWidget(l,i,0,AlignLeft);
+ l=new QLabel( tr( labels[count] )+":",this);
+ gl->addWidget(l,i,0,AlignLeft);
l=new QLabel(text[count],this);
@@ -146,3 +148,3 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
- }
+ }
@@ -155,3 +157,3 @@ void InfoDialog::displayInfo(const QString &caption, const QStringList text, QWi
delete dlg;
-}
+}
@@ -212,3 +214,3 @@ void ImageWidget::mouseReleaseEvent(QMouseEvent *)
ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
-: QMainWindow( parent, name, wFlags ), filename( 0 ), bFromDocView( FALSE )
+: QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE )
{
@@ -243,7 +245,7 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
viewMenuFile = new QPopupMenu( this );
- //menubarFile->insertItem( tr("View"), viewMenu );
+ //menubarFile->insertItem( tr("View"), viewMenu );
viewMenuFile->insertItem( tr("Thumbnail View"),
this, SLOT(switchThumbView()), 0, SHOW_THUMBNAILS );
-
- viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView );
+
+ viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView );
@@ -271,10 +273,10 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
fileMenuView = new QPopupMenu( this );
- //menubarView->insertItem( tr("File"),fileMenu );
+ //menubarView->insertItem( tr("File"),fileMenu );
fileMenuView->insertItem( tr("Image Info ..."),this, SLOT(displayInfoDialog()),0 );
- fileMenuView->insertSeparator();
+ fileMenuView->insertSeparator();
viewMenuView = new QPopupMenu(this );
- viewMenuView->setCheckable ( true );
+ viewMenuView->setCheckable ( true );
- //menubarView->insertItem( tr("View"),viewMenu );
+ //menubarView->insertItem( tr("View"),viewMenu );
viewMenuView->insertItem(tr("Horizontal flip"), this, SLOT(hFlip()), 0);
@@ -287,3 +289,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
- imagePanel = new ImagePane( stack );
+ imagePanel = new ImagePane( stack );
connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView()));
@@ -299,6 +301,6 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
- fileSelector = new ImageFileSelector( cv,stack, "fs");
-
+ fileSelector = new ImageFileSelector( cv,stack, "fs");
+
//switchThumbView();
-
+
@@ -321,3 +323,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
a->addTo( fileMenuView);
- a->addTo( iconToolBar );
+ a->addTo( iconToolBar );
@@ -353,3 +355,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
- sss->setOn(isSized);
+ sss->setOn(isSized);
viewMenuView->insertSeparator();
@@ -384,5 +386,5 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
- setMouseTracking( TRUE );
+ setMouseTracking( TRUE );
+
-
}
@@ -393,3 +395,3 @@ ImageViewer::~ImageViewer()
cfg.setGroup("Image Viewer");
-
+
cfg.writeEntry("ShowThumbnails",(int)showThumbView);
@@ -465,3 +467,3 @@ void ImageViewer::switchThumbView()
fileSelector->switchView();
-
+
}
@@ -499,3 +501,3 @@ void ImageViewer::setDocument(const QString& fileref)
delayLoad = fileref;
- switchToImageView();
+ switchToImageView();
QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) );
@@ -534,3 +536,3 @@ void ImageViewer::openFile() {
types.insert("Images", image);
-
+
QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 );
@@ -552,3 +554,3 @@ void ImageViewer::openFile( const DocLnk &link )
}
-
+
}
@@ -562,3 +564,3 @@ void ImageViewer::closeFileSelector()
{
- switchToImageView();
+ switchToImageView();
}
@@ -584,3 +586,3 @@ void ImageViewer::loadImage( const char *fileName )
qApp->processEvents();
- bool ok = image.load(filename, 0);
+ bool ok = image.load(filename, 0);
if ( ok ) {
@@ -599,3 +601,3 @@ void ImageViewer::loadImage( const char *fileName )
-
+
// matrix.reset();
@@ -605,6 +607,6 @@ void ImageViewer::loadImage( const char *fileName )
rotated90 = TRUE;
- rot90();
+ rot90();
// matrix.rotate( -90.0 );
}
-
+
switchToImageView();
@@ -627,6 +629,6 @@ bool ImageViewer::loadSelected()
qApp->processEvents();
- ok = image.load(filename, 0);
+ ok = image.load(filename, 0);
if ( ok )
{
- updateImageInfo(filename);
+ updateImageInfo(filename);
ok = reconvertImage();
@@ -729,3 +731,3 @@ void ImageViewer::hFlip()
// matrix.scale( -1.0, 1.0 );
-
+
setImage(image.mirror(TRUE,FALSE));
@@ -809,3 +811,3 @@ void ImageViewer::normalView()
stack->addWidget( imagePanel, 1 );
- switchToImageView();
+ switchToImageView();
if ( isSized )
@@ -844,3 +846,3 @@ void ImageViewer::setImage(const QImage& newimage)
reconvertImage();
- updateImage();
+ updateImage();
}
@@ -857,3 +859,3 @@ void ImageViewer::updateImageInfo(QString &filePath)
QFileInfo fi(filePath);
- imageInfo[PATH]=fi.fileName();
+ imageInfo[PATH]=fi.fileName();
imageInfo[FILE_SIZE]=QString::number(fi.size())+" (bytes)";
diff --git a/noncore/multimedia/showimg/showimg.h b/noncore/multimedia/showimg/showimg.h
index 8555ff0..abbd976 100644
--- a/noncore/multimedia/showimg/showimg.h
+++ b/noncore/multimedia/showimg/showimg.h
@@ -160,2 +160,3 @@ class ImageViewer : public QMainWindow
public:
+ static QString appName() { return QString::fromLatin1("showimg"); }
ImageViewer( QWidget *parent=0, const char *name=0, int wFlags=0 );
diff --git a/noncore/multimedia/showimg/showimg.pro b/noncore/multimedia/showimg/showimg.pro
index d369e62..e8d753b 100644
--- a/noncore/multimedia/showimg/showimg.pro
+++ b/noncore/multimedia/showimg/showimg.pro
@@ -1,4 +1,2 @@
-TEMPLATE = app
-CONFIG += qt warn_on release
-DESTDIR = $(OPIEDIR)/bin
+CONFIG += qt warn_on release quick-app
HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h