RTXI  2.4
The Real-Time eXperiment Interface Documentation
userprefs.h
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 */
19 
20 #ifndef USERPREFS_H
21 #define USERPREFS_H
22 
23 #include <QtWidgets>
24 
25 #include <plugin.h>
26 #include <rt.h>
27 
28 namespace UserPrefs
29 {
30 
31 class Panel;
32 class Prefs : public QObject, public ::Plugin::Object
33 {
34 
35  Q_OBJECT
36 
37  friend class Panel;
38 
39 public:
40  static Prefs *getInstance(void);
41 
42 public slots:
43  void createPrefsPanel(void);
44 
45 private:
46  Prefs(void);
47  ~Prefs(void);
48  Prefs(const Prefs &) : QObject() {};
49  Prefs & operator=(const Prefs &)
50  {
51  return *getInstance();
52  };
53 
54  static Prefs *instance;
55  Panel *panel;
56 }; // class Prefs
57 
58 class Panel : public QWidget
59 {
60 
61  Q_OBJECT
62 
63 public:
64  Panel(QWidget *);
65  virtual ~Panel(void);
66  QLabel *status;
67 
68 public slots:
69  void apply(void); // save and close
70  void reset(void); // reset to defaults
71 
72  void chooseSettingsDir(void);
73  void chooseDataDir(void);
74 
75 private:
76  QMdiSubWindow *subWindow;
77  QSettings userprefs;
78 
79  QGroupBox *dirGroup;
80  QGroupBox *HDF;
81  QGroupBox *buttons;
82 
83  QLineEdit *settingsDirEdit; // directory for settings files
84  QLineEdit *dataDirEdit; // directory of most recent data file
85  QLineEdit *HDFBufferEdit; // buffer size for HDF Data Recorder
86 }; // class Panel
87 }; // namespace USERPREFS
88 #endif /* USERPREFS */
Plugin::Object
Definition: plugin.h:145
UserPrefs::Prefs::Panel
friend class Panel
Definition: userprefs.h:37
plugin.h
UserPrefs::Panel
Definition: userprefs.h:58
UserPrefs::Panel::chooseSettingsDir
void chooseSettingsDir(void)
Definition: userprefs.cpp:152
UserPrefs::Prefs::createPrefsPanel
void createPrefsPanel(void)
Definition: userprefs.cpp:186
UserPrefs
Definition: userprefs.h:28
UserPrefs::Panel::chooseDataDir
void chooseDataDir(void)
Definition: userprefs.cpp:160
UserPrefs::Panel::~Panel
virtual ~Panel(void)
Definition: userprefs.cpp:124
rt.h
UserPrefs::Panel::Panel
Panel(QWidget *)
Definition: userprefs.cpp:29
UserPrefs::Panel::apply
void apply(void)
Definition: userprefs.cpp:142
UserPrefs::Prefs::getInstance
static Prefs * getInstance(void)
Definition: userprefs.cpp:197
UserPrefs::Panel::status
QLabel * status
Definition: userprefs.h:66
UserPrefs::Panel::reset
void reset(void)
Definition: userprefs.cpp:129
UserPrefs::Prefs
Definition: userprefs.h:32