pass default_dir around
[mussa.git] / qui / ImageSaveDialog.hpp
1 #ifndef _IMAGESAVEDIALOG_H_
2 #define _IMAGESAVEDIALOG_H_
3
4 #include <boost/shared_ptr.hpp>
5  
6 #include <QDialog>
7 #include <QDir>
8
9 class ImageScaler;
10 class QLabel;
11 class QPixmap;
12 class QPushButton;
13 class QGLWidget;
14
15 class ImageSaveDialog : public QDialog
16 {
17   Q_OBJECT
18
19 public:
20   ImageSaveDialog(boost::shared_ptr<QDir> default_dir_, QGLWidget *qlwidget = 0, QWidget *parent = 0);
21   QDir defaultDir() const;
22   
23 public slots:
24   void accept();
25   void reject();
26   void setSize(int width, int height);
27
28 private:
29   //! prompt user for file name and save image, if (endDialog) close dialog
30   /** if endDialog is true, we should close the dialog box,
31    *  otherwise, keep the dialog box. (In case the user canceled out
32    *  of save as.
33    */  
34   void savePixmap(bool &endDialog);
35   QSize getOpenGlPixmapSize();
36   QPixmap renderOpenGlPixmap();
37   
38   boost::shared_ptr<QDir> default_dir;
39   ImageScaler *imageScaler;
40   QPushButton *saveButton;
41   QPushButton *cancelButton;
42   QGLWidget *glwidget;  
43 };
44
45 #endif