VPTissue Reference Manual
SaveChangesDialog.h
Go to the documentation of this file.
1 #ifndef SAVECHANGESDIALOG_H_INCLUDED
2 #define SAVECHANGESDIALOG_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include <map>
23 #include <vector>
24 #include <boost/property_tree/ptree.hpp>
25 #include <QDialog>
26 
27 class QAbstractButton;
28 class QCheckBox;
29 class QPushButton;
30 class QTreeView;
31 class QVBoxLayout;
32 
33 namespace SimShell {
34 namespace Gui {
35 
36 class CheckableTreeModel;
37 class HasUnsavedChanges;
38 
45 class SaveChangesDialog : public QDialog
46 {
47  Q_OBJECT
48 public:
55  static bool Prompt(HasUnsavedChanges* widget, QWidget* parent = nullptr);
56 
57 private slots:
58  void SLOT_Clicked(QAbstractButton*);
59 
60 private:
61  SaveChangesDialog(const boost::property_tree::ptree&, QWidget* parent = 0);
62 
64  enum Result
65  {
66  Save, Cancel, Discard
67  };
68 
69  QPushButton* m_save_button;
70  QPushButton* m_cancel_button;
71  QPushButton* m_discard_button;
72  CheckableTreeModel* m_model;
73 };
74 
75 } // namespace
76 } // namespace
77 
78 #endif // end_of_inclde_guard
Dialog window that displays a tree of objects containing unsaved changes.
Abstract class that represents the ability be in closed or opened state, and, if the latter...
see the online Qt documentation
see the online Qt documentation
static bool Prompt(HasUnsavedChanges *widget, QWidget *parent=nullptr)
Create and display a dialog from a HasUnsavedChanges interface.
Namespace for generic graphical shell for simulators.
Definition: SimSession.h:32
see the online Qt documentation
A hierarchical tree-like model of checkable items.