All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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@supagro.inra.fr>
37  */
38 
39 
40 #ifndef __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__
41 #define __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__
42 
43 #include <openfluid/dllexport.hpp>
45 
46 #include <QDateTime>
47 #include <QToolButton>
48 
49 
50 namespace Ui
51 {
52  class PreferencesDialog;
53 }
54 
55 
56 class QTreeWidgetItem;
57 class WaresSearchPathsWidget;
58 
59 
60 namespace openfluid { namespace ui { namespace common {
61 
62 
64 {
65  Q_OBJECT;
66 
67  public:
68 
71  MODE_DEVSTUDIO
72  };
73 
74 
75  private:
76 
77  enum PagesIndexes { ENVIRONMENT_PAGE = 0,
78  BUILDER_PAGE = 1,
79  SIMULATION_PAGE = 2,
80  DEVENV_PAGE = 3,
81  DEVEDITOR_PAGE = 4,
82  MARKET_PAGE = 5
83  };
84 
85  private slots:
86 
87  void changePage(QTreeWidgetItem* Current, QTreeWidgetItem* Previous);
88 
89  void updateLanguage(const QString& Lang);
90 
91  void clearRecentsList();
92 
93  void updateRecentsMax(int Val);
94 
95  void confirmItemRemoval(bool Confirm);
96 
97  void confirmParamRemoval(bool Confirm);
98 
99  void confirmUnitsRemoval(bool Confirm);
100 
101  void confirmConnectionsRemoval(bool Confirm);
102 
103  void confirmAttributesRemoval(bool Confirm);
104 
105  void enableWatchers(bool Active);
106 
107  void enableAutoSaveBeforeRun(bool AutoSave);
108 
109  void updateDeltaT(int Val);
110 
111  void updatePeriodBegin(const QDateTime& DT);
112 
113  void updatePeriodEnd(const QDateTime& DT);
114 
115  void enableSyntaxHighlighting(bool Enable);
116 
117  void changeSyntaxElementDecoration(int ElementRow);
118 
119  void enableCurrentLineHighlighting(bool Enable);
120 
121  void changeCurrentLineColor();
122 
123  void changeCurrentFont(const QFont& Font);
124 
125  void enableLineWrapping(bool Enable);
126 
127  void changeIndentSpaceNumber(int SpaceNb);
128 
129  void changeSyntaxElementColor(int ElementRow);
130 
131  void addMarketPlace();
132 
133  void editMarketPlace();
134 
135  void removeMarketPlace();
136 
137  void processSimUserPathsUpdate();
138 
139  void processObsUserPathsUpdate();
140 
141  void processBextUserPathsUpdate();
142 
143  void processWorkspacesPathsUpdate();
144 
145  void updateDevConfigPATH();
146 
147  void updateDevConfigGenerator();
148 
149  void updateDevConfigOptions();
150 
151  void updateDevBuildPATH();
152 
153  void updateDevShowPATH(bool Enabled);
154 
155  void updateDevSslNoVerify(bool NoVerify);
156 
157  void detectQtDevToolsMinGW();
158 
159  void applyTextEditorSettings();
160 
161  void restoreDefaultsTextEditorSettings();
162 
163 
164  private:
165 
166  Ui::PreferencesDialog *ui;
167 
168  bool m_RecentsChanged;
169 
170  bool m_SimPathsChanged;
171 
172  bool m_ObsPathsChanged;
173 
174  bool m_WaresWatchingChanged;
175 
176  bool m_TextEditorSettingsChanged;
177 
178  int m_OriginalLangIndex;
179 
180  DisplayMode m_Mode;
181 
182  QStringList m_Formats {"bold", "italic", "underline", "strike-through"};
183 
184  void initialize();
185 
186  void updateMarketplacesList();
187 
188  void intializeTextEditorSettings();
189 
190  void updateSyntaxElementLabel(QLabel* Label, const QStringList& Decorations, const QString& ColorName);
191 
192  void updateSyntaxElementColorButton(QToolButton* Button, const QString& ColorName);
193 
194 
195  public:
196 
197  PreferencesDialog(QWidget *Parent, DisplayMode Mode = MODE_FULL);
198 
199  virtual ~PreferencesDialog();
200 
201  bool isRecentsChanged() const
202  { return m_RecentsChanged; }
203 
204  bool isSimPathsChanged() const
205  { return m_SimPathsChanged; }
206 
207  bool isObsPathsChanged() const
208  { return m_ObsPathsChanged; }
209 
211  { return m_WaresWatchingChanged; }
212 
214  { return m_TextEditorSettingsChanged; }
215 
216 
217  signals:
218 
219  void applyTextEditorSettingsAsked();
220 
221 };
222 
223 
224 } } } // namespaces
225 
226 
227 #endif /* __OPENFLUID_UICOMMON_PREFERENCESDIALOG_HPP__ */
Definition: PreferencesDialog.hpp:69
bool isSimPathsChanged() const
Definition: PreferencesDialog.hpp:204
bool isTextEditorSettingsChanged() const
Definition: PreferencesDialog.hpp:213
Definition: PreferencesDialog.hpp:70
Definition: OpenFLUIDDialog.hpp:50
DisplayMode
Definition: PreferencesDialog.hpp:69
#define OPENFLUID_API
Definition: dllexport.hpp:87
Definition: PreferencesDialog.hpp:63
bool isWaresWatchingChanged() const
Definition: PreferencesDialog.hpp:210
bool isObsPathsChanged() const
Definition: PreferencesDialog.hpp:207
bool isRecentsChanged() const
Definition: PreferencesDialog.hpp:201