ZIMA CAD Parts
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
settings.h
Go to the documentation of this file.
1 #ifndef SETTINGS_H
2 #define SETTINGS_H
3 
4 #include <QHash>
5 #include "basedatasource.h"
7 
8 
22 class Settings
23 {
24 public:
25  enum Languages {
26  DETECT=0,
29  };
30 
32  static Settings *get();
33 
35  void save();
36 
42  QString getCurrentLanguageCode();
47  void setCurrentLanguageCode(const QString &lang);
48 
49  // real settings
50 
51  QHash<QString,QString> ExternalPrograms;
53  QString WorkingDir;
55  QByteArray MainWindowState;
57  QByteArray MainWindowGeometry;
60 
73 
80 
82  QString ProeExecutable;
83 
89  QList<FilterGroup> FilterGroups;
90 
94  QRegExp filtersRegex;
96  void recalculateFilters();
97 
100 
102  QStringList Languages;
103 
105  int langIndex(const QString &lang);
107  QString langIndexToName(int lang);
108 
109 private:
111  QString Language;
112 
114  static Settings *m_instance;
115 
116  Settings();
117  Settings(const Settings &) {};
118  ~Settings();
119 
120  void load();
121  void loadDataSources();
122  void saveDataSources();
123  void setupFilterGroups();
124  void saveFilters();
125 };
126 
127 #endif // SETTINGS_H
Languages
Definition: settings.h:25
QByteArray ExtensionsProductViewGeometry
ProductView dialog geometry.
Definition: settings.h:77
bool DataSourcesNeedsUpdate
Internal flag if there was change in datasources to be updated in ServersWidget.
Definition: settings.h:85
QString ExtensionsProductViewPath
ProEProductView path for external java applet.
Definition: settings.h:75
bool DeveloperEnabled
Flag: run in developer mode.
Definition: settings.h:70
void recalculateFilters()
Recalculate the filtersRegex by user config.
Definition: settings.cpp:307
Definition: settings.h:27
bool ShowProeVersions
Flag to show Pro/E versions.
Definition: settings.h:99
QRegExp filtersRegex
Definition: settings.h:94
The Settings singleton. All settings I/O is handled in this class. The singleton is created in the ma...
Definition: settings.h:22
Definition: settings.h:26
int GUIThumbWidth
Size of the thumbnails in FileModel.
Definition: settings.h:62
QString langIndexToName(int lang)
Map Languages enum to string code.
Definition: settings.cpp:362
int GUIPreviewWidth
Size of the preview in FileModel.
Definition: settings.h:64
int GUISplashDuration
How long it should stop on splash screen.
Definition: settings.h:68
QByteArray MainWindowGeometry
Geometry of the MainWindow.
Definition: settings.h:57
bool DeveloperTechSpecToolBar
Flag: show developer tool bar.
Definition: settings.h:72
void save()
Write settings to disk.
Definition: settings.cpp:79
QList< int > ServersSplitterSizes
Splitter position in the ServersWidget. Hack: It&#39;s a workaround for broken QSplitter::geometry.
Definition: settings.h:59
QHash< QString, QString > ExternalPrograms
Definition: settings.h:51
DataSourceList DataSources
List of DataSources.
Definition: settings.h:87
QByteArray MainWindowState
State of the MainWindow.
Definition: settings.h:55
QPoint ExtensionsProductViewPosition
ProductView dialog position.
Definition: settings.h:79
QStringList Languages
Available languages in QLocale::name() form (en_EN,...)
Definition: settings.h:102
QString getCurrentLanguageCode()
Get chosen language code or a default locale.
Definition: settings.cpp:341
QString WorkingDir
Current working directory.
Definition: settings.h:53
int langIndex(const QString &lang)
Map lang string to Languages enum.
Definition: settings.cpp:352
void setCurrentLanguageCode(const QString &lang)
Set language code.
Definition: settings.cpp:347
QString ProeExecutable
Executable of the Pro/E.
Definition: settings.h:82
Definition: settings.h:28
bool GUISplashEnabled
Flag if the splash creen should be shown.
Definition: settings.h:66
QList< BaseDataSource * > DataSourceList
Definition: basedatasource.h:127
QList< FilterGroup > FilterGroups
Filter groups.
Definition: settings.h:89