BasicEditorDisplay.h
Go to the documentation of this file.
1 #ifndef _DBUTILS_GUI_BASICEDITORDISPLAY_H
2 #define _DBUTILS_GUI_BASICEDITORDISPLAY_H
3 
4 #include <DatabaseUtils/GUI/CustomTabWidget.h>
5 #include <DatabaseUtils/GUI/SettingsDisplay.h>
6 #include <DatabaseUtils/DAQConfig/GlobalNameSpec.h>
7 #include <NovaDAQUtilities/Status.h>
8 #include <QtGui/QAction>
9 #include <QtGui/QMainWindow>
10 #include <QtGui/QCloseEvent>
11 #include <boost/shared_ptr.hpp>
12 #include <vector>
13 
14 namespace dbutils {
15 namespace gui {
16 
17 /**
18  * Class for providing the core functionality for graphical
19  * configuration editors.
20  *
21  * @author Kurt Biery
22  * @version $Revision: 1.8.24.1 $ $Date: 2019/09/27 00:07:04 $
23  */
24 
25 class BasicEditorDisplay : public QMainWindow
26 {
27  Q_OBJECT
28 
29  public:
30 
31  BasicEditorDisplay(QWidget *parent = 0);
32  virtual ~BasicEditorDisplay() {}
33 
34  virtual bool hasChanges() const = 0;
35 
36  public slots:
37 
38  void reloadCurrentDataset();
39  void loadNewDataset();
40  void saveChanges();
42  void showHelpDialog();
43 
44  virtual void reactToDataChange();
45  virtual void reactToDataSave();
46 
47  protected:
48 
50  idSpec) = 0;
52  idSpec) = 0;
53  virtual bool _doSaveChanges(const dbutils::daqconfig::IDSpec& oldIdSpec,
54  const dbutils::daqconfig::IDSpec& newIdSpec,
56  newNameSpec) = 0;
57  virtual void closeEvent(QCloseEvent* event);
58 
59  bool _confirmSave();
61 
62  QAction* _saveAction;
63  QAction* _saveAsAction;
65  boost::shared_ptr<dbutils::daqconfig::GlobalNameSpec> _globalNameSpecPtr;
67 
68  void _addHelpMenu(std::string customText = "");
69 
70  private:
71 
73 
74 };
75 
76 } // end of namespace gui
77 } // end of namespace dbutils
78 
79 #endif
virtual bool _doReloadCurrentDataset(const dbutils::daqconfig::IDSpec &idSpec)=0
bool _getUserResponseToGlobalCopyFailure(const novadaq::Status &status)
int status
Definition: fabricate.py:1613
virtual void closeEvent(QCloseEvent *event)
void _addHelpMenu(std::string customText="")
virtual bool _doSaveChanges(const dbutils::daqconfig::IDSpec &oldIdSpec, const dbutils::daqconfig::IDSpec &newIdSpec, const dbutils::daqconfig::GlobalNameSpec &newNameSpec)=0
boost::shared_ptr< dbutils::daqconfig::GlobalNameSpec > _globalNameSpecPtr
virtual bool _doLoadNewDataset(const dbutils::daqconfig::IDSpec &idSpec)=0
virtual bool hasChanges() const =0
enum BeamMode string