summaryrefslogtreecommitdiff
path: root/noncore/multimedia
authormickeyl <mickeyl>2003-10-27 20:26:56 (UTC)
committer mickeyl <mickeyl>2003-10-27 20:26:56 (UTC)
commit1fed961e25a6afd4070d8873b431aba8342406c3 (patch) (unidiff)
tree8ef9a1b3ad5cf50406ac500ccfb77cff60b77796 /noncore/multimedia
parent651d29249946e7221fc85580453750d9e4be4fb0 (diff)
downloadopie-1fed961e25a6afd4070d8873b431aba8342406c3.zip
opie-1fed961e25a6afd4070d8873b431aba8342406c3.tar.gz
opie-1fed961e25a6afd4070d8873b431aba8342406c3.tar.bz2
merge noncore/multimedia/showimg
- opieplayer2 and opierec generate lots of conflicts in merge I'll gladly leave that to the experts ljp and Harlekin ;)
Diffstat (limited to 'noncore/multimedia') (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 @@
24 24
25int main( int argc, char **argv ) 25#include <opie/oapplicationfactory.h>
26{
27 QPEApplication a( argc, argv );
28
29 ImageViewer w(0, "new window", Qt::WResizeNoErase );
30 a.showMainDocumentWidget(&w);
31 26
32 return a.exec(); 27OPIE_EXPORT_APP( OApplicationFactory<ImageViewer> ) \ No newline at end of file
33}
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 @@
28 28
29 29
30#include <opie/ofiledialog.h> 30#include <opie/ofiledialog.h>
@@ -77,7 +77,7 @@ ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightne
77 pixmap->setMinimumSize(pm.width(),pm.height()); 77 pixmap->setMinimumSize(pm.width(),pm.height());
78 gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter); 78 gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter);
79 QLabel *l=new QLabel(tr("Brightness")+":",this); 79 QLabel *l=new QLabel(tr("Brightness")+":",this);
80 gl->addWidget(l,1,0,AlignLeft); 80 gl->addWidget(l,1,0,AlignLeft);
81 spb=new QSpinBox(-100,100,2,this); 81 spb=new QSpinBox(-100,100,2,this);
82 gl->addWidget(spb,1,1,AlignRight); 82 gl->addWidget(spb,1,1,AlignRight);
83 83
@@ -104,3 +104,3 @@ void ControlsDialog::accept()
104{ 104{
105 *b=spb->value(); 105 *b=spb->value();
106 done(1); 106 done(1);
@@ -120,3 +120,5 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
120 120
121 const char *labels[]={"File Name","Format","File Size","Size","Colors","Alpha"}; 121
122
123 QString labels[]={ tr("File Name"),tr("Format"),tr("File Size"),tr("Size"),tr("Colors"),tr("Alpha") };
122 124
@@ -135,3 +137,3 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
135 frm->setFrameStyle(QFrame::HLine|QFrame::Sunken); 137 frm->setFrameStyle(QFrame::HLine|QFrame::Sunken);
136 gl->addMultiCellWidget(frm,i,i,0,1); 138 gl->addMultiCellWidget(frm,i,i,0,1);
137 } 139 }
@@ -139,4 +141,4 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
139 { 141 {
140 l=new QLabel(tr(labels[count])+":",this); 142 l=new QLabel( tr( labels[count] )+":",this);
141 gl->addWidget(l,i,0,AlignLeft); 143 gl->addWidget(l,i,0,AlignLeft);
142 l=new QLabel(text[count],this); 144 l=new QLabel(text[count],this);
@@ -146,3 +148,3 @@ InfoDialog::InfoDialog(const QString &caption, const QStringList text,QWidget *p
146 148
147 } 149 }
148 150
@@ -155,3 +157,3 @@ void InfoDialog::displayInfo(const QString &caption, const QStringList text, QWi
155 delete dlg; 157 delete dlg;
156} 158}
157 159
@@ -212,3 +214,3 @@ void ImageWidget::mouseReleaseEvent(QMouseEvent *)
212ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags ) 214ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
213: QMainWindow( parent, name, wFlags ), filename( 0 ), bFromDocView( FALSE ) 215: QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE )
214{ 216{
@@ -243,7 +245,7 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
243 viewMenuFile = new QPopupMenu( this ); 245 viewMenuFile = new QPopupMenu( this );
244 //menubarFile->insertItem( tr("View"), viewMenu ); 246 //menubarFile->insertItem( tr("View"), viewMenu );
245 viewMenuFile->insertItem( tr("Thumbnail View"), 247 viewMenuFile->insertItem( tr("Thumbnail View"),
246 this, SLOT(switchThumbView()), 0, SHOW_THUMBNAILS ); 248 this, SLOT(switchThumbView()), 0, SHOW_THUMBNAILS );
247 249
248 viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView ); 250 viewMenuFile->setItemChecked ( SHOW_THUMBNAILS, showThumbView );
249 251
@@ -271,10 +273,10 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
271 fileMenuView = new QPopupMenu( this ); 273 fileMenuView = new QPopupMenu( this );
272 //menubarView->insertItem( tr("File"),fileMenu ); 274 //menubarView->insertItem( tr("File"),fileMenu );
273 fileMenuView->insertItem( tr("Image Info ..."),this, SLOT(displayInfoDialog()),0 ); 275 fileMenuView->insertItem( tr("Image Info ..."),this, SLOT(displayInfoDialog()),0 );
274 fileMenuView->insertSeparator(); 276 fileMenuView->insertSeparator();
275 277
276 viewMenuView = new QPopupMenu(this ); 278 viewMenuView = new QPopupMenu(this );
277 viewMenuView->setCheckable ( true ); 279 viewMenuView->setCheckable ( true );
278 280
279 //menubarView->insertItem( tr("View"),viewMenu ); 281 //menubarView->insertItem( tr("View"),viewMenu );
280 viewMenuView->insertItem(tr("Horizontal flip"), this, SLOT(hFlip()), 0); 282 viewMenuView->insertItem(tr("Horizontal flip"), this, SLOT(hFlip()), 0);
@@ -287,3 +289,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
287 289
288 imagePanel = new ImagePane( stack ); 290 imagePanel = new ImagePane( stack );
289 connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView())); 291 connect(imagePanel, SIGNAL(clicked()), this, SLOT(normalView()));
@@ -299,6 +301,6 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
299 301
300 fileSelector = new ImageFileSelector( cv,stack, "fs"); 302 fileSelector = new ImageFileSelector( cv,stack, "fs");
301 303
302 //switchThumbView(); 304 //switchThumbView();
303 305
304 306
@@ -321,3 +323,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
321 a->addTo( fileMenuView); 323 a->addTo( fileMenuView);
322 a->addTo( iconToolBar ); 324 a->addTo( iconToolBar );
323 325
@@ -353,3 +355,3 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
353 355
354 sss->setOn(isSized); 356 sss->setOn(isSized);
355 viewMenuView->insertSeparator(); 357 viewMenuView->insertSeparator();
@@ -384,5 +386,5 @@ ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags )
384 386
385 setMouseTracking( TRUE ); 387 setMouseTracking( TRUE );
388
386 389
387
388} 390}
@@ -393,3 +395,3 @@ ImageViewer::~ImageViewer()
393 cfg.setGroup("Image Viewer"); 395 cfg.setGroup("Image Viewer");
394 396
395 cfg.writeEntry("ShowThumbnails",(int)showThumbView); 397 cfg.writeEntry("ShowThumbnails",(int)showThumbView);
@@ -465,3 +467,3 @@ void ImageViewer::switchThumbView()
465 fileSelector->switchView(); 467 fileSelector->switchView();
466 468
467} 469}
@@ -499,3 +501,3 @@ void ImageViewer::setDocument(const QString& fileref)
499 delayLoad = fileref; 501 delayLoad = fileref;
500 switchToImageView(); 502 switchToImageView();
501 QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) ); 503 QTimer::singleShot( 0, this, SLOT(doDelayedLoad()) );
@@ -534,3 +536,3 @@ void ImageViewer::openFile() {
534 types.insert("Images", image); 536 types.insert("Images", image);
535 537
536 QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); 538 QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 );
@@ -552,3 +554,3 @@ void ImageViewer::openFile( const DocLnk &link )
552 } 554 }
553 555
554} 556}
@@ -562,3 +564,3 @@ void ImageViewer::closeFileSelector()
562{ 564{
563 switchToImageView(); 565 switchToImageView();
564} 566}
@@ -584,3 +586,3 @@ void ImageViewer::loadImage( const char *fileName )
584 qApp->processEvents(); 586 qApp->processEvents();
585 bool ok = image.load(filename, 0); 587 bool ok = image.load(filename, 0);
586 if ( ok ) { 588 if ( ok ) {
@@ -599,3 +601,3 @@ void ImageViewer::loadImage( const char *fileName )
599 601
600 602
601// matrix.reset(); 603// matrix.reset();
@@ -605,6 +607,6 @@ void ImageViewer::loadImage( const char *fileName )
605 rotated90 = TRUE; 607 rotated90 = TRUE;
606 rot90(); 608 rot90();
607// matrix.rotate( -90.0 ); 609// matrix.rotate( -90.0 );
608 } 610 }
609 611
610 switchToImageView(); 612 switchToImageView();
@@ -627,6 +629,6 @@ bool ImageViewer::loadSelected()
627 qApp->processEvents(); 629 qApp->processEvents();
628 ok = image.load(filename, 0); 630 ok = image.load(filename, 0);
629 if ( ok ) 631 if ( ok )
630 { 632 {
631 updateImageInfo(filename); 633 updateImageInfo(filename);
632 ok = reconvertImage(); 634 ok = reconvertImage();
@@ -729,3 +731,3 @@ void ImageViewer::hFlip()
729// matrix.scale( -1.0, 1.0 ); 731// matrix.scale( -1.0, 1.0 );
730 732
731 setImage(image.mirror(TRUE,FALSE)); 733 setImage(image.mirror(TRUE,FALSE));
@@ -809,3 +811,3 @@ void ImageViewer::normalView()
809 stack->addWidget( imagePanel, 1 ); 811 stack->addWidget( imagePanel, 1 );
810 switchToImageView(); 812 switchToImageView();
811 if ( isSized ) 813 if ( isSized )
@@ -844,3 +846,3 @@ void ImageViewer::setImage(const QImage& newimage)
844 reconvertImage(); 846 reconvertImage();
845 updateImage(); 847 updateImage();
846} 848}
@@ -857,3 +859,3 @@ void ImageViewer::updateImageInfo(QString &filePath)
857 QFileInfo fi(filePath); 859 QFileInfo fi(filePath);
858 imageInfo[PATH]=fi.fileName(); 860 imageInfo[PATH]=fi.fileName();
859 imageInfo[FILE_SIZE]=QString::number(fi.size())+" (bytes)"; 861 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
160public: 160public:
161 static QString appName() { return QString::fromLatin1("showimg"); }
161 ImageViewer( QWidget *parent=0, const char *name=0, int wFlags=0 ); 162 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 @@
1TEMPLATE = app 1CONFIG += qt warn_on release quick-app
2CONFIG += qt warn_on release
3DESTDIR = $(OPIEDIR)/bin
4HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h 2HEADERS = showimg.h ImageFileSelector.h settingsdialog.h settingsdialogbase.h