RTXI 1.3
plugins/userprefs/userprefs.h
Go to the documentation of this file.
00001 /*
00002  Copyright (C) 2011 Georgia Institute of Technology, University of Utah, Weill Cornell Medical College
00003 
00004  This program is free software: you can redistribute it and/or modify
00005  it under the terms of the GNU General Public License as published by
00006  the Free Software Foundation, either version 3 of the License, or
00007  (at your option) any later version.
00008 
00009  This program is distributed in the hope that it will be useful,
00010  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  GNU General Public License for more details.
00013 
00014  You should have received a copy of the GNU General Public License
00015  along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 
00017  */
00018 
00019 #ifndef USERPREFS_H
00020 #define USERPREFS_H
00021 
00022 #include <qwidget.h>
00023 #include <qsettings.h>
00024 
00025 #include <plugin.h>
00026 #include <qobject.h>
00027 #include <rt.h>
00028 
00029 class QLineEdit;
00030 
00031 namespace UserPrefs
00032 {
00033 
00034   class Panel;
00035 
00036   class Prefs : public QObject, public ::Plugin::Object
00037   {
00038 
00039     Q_OBJECT
00040 
00041     friend class Panel;
00042 
00043   public:
00044 
00045     static Prefs *
00046     getInstance(void);
00047 
00048 public slots:
00049 
00050   void createPrefsPanel(void);
00051 
00052   private:
00053 
00054     Prefs(void);
00055     ~Prefs(void);
00056     Prefs(const Prefs &)
00057     {
00058     }
00059     ;
00060     Prefs &
00061     operator=(const Prefs &)
00062     {
00063       return *getInstance();
00064     }
00065     ;
00066 
00067     static Prefs *instance;
00068 
00069     int menuID;
00070     Panel *panel;
00071 
00072   }; // class Prefs
00073 
00074   class Panel : public QWidget
00075   {
00076 
00077   Q_OBJECT
00078 
00079   public:
00080 
00081     Panel(QWidget *);
00082     virtual
00083     ~Panel(void);
00084 
00085   public slots:
00086 
00087     void apply(void); // save and close
00088     void
00089     reset(void); // reset to defaults
00090     void
00091     cancel(void); // close with saving
00092 
00093     void
00094     chooseSettingsDir(void);
00095     void
00096     chooseDynamoDir(void);
00097     void
00098     chooseDataDir(void);
00099 
00100   private:
00101 
00102     int menuID;
00103 
00104     QSettings userprefs;
00105 
00106     QLineEdit *settingsDirEdit; // directory for settings files
00107     QLineEdit *dynamoDirEdit; // directory for DYNAMO files
00108     QLineEdit *dataDirEdit; // directory of most recent data file
00109     QLineEdit *HDFBufferEdit; // buffer size for HDF Data Recorder
00110 
00111   }; // class Panel
00112 
00113 }
00114 ; // namespace USERPREFS
00115 
00116 #endif /* USERPREFS */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines