Manual for OpenFLUID 2.1.10

PreferencesDialog.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file PreferencesDialog.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37  */
38 
39 
40 #ifndef __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__
41 #define __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__
42 
43 
44 #include <QDateTime>
45 #include <QToolButton>
46 
47 #include <openfluid/dllexport.hpp>
49 
50 
51 namespace Ui
52 {
53  class PreferencesDialog;
54 }
55 
56 
57 class QTreeWidgetItem;
58 class WaresSearchPathsWidget;
59 
60 
61 namespace openfluid { namespace ui { namespace common {
62 
63 
65 {
66  Q_OBJECT;
67 
68  public:
69 
72  MODE_DEVSTUDIO
73  };
74 
75 
76  private:
77 
78  enum PagesIndexes { ENVIRONMENT_PAGE = 0,
79  BUILDER_PAGE = 1,
80  SIMULATION_PAGE = 2,
81  DEVENV_PAGE = 3,
82  DEVEDITOR_PAGE = 4,
83  MARKET_PAGE = 5
84  };
85 
86  private slots:
87 
88  void changePage(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);
89 
90  void updateLanguage(int Index);
91 
92  void clearRecentsList();
93 
94  void updateRecentsMax(int Val);
95 
96  void confirmItemRemoval(bool Confirm);
97 
98  void confirmParamRemoval(bool Confirm);
99 
100  void confirmUnitsRemoval(bool Confirm);
101 
102  void confirmConnectionsRemoval(bool Confirm);
103 
104  void confirmAttributesRemoval(bool Confirm);
105 
106  void enableWatchers(bool Active);
107 
108  void enableAutoSaveBeforeRun(bool AutoSave);
109 
110  void updateDeltaT(int Val);
111 
112  void updatePeriodBegin(const QDateTime& DT);
113 
114  void updatePeriodEnd(const QDateTime& DT);
115 
116  void enableSyntaxHighlighting(bool Enable);
117 
118  void changeSyntaxElementDecoration(int ElementRow);
119 
120  void enableCurrentLineHighlighting(bool Enable);
121 
122  void changeCurrentLineColor();
123 
124  void changeCurrentFont(const QFont& Font);
125 
126  void enableLineWrapping(bool Enable);
127 
128  void changeIndentSpaceNumber(int SpaceNb);
129 
130  void changeSyntaxElementColor(int ElementRow);
131 
132  void addMarketPlace();
133 
134  void editMarketPlace();
135 
136  void removeMarketPlace();
137 
138  void processSimUserPathsUpdate();
139 
140  void processObsUserPathsUpdate();
141 
142  void processBextUserPathsUpdate();
143 
144  void processWorkspacesPathsUpdate();
145 
146  void processExtToolsUpdate();
147 
148  void enableAutosaveBeforeBuild(bool Enabled);
149 
150  void updateDevConfigPATH();
151 
152  void updateDevConfigGenerator();
153 
154  void updateDevConfigOptions();
155 
156  void updateDevBuildPATH();
157 
158  void updateDevShowPATH(bool Enabled);
159 
160  void updateDevSslNoVerify(bool NoVerify);
161 
162  void detectQtDevToolsMinGW();
163 
164  void applyTextEditorSettings();
165 
166  void restoreDefaultsTextEditorSettings();
167 
168 
169  private:
170 
171  Ui::PreferencesDialog *ui;
172 
173  bool m_RecentsChanged;
174 
175  bool m_SimPathsChanged;
176 
177  bool m_ObsPathsChanged;
178 
179  bool m_WaresWatchingChanged;
180 
181  bool m_TextEditorSettingsChanged;
182 
183  bool m_RestartRequired;
184 
185  int m_OriginalLangIndex;
186 
187  QString m_OriginalActiveWorkspace;
188 
189  DisplayMode m_Mode;
190 
191  QStringList m_Formats {"bold", "italic", "underline", "strike-through"};
192 
193  void initialize();
194 
195  void updateMarketplacesList();
196 
197  void intializeTextEditorSettings();
198 
199  void updateSyntaxElementLabel(QLabel* Label, const QStringList& Decorations, const QString& ColorName);
200 
201  void updateSyntaxElementColorButton(QToolButton* Button, const QString& ColorName);
202 
203  void updateRestartStatus();
204 
205  static QString getLanguageAsPrettyString(const QString& LangCode);
206 
207 
208  signals:
209 
210  void applyTextEditorSettingsAsked();
211 
212 
213  public:
214 
215  PreferencesDialog(QWidget *Parent, DisplayMode Mode = MODE_FULL);
216 
217  virtual ~PreferencesDialog();
218 
219  bool isRecentsChanged() const
220  { return m_RecentsChanged; }
221 
222  bool isSimPathsChanged() const
223  { return m_SimPathsChanged; }
224 
225  bool isObsPathsChanged() const
226  { return m_ObsPathsChanged; }
227 
229  { return m_WaresWatchingChanged; }
230 
232  { return m_TextEditorSettingsChanged; }
233 
235  { return m_RestartRequired; }
236 
237 };
238 
239 
240 } } } // namespaces
241 
242 
243 #endif /* __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__ */
Definition: ApplicationException.hpp:47
DisplayMode
Definition: PreferencesDialog.hpp:70
bool isTextEditorSettingsChanged() const
Definition: PreferencesDialog.hpp:231
bool isObsPathsChanged() const
Definition: PreferencesDialog.hpp:225
Definition: PreferencesDialog.hpp:70
Definition: AboutDialog.hpp:50
bool isWaresWatchingChanged() const
Definition: PreferencesDialog.hpp:228
bool isSimPathsChanged() const
Definition: PreferencesDialog.hpp:222
bool isRecentsChanged() const
Definition: PreferencesDialog.hpp:219
bool isRestartRequired()
Definition: PreferencesDialog.hpp:234
#define OPENFLUID_API
Definition: dllexport.hpp:86
Definition: MessageDialog.hpp:55
Definition: PreferencesDialog.hpp:64
Definition: PreferencesDialog.hpp:71