implement "typical" save and close conventions.
[mussa.git] / qui / MussaWindow.hpp
index fede80b8ee23dc72cf4a42e535a9e58d7b8ce121..ff23a5c96b756337e7dbc194a16dfc29bd257a86 100644 (file)
@@ -37,6 +37,11 @@ public:
 
   //! switch to a new analysis
   void setAnalysis(Mussa *new_analysis);
+
+  //! ask the user what to do if we're going to lose data
+  //! returns true if getting rid of this analysis is safe
+  bool isClearingAnalysisSafe();
+
 public slots:
   //! display an about box, contemplating the politics of the author list
   void about();
@@ -49,6 +54,8 @@ public slots:
   void createSubAnalysis();
   //! save an analysis
   void saveAnalysis();
+  //! save an analysis after prompting for new name
+  void saveAnalysisAs();
   //\@}
 
   //! \defgroup MotifHandling Handling of motif lists
@@ -104,6 +111,7 @@ protected:
   QAction *createNewAnalysisAction;
   QAction *createSubAnalysisAction;
   QAction *saveAnalysisAction;
+  QAction *saveAnalysisAsAction;
   QAction *editMotifsAction;
   QAction *loadMotifListAction;
   QAction *loadMupaAction;
@@ -121,6 +129,8 @@ protected:
 
   //! initialze the actions
   void setupActions();
+  //! handle close events (AKA prompt if we should save)
+  void closeEvent(QCloseEvent *event);
   //! initialize this windows menu object
   void setupMainMenu();
   //! initialize assistant client