Bayeux  3.4.1
Core Foundation library for SuperNEMO
variant_repository_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 repository.
26  *
27  */
28 
29 #ifndef DATATOOLS_CONFIGURATION_UI_VARIANT_REPOSITORY_DIALOG_H
30 #define DATATOOLS_CONFIGURATION_UI_VARIANT_REPOSITORY_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  // Forward declaration:
50  class variant_repository;
51 
52  namespace ui {
53 
54  // Forward declaration:
55  class variant_repository_viewer;
56 
58  class variant_repository_dialog : public QDialog
59  {
60  Q_OBJECT
61 
62  public:
63 
65  variant_repository_dialog(QWidget * parent_ = 0);
66 
69  QWidget * parent_ = 0);
70 
73 
75  bool has_repository() const;
76 
78  void set_repository(variant_repository & repository_);
79 
81  bool has_restore_buffer() const;
82 
84  void reset_restore_buffer();
85 
86  public slots:
87 
89  void slot_cancel();
90 
92  void slot_update_bottom_buttons(bool read_only_);
93 
95  void slot_snapshot();
96 
98  void slot_restore();
99 
100  protected:
101 
103  void _construct();
104 
106  void _set_default();
107 
108  private:
109 
110  variant_repository * _repository_;
111 
112  // Widgets:
113  variant_repository_viewer * _viewer_;
114  QHBoxLayout * _bottom_buttons_bar_;
115  QPushButton * _restore_button_;
116  QPushButton * _snapshot_button_;
117  QPushButton * _load_button_;
118  QPushButton * _store_button_;
119  QPushButton * _cancel_button_;
120  QPushButton * _ok_button_;
121  QVBoxLayout * _main_layout_;
122 
123  // Restore buffer;
124  boost::scoped_ptr<std::string> _restore_buffer_;
125 
126  };
127 
128  } // end of namespace ui
129 
130  } // end of namespace configuration
131 
132 } // end of namespace datatools
133 
134 #endif // DATATOOLS_CONFIGURATION_UI_VARIANT_REPOSITORY_DIALOG_H
135 
136 // Local Variables: --
137 // mode: c++ --
138 // c-file-style: "gnu" --
139 // tab-width: 2 --
140 // End: --
void set_repository(variant_repository &repository_)
Set repository.
bool has_restore_buffer() const
Check if a restore buffer is available.
void slot_cancel()
Slot for updating the status of bottom buttons (load/reset)
void slot_update_bottom_buttons(bool read_only_)
Slot for updating the status of bottom buttons (load/reset)
void reset_restore_buffer()
Reset the restore buffer is available.
A widget to browse/edit a configuration variant repository.
Definition: variant_repository_dialog.h:58
bool has_repository() const
Check if the repository handle is set.
The Bayeux/datatools library top-level namespace.
Definition: algo.h:13
void _construct()
Construct the GUI interface.
variant_repository_dialog(QWidget *parent_=0)
Default Constructor.
Variant repository.
Definition: variant_repository.h:57
A widget to browse/edit a configuration variant registry.
Definition: variant_repository_viewer.h:118