author | drw <drw> | 2004-03-02 15:45:42 (UTC) |
---|---|---|
committer | drw <drw> | 2004-03-02 15:45:42 (UTC) |
commit | 270a76fbf653df353476ddf17835d532ceb6b6c2 (patch) (unidiff) | |
tree | f967cf572a6f8f3742fb2612137d50594220dc32 /noncore/multimedia/showimg/showimg.cpp | |
parent | e31fe9d73c6cd9be80bb18ca45ad3618192f718f (diff) | |
download | opie-270a76fbf653df353476ddf17835d532ceb6b6c2.zip opie-270a76fbf653df353476ddf17835d532ceb6b6c2.tar.gz opie-270a76fbf653df353476ddf17835d532ceb6b6c2.tar.bz2 |
ShowImg: libopie -> libopie2
Diffstat (limited to 'noncore/multimedia/showimg/showimg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/showimg/showimg.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/noncore/multimedia/showimg/showimg.cpp b/noncore/multimedia/showimg/showimg.cpp index 82eac33..6c0c4db 100644 --- a/noncore/multimedia/showimg/showimg.cpp +++ b/noncore/multimedia/showimg/showimg.cpp | |||
@@ -18,36 +18,37 @@ | |||
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 <opie/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 <math.h> | ||
36 | #include <qmenubar.h> | ||
37 | #include <qpe/qpetoolbar.h> | 35 | #include <qpe/qpetoolbar.h> |
36 | |||
38 | #include <qaction.h> | 37 | #include <qaction.h> |
39 | #include <qfiledialog.h> | 38 | #include <qfiledialog.h> |
39 | #include <qmenubar.h> | ||
40 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
41 | 41 | ||
42 | #include <math.h> | ||
42 | 43 | ||
43 | 44 | ||
44 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) | 45 | ControlsDialog::ControlsDialog(const QString &caption,QImage image,int *brightness,QWidget *parent) |
45 | : QDialog(parent,0,true) | 46 | : QDialog(parent,0,true) |
46 | { | 47 | { |
47 | setCaption(caption); | 48 | setCaption(caption); |
48 | 49 | ||
49 | if ( parent ) { | 50 | if ( parent ) { |
50 | setPalette(parent->palette()); | 51 | setPalette(parent->palette()); |
51 | } | 52 | } |
52 | 53 | ||
53 | b=brightness; | 54 | b=brightness; |
@@ -189,25 +190,25 @@ void ImageWidget::paintEvent( QPaintEvent *e ) | |||
189 | { // is an image loaded? | 190 | { // is an image loaded? |
190 | painter.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); | 191 | painter.drawPixmap((width() - pixmap.width()) / 2, (height() - pixmap.height()) / 2, pixmap); |
191 | } | 192 | } |
192 | } | 193 | } |
193 | 194 | ||
194 | void ImageWidget::mouseReleaseEvent(QMouseEvent *) | 195 | void ImageWidget::mouseReleaseEvent(QMouseEvent *) |
195 | { | 196 | { |
196 | emit clicked(); | 197 | emit clicked(); |
197 | } | 198 | } |
198 | 199 | ||
199 | //=========================================================================== | 200 | //=========================================================================== |
200 | 201 | ||
201 | ImageViewer::ImageViewer( QWidget *parent, const char *name, int wFlags ) | 202 | ImageViewer::ImageViewer( QWidget *parent, const char *name, int /*wFlags*/ ) |
202 | : QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE ) | 203 | : QMainWindow( parent, name, WResizeNoErase ), filename( 0 ), bFromDocView( FALSE ) |
203 | { | 204 | { |
204 | setCaption( tr("Image Viewer") ); | 205 | setCaption( tr("Image Viewer") ); |
205 | setIcon( Resource::loadPixmap( "ImageViewer" ) ); | 206 | setIcon( Resource::loadPixmap( "ImageViewer" ) ); |
206 | 207 | ||
207 | 208 | ||
208 | Config cfg("Image Viewer"); | 209 | Config cfg("Image Viewer"); |
209 | cfg.setGroup("Image Viewer"); | 210 | cfg.setGroup("Image Viewer"); |
210 | 211 | ||
211 | showThumbView=cfg.readBoolEntry("ShowThumbnails",false); | 212 | showThumbView=cfg.readBoolEntry("ShowThumbnails",false); |
212 | isSized=cfg.readBoolEntry("SizeToScreen",true); | 213 | isSized=cfg.readBoolEntry("SizeToScreen",true); |
213 | 214 | ||
@@ -513,25 +514,25 @@ void ImageViewer::show(const QString& fileref) | |||
513 | filename = fileref; | 514 | filename = fileref; |
514 | updateCaption( fileref ); | 515 | updateCaption( fileref ); |
515 | loadImage( fileref ); | 516 | loadImage( fileref ); |
516 | } | 517 | } |
517 | } | 518 | } |
518 | 519 | ||
519 | void ImageViewer::openFile() { | 520 | void ImageViewer::openFile() { |
520 | MimeTypes types; | 521 | MimeTypes types; |
521 | QStringList image; | 522 | QStringList image; |
522 | image << "image/*"; | 523 | image << "image/*"; |
523 | types.insert("Images", image); | 524 | types.insert("Images", image); |
524 | 525 | ||
525 | QString str = OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); | 526 | QString str = Opie::OFileDialog::getOpenFileName( 1,QPEApplication::documentDir(),"", types, 0 ); |
526 | DocLnk link(str); | 527 | DocLnk link(str); |
527 | // if ( link.isValid() ) | 528 | // if ( link.isValid() ) |
528 | openFile(link); | 529 | openFile(link); |
529 | 530 | ||
530 | } | 531 | } |
531 | 532 | ||
532 | void ImageViewer::openFile( const DocLnk &link ) | 533 | void ImageViewer::openFile( const DocLnk &link ) |
533 | { | 534 | { |
534 | closeFileSelector(); | 535 | closeFileSelector(); |
535 | // DocLnk link(file); | 536 | // DocLnk link(file); |
536 | qDebug("open "+link.name()); | 537 | qDebug("open "+link.name()); |
537 | updateCaption( link.name() ); | 538 | updateCaption( link.name() ); |