Preferences.qo.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef QTVIEWER_PREFERENCES_H_
00029 #define QTVIEWER_PREFERENCES_H_
00030
00031 #include <set>
00032 #include <string>
00033 #include <QSignalMapper>
00034 #include <QtGui/QDialog>
00035 #include <display/QtViewer/Preferences.ui.h>
00036 #include <display/Utilities/Lowlevel.h>
00037
00038 namespace casa {
00039 namespace viewer {
00040
00041 class Preferences : public QDialog, protected Ui::Preferences {
00042 Q_OBJECT
00043 public:
00044 Preferences( QWidget *parent=0 );
00045 ~Preferences( );
00046
00047 protected slots:
00048 void reset_edits( );
00049 void cancel_edits( );
00050 void apply_edits( );
00051
00052 protected:
00053 void showEvent( QShowEvent* );
00054
00055 private:
00056 typedef std::map<std::string,std::vector<std::string> > tokenized_type;
00057 typedef std::map<std::string,std::set<std::string> > branch_count_type;
00058
00059 void init( );
00060
00061
00062 int tokenize( tokenized_type & );
00063
00064 int countbranches( const tokenized_type &, branch_count_type & );
00065
00066 int find_tree_depth( bool, const tokenized_type &, const branch_count_type & );
00067 static const char *init_state[];
00068
00069 QSignalMapper *sigmap;
00070 typedef std::map<std::string,QValidator*> validate_map_type;
00071 validate_map_type validate_map;
00072
00073 typedef std::map<std::string,std::string> rcvalues_type;
00074 typedef std::map<std::string,std::string> tooltips_type;
00075 typedef std::map<std::string,QLineEdit*> rcedits_type;
00076
00077 tooltips_type tips;
00078
00079 rcvalues_type defaults;
00080
00081 rcedits_type edits;
00082
00083 const int init_fields;
00084 const int tip_offset;
00085 const int role_offset;
00086 const int default_offset;
00087 const int validate_offset;
00088
00089
00090 Casarc &rc;
00091 };
00092
00093 }
00094 }
00095
00096 #endif
00097