From 40019df6920e0953c5c2e485722ba15dd884b21a Mon Sep 17 00:00:00 2001 From: Brandon King Date: Thu, 2 Mar 2006 02:23:48 +0000 Subject: [PATCH] Added SaveImageDialog to mussagl --- qui/PathWindow.cxx | 21 +++++++++++++++++++++ qui/PathWindow.h | 7 ++++++- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/qui/PathWindow.cxx b/qui/PathWindow.cxx index 92beaa6..bb6dbf4 100644 --- a/qui/PathWindow.cxx +++ b/qui/PathWindow.cxx @@ -13,6 +13,7 @@ #include "qui/PathScene.h" #include "qui/ThresholdWidget.h" +#include "qui/ImageSaveDialog.h" #include @@ -38,6 +39,10 @@ PathWindow::PathWindow(QWidget *) : connect(threshold, SIGNAL(thresholdChanged(int)), scene, SLOT(setClipPlane(int))); mussaViewTB->addWidget(threshold); + + //Image Save Dialog + imageSaveDialog = new ImageSaveDialog(scene, this); + addToolBar(mussaViewTB); statusBar()->showMessage("Welcome to mussa", 2000); @@ -103,6 +108,12 @@ void PathWindow::setupActions() whatsThisAction = QWhatsThis::createAction(this); whatsThisAction->setIcon(QIcon("icons/help.png")); + + //Save pixel map action + saveOpenGlPixmapAction = new QAction(tr("Save to image..."), this); + connect(saveOpenGlPixmapAction, (SIGNAL(triggered())), + this, SLOT(promptSaveOpenGlPixmap())); + saveOpenGlPixmapAction->setIcon(QIcon("icons/image2.png")); } void PathWindow::setupMainMenu() @@ -120,6 +131,8 @@ void PathWindow::setupMainMenu() newMenu->addAction(loadMotifListAction); newMenu->addAction(saveMotifListAction); newMenu->addSeparator(); + newMenu->addAction(saveOpenGlPixmapAction); + newMenu->addSeparator(); newMenu->addAction(closeAction); newMenu = menuBar()->addMenu(tr("&View")); @@ -195,4 +208,12 @@ void PathWindow::NotImplementedBox() QMessageBox::warning(this, QObject::tr("mussa"), QObject::tr("Not implemented yet")); } +void PathWindow::promptSaveOpenGlPixmap() +{ + QSize size; + size = scene->size(); + imageSaveDialog->setSize(size.width(), size.height()); + int result = imageSaveDialog->exec(); + std::cout << "Result: " << result << "\n"; +} diff --git a/qui/PathWindow.h b/qui/PathWindow.h index 1aefe0c..8f1c7da 100644 --- a/qui/PathWindow.h +++ b/qui/PathWindow.h @@ -2,9 +2,10 @@ #define _PATHWINDOW_H_ #include - +#include class QAction; class PathScene; +class ImageSaveDialog; class PathWindow : public QMainWindow { @@ -37,11 +38,14 @@ public slots: //\@} void showMussaToolbar(); + + void promptSaveOpenGlPixmap(); protected: // display our wonderful mussa output PathScene *scene; QToolBar *mussaViewTB; + ImageSaveDialog *imageSaveDialog; QAction *aboutAction; QAction *closeAction; @@ -54,6 +58,7 @@ protected: QAction *showMussaViewToolbarAction; QAction *toggleMotifsAction; QAction *whatsThisAction; + QAction *saveOpenGlPixmapAction; //! initialze the actions void setupActions(); -- 2.30.2