~ubuntu-branches/debian/stretch/3depict/stretch

« back to all changes in this revision

Viewing changes to src/configFile.h

  • Committer: Package Import Robot
  • Author(s): D Haley
  • Date: 2011-12-18 19:33:32 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20111218193332-1motgr3vg9xeh41b
Tags: 0.0.9-1
* Update to upstream 0.0.9 
* Close powerpc bug fixed by 0.0.8-1 (Closes: #655682) 
* Close mgl font parsing bug fixed by mathgl upstream (Closes: #623431)
* Fix unclean source package (Closes: #643039)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * configFile.h - Configuration file management header 
 
3
 * Copyright (C) 2011  D Haley
 
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
 
1
19
#ifndef CONFIGFILE_H
2
20
#define CONFIGFILE_H
3
21
 
37
55
        private:
38
56
                std::deque<std::string> recentFiles;
39
57
                vector<Filter *> filterDefaults;
 
58
                
 
59
                //!Did the configuration load from file OK?
 
60
                bool configLoadOK;
 
61
                
40
62
                //!Panel 
41
63
                vector<bool> startupPanelView;
42
64
 
59
81
 
60
82
                //!Should the program perform online version number checking?
61
83
                bool allowOnlineVerCheck;       
 
84
 
 
85
                //!fractional initial positions of sashes in main UI
 
86
                float leftRightSashPos,topBottomSashPos,
 
87
                                filterSashPos,plotListSashPos;
 
88
                                        
 
89
                                        
62
90
        public:
63
91
                ConfigFile(); 
 
92
                ~ConfigFile(); 
64
93
                void addRecentFile(const std::string &str);
65
 
 
66
94
                void getRecentFiles(std::vector<std::string> &filenames) const; 
67
95
                void removeRecentFile(const std::string &str);
 
96
                
68
97
                unsigned int read();
69
98
                bool write();
70
 
 
 
99
                
 
100
                bool configLoadedOK() const { return configLoadOK;}
 
101
                        
 
102
                //Create the configuration folder, if needed.
 
103
                bool createConfigDir() const;
 
104
                //Get the configartion dir path
 
105
                std::string getConfigDir() const;
 
106
                
71
107
                std::string getErrMessage() const { return errMessage;};
72
108
 
73
109
                unsigned int getMaxHistory() const;
99
135
 
100
136
                //!Return the current panelmode
101
137
                unsigned int getStartupPanelMode() const;
 
138
                //!Set the mode to use for recalling the startup panel layout
102
139
                void setStartupPanelMode(unsigned int panelM);
103
140
 
104
141
                //!Returns true if we have a suggested initial window size; with x & y being the suggestion
108
145
 
109
146
                bool getAllowOnlineVersionCheck() const;
110
147
 
 
148
                //!Set if the program is allowed to access network resources
111
149
                void setAllowOnline(bool v);
 
150
                //!Set if the program is allowed to phone home to get latest version #s
112
151
                void setAllowOnlineVersionCheck(bool v);
 
152
 
 
153
                //!Set the position for the main window left/right sash 
 
154
                void setLeftRightSashPos(float fraction);
 
155
                //!Set the position for the top/bottom sash
 
156
                void setTopBottomSashPos(float fraction);
 
157
                //!Set the position for the filter property/tree sash
 
158
                void setFilterSashPos(float fraction);
 
159
                //!Set the position for the plot list panel
 
160
                void setPlotListSashPos(float fraction);
 
161
 
 
162
                //!Set the position for the main window left/right sash 
 
163
                float getLeftRightSashPos() { return leftRightSashPos;};
 
164
                //!Set the position for the top/bottom sash
 
165
                float getTopBottomSashPos(){ return topBottomSashPos;}
 
166
                //!Set the position for the filter property/tree sash
 
167
                float getFilterSashPos(){ return filterSashPos;};
 
168
                //!Set the position for the plot list panel
 
169
                float getPlotListSashPos(){ return plotListSashPos;};
 
170
 
 
171
 
113
172
};
114
173
 
115
174
#endif