Bayeux  3.4.1
Core Foundation library for SuperNEMO
variant_registry_dialog.h
Go to the documentation of this file.
1 /* Author(s) : Francois Mauger <mauger@lpccaen.in2p3.fr>
3  * Creation date : 2014-10-06
4  * Last modified : 2014-10-06
5  *
6  * Copyright (C) 2014 Francois Mauger <mauger@lpccaen.in2p3.fr>
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3 of the License, or (at
11  * your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  * Description:
24  *
25  * A dialog box for configuration variant registry.
26  *
27  */
28 
29 #ifndef DATATOOLS_CONFIGURATION_UI_VARIANT_REGISTRY_DIALOG_H
30 #define DATATOOLS_CONFIGURATION_UI_VARIANT_REGISTRY_DIALOG_H
31 
32 // Third party:
33 // - Boost:
34 #include <boost/scoped_ptr.hpp>
35 // - Qt:
36 #include <QDialog>
37 #include <QObject>
38 
39 // Forward declaration:
40 class QWidget;
41 class QHBoxLayout;
42 class QVBoxLayout;
43 class QPushButton;
44 
45 namespace datatools {
46 
47  namespace configuration {
48 
49  class variant_registry;
50 
51  namespace ui {
52 
53  // Forward declaration:
54  class variant_registry_tree_model;
55  class variant_registry_viewer;
56 
58  class variant_registry_dialog : public QDialog
59  {
60  Q_OBJECT
61 
62  public:
63 
66  QWidget * parent_ = 0);
67 
70  QWidget * parent_ = 0);
71 
73  virtual ~variant_registry_dialog();
74 
76  bool has_restore_buffer() const;
77 
79  void reset_restore_buffer();
80 
81  public slots:
82 
84  void slot_cancel();
85 
87  void slot_update_bottom_buttons(bool read_only_);
88 
90  void slot_snapshot();
91 
93  void slot_restore();
94 
95  protected:
96 
98  void _construct();
99 
101  void _set_default();
102 
103  private:
104 
105  variant_registry * _registry_;
106  bool _owned_model_;
107  variant_registry_tree_model * _registry_tree_model_;
108 
109  // Widgets:
110  variant_registry_viewer * _viewer_;
111  QHBoxLayout * _bottom_buttons_bar_;
112  QPushButton * _restore_button_;
113  QPushButton * _snapshot_button_;
114  QPushButton * _load_button_;
115  QPushButton * _store_button_;
116  QPushButton * _cancel_button_;
117  QPushButton * _ok_button_;
118  QVBoxLayout * _main_layout_;
119 
120  // Restore buffer:
121  boost::scoped_ptr<std::string> _restore_buffer_;
122 
123  };
124 
125  } // end of namespace ui
126 
127  } // end of namespace configuration
128 
129 } // end of namespace datatools
130 
131 #endif // DATATOOLS_CONFIGURATION_UI_VARIANT_REGISTRY_DIALOG_H
132 
133 // Local Variables: --
134 // mode: c++ --
135 // c-file-style: "gnu" --
136 // tab-width: 2 --
137 // End: --
void reset_restore_buffer()
Reset the restore buffer is available.
Registry of configuration variant parameters and associated variants.
Definition: variant_registry.h:53
Qt tree model for configuration variant registry.
Definition: variant_registry_tree_model.h:158
void _construct()
Construct the GUI interface.
bool has_restore_buffer() const
Check if a restore buffer is available.
A widget to browse/edit a configuration variant registry.
Definition: variant_registry_viewer.h:71
void slot_cancel()
Slot for canceling the dialog interface.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
A widget to browse/edit a configuration variant registry.
Definition: variant_registry_dialog.h:58
void slot_update_bottom_buttons(bool read_only_)
Slot for updating the status of bottom buttons (load/reset)
variant_registry_dialog(variant_registry &registry_, QWidget *parent_=0)
Constructor.