summaryrefslogtreecommitdiff
path: root/noncore/multimedia/showimg/showimg.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/showimg/showimg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/showimg/showimg.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp
index 6c0c4db..696a57b 100644
--- a/noncore/multimedia/showimg/showimg.cpp
+++ b/noncore/multimedia/showimg/showimg.cpp
@@ -11,58 +11,59 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21// 21//
22// Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com> 22// Full-screen and rotation options contributed by Robert Wittams <robert@wittams.com>
23// 23//
24 24
25#include "showimg.h" 25#include "showimg.h"
26#include "ImageFileSelector.h" 26#include "ImageFileSelector.h"
27#include "settingsdialog.h" 27#include "settingsdialog.h"
28 28
29 29
30#include <opie2/ofiledialog.h> 30#include <opie2/ofiledialog.h>
31 31
32#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
33#include <qpe/config.h> 33#include <qpe/config.h>
34#include <qpe/resource.h> 34#include <qpe/resource.h>
35#include <qpe/qpetoolbar.h> 35#include <qtoolbar.h>
36 36
37#include <qaction.h> 37#include <qaction.h>
38#include <qfiledialog.h> 38#include <qfiledialog.h>
39#include <qmenubar.h> 39#include <qmenubar.h>
40#include <qspinbox.h> 40#include <qspinbox.h>
41 41
42#include <math.h> 42#include <math.h>
43 43
44 44
45using namespace Opie::Ui;
45ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) 46ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent)
46 : QDialog(parent,0,true) 47 : QDialog(parent,0,true)
47{ 48{
48 setCaption(caption); 49 setCaption(caption);
49 50
50 if ( parent ) { 51 if ( parent ) {
51 setPalette(parent->palette()); 52 setPalette(parent->palette());
52 } 53 }
53 54
54 b=brightness; 55 b=brightness;
55 img=image; 56 img=image;
56 57
57 setMinimumSize(140,80); 58 setMinimumSize(140,80);
58 59
59 QGridLayout *gl= new QGridLayout(this,2,2,4,4); 60 QGridLayout *gl= new QGridLayout(this,2,2,4,4);
60 61
61 pixmap =new ImageWidget(this);; 62 pixmap =new ImageWidget(this);;
62 QPixmap pm; 63 QPixmap pm;
63 pm.convertFromImage(img); 64 pm.convertFromImage(img);
64 pixmap->setPixmap(pm); 65 pixmap->setPixmap(pm);
65 pixmap->setMinimumSize(pm.width(),pm.height()); 66 pixmap->setMinimumSize(pm.width(),pm.height());
66 gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter); 67 gl->addMultiCellWidget(pixmap,0,0,0,2,AlignCenter);
67 QLabel *l=new QLabel(tr("Brightness")+":",this); 68 QLabel *l=new QLabel(tr("Brightness")+":",this);
68 gl->addWidget(l,1,0,AlignLeft); 69 gl->addWidget(l,1,0,AlignLeft);
@@ -502,49 +503,49 @@ void ImageViewer::show()
502 QMainWindow::show(); 503 QMainWindow::show();
503} 504}
504 505
505void ImageViewer::show(const QString& fileref) 506void ImageViewer::show(const QString& fileref)
506{ 507{
507// qDebug("Show "+fileref); 508// qDebug("Show "+fileref);
508 bFromDocView = TRUE; 509 bFromDocView = TRUE;
509 closeFileSelector(); 510 closeFileSelector();
510 DocLnk link(fileref); 511 DocLnk link(fileref);
511 if ( link.isValid() ) { 512 if ( link.isValid() ) {
512 openFile(link); 513 openFile(link);
513 } else { 514 } else {
514 filename = fileref; 515 filename = fileref;
515 updateCaption( fileref ); 516 updateCaption( fileref );
516 loadImage( fileref ); 517 loadImage( fileref );
517 } 518 }
518} 519}
519 520
520void ImageViewer::openFile() { 521void ImageViewer::openFile() {
521 MimeTypes types; 522 MimeTypes types;
522 QStringList image; 523 QStringList image;
523 image << "image/*"; 524 image << "image/*";
524 types.insert("Images", image); 525 types.insert("Images", image);
525 526
526 QString str = Opie::OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); 527 QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 );
527 DocLnk link(str); 528 DocLnk link(str);
528// if ( link.isValid() ) 529// if ( link.isValid() )
529 openFile(link); 530 openFile(link);
530 531
531} 532}
532 533
533void ImageViewer::openFile( const DocLnk &link ) 534void ImageViewer::openFile( const DocLnk &link )
534{ 535{
535 closeFileSelector(); 536 closeFileSelector();
536// DocLnk link(file); 537// DocLnk link(file);
537 qDebug("open "+link.name()); 538 qDebug("open "+link.name());
538 updateCaption( link.name() ); 539 updateCaption( link.name() );
539 loadImage( link.file() ); 540 loadImage( link.file() );
540 if (slideTimer->isActive()) { 541 if (slideTimer->isActive()) {
541 slideTimer->start(slideDelay * 1000, FALSE); 542 slideTimer->start(slideDelay * 1000, FALSE);
542 } 543 }
543 544
544} 545}
545 546
546void ImageViewer::open() 547void ImageViewer::open()
547{ 548{
548 switchToFileSelector(); 549 switchToFileSelector();
549} 550}
550 551