[Kstars-devel] branches/KDE/4.1/kdeedu/kstars/kstars

Jason Harris kstars at 30doradus.org
Thu Jul 10 18:04:00 CEST 2008


SVN commit 830493 by harris:

Porting fix for bug #166002 (make it possible to save images to disk in the Image 
Viewer).  I guess I was wrong about it being too late for 4.1 :)


CCBUG: 166002
CCMAIL: kstars-devel at kde.org



 M  +9 -4      imageviewer.cpp  
 M  +2 -6      imageviewer.h  


--- branches/KDE/4.1/kdeedu/kstars/kstars/imageviewer.cpp #830492:830493
@@ -19,14 +19,16 @@
 #include "kstars.h"
 
 #include <QFont>
+#include <QPainter>
 #include <QResizeEvent>
 #include <QKeyEvent>
-#include <QPainter>
 #include <QPaintEvent>
 #include <QCloseEvent>
 #include <QDesktopWidget>
 #include <QVBoxLayout>
 #include <QApplication>
+#include <QLabel>
+#include <QVBoxLayout>
 
 #include <klocale.h>
 #include <kmessagebox.h>
@@ -70,8 +72,10 @@
     KGuiItem saveButton( i18n("Save"), "document-save", i18n("Save the image to disk") );
     setButtonGuiItem( KDialog::User1, saveButton );
 
-    View = new ImageLabel( this );
-    Caption = new QLabel( this );
+    Page = new QFrame( this );
+    setMainWidget( Page );
+    View = new ImageLabel( Page );
+    Caption = new QLabel( Page );
     View->setAutoFillBackground( true );
     Caption->setAutoFillBackground( true );
     Caption->setFrameShape( QFrame::StyledPanel );
@@ -88,7 +92,7 @@
     capFont.setPointSize( capFont.pointSize() - 2 );
     Caption->setFont( capFont );
 
-    vlay = new QVBoxLayout( this );
+    vlay = new QVBoxLayout( Page );
     vlay->setSpacing( 0 );
     vlay->setMargin( 0 );
     vlay->addWidget( View );
@@ -115,6 +119,7 @@
 
     delete View;
     delete Caption;
+    delete Page;
     if ( downloadJob ) delete downloadJob;
 }
 
--- branches/KDE/4.1/kdeedu/kstars/kstars/imageviewer.h #830492:830493
@@ -18,15 +18,10 @@
 #ifndef IMAGEVIEWER_H_
 #define IMAGEVIEWER_H_
 
+#include <QFrame>
 #include <QFile>
-#include <QLabel>
-#include <QVBoxLayout>
 #include <QImage>
 #include <QPixmap>
-#include <QResizeEvent>
-#include <QKeyEvent>
-#include <QPaintEvent>
-#include <QCloseEvent>
 
 #include <kio/job.h>
 #include <kdialog.h>
@@ -112,6 +107,7 @@
 
     KIO::Job *downloadJob;  // download job of image -> 0 == no job is running
 
+    QFrame *Page;
     ImageLabel *View;
     QLabel *Caption;
     QVBoxLayout *vlay;


More information about the Kstars-devel mailing list