21 #ifndef TULIPSETTINGS_H
22 #define TULIPSETTINGS_H
25 #include <QNetworkProxy>
28 #include <tulip/GlGraphRenderingParameters.h>
29 #include <tulip/Size.h>
30 #include <tulip/Graph.h>
42 class TLP_QT_SCOPE TulipSettings :
public QSettings, GlDefaultSelectionColorManager, Observable {
44 Q_ENUMS(DisplayProperty)
47 static TulipSettings &instance();
49 static QString elementKey(
const QString &configEntry,
tlp::ElementType elem);
51 static void synchronizeSettings();
53 static void synchronizeViewSettings();
58 static QStringList recentDocuments();
64 static void addToRecentDocuments(
const QString &);
69 static void checkRecentDocuments();
71 static tlp::Color defaultColor(
tlp::ElementType elem,
bool tulipDefault =
false);
74 static tlp::Color defaultLabelColor(
bool tulipDefault =
false);
75 static void setDefaultLabelColor(
const tlp::Color &color);
77 static tlp::Size defaultSize(
tlp::ElementType elem,
bool tulipDefault =
false);
84 tlp::Color defaultSelectionColor(
bool tulipDefault =
false)
override;
86 static tlp::Color getDefaultSelectionColor(
bool tulipDefault =
false);
87 static void setDefaultSelectionColor(
const tlp::Color &color);
89 static QSet<QString> favoriteAlgorithms();
90 static void addFavoriteAlgorithm(
const QString &name);
91 static void removeFavoriteAlgorithm(
const QString &name);
94 static bool isProxyEnabled();
95 static void setProxyEnabled(
bool);
97 static QNetworkProxy::ProxyType proxyType();
98 static void setProxyType(QNetworkProxy::ProxyType);
100 static QString proxyHost();
101 static void setProxyHost(
const QString &);
103 static unsigned int proxyPort();
104 static void setProxyPort(
unsigned int);
106 static bool isUseProxyAuthentification();
107 static void setUseProxyAuthentification(
bool);
109 static QString proxyUsername();
110 static void setProxyUsername(
const QString &);
112 static QString proxyPassword();
113 static void setProxyPassword(
const QString &);
115 static void applyProxySettings();
117 static bool isFirstRun();
118 static void setFirstRun(
bool);
120 static bool isFirstTulipMMRun();
121 static bool userHasLaunchedTulipMM(
const std::string &mmVersion);
122 static void setFirstTulipMMRun(
bool);
124 static bool displayDefaultViews();
125 static void setDisplayDefaultViews(
bool);
127 static bool isAutomaticMapMetric();
128 static void setAutomaticMapMetric(
bool);
130 static bool isAutomaticCentering();
131 static void setAutomaticCentering(
bool);
133 static bool isAutomaticRatio();
134 static void setAutomaticRatio(
bool);
136 static bool isViewOrtho();
137 static void setViewOrtho(
bool);
139 static bool isResultPropertyStored();
140 static void setResultPropertyStored(
bool);
142 enum LogPluginCall { NoLog = 0, LogCall = 1, LogCallWithExecutionTime = 2 };
143 static unsigned int logPluginCall();
144 static void setLogPluginCall(
unsigned int);
146 static bool isUseTlpbFileFormat();
147 static void setUseTlpbFileFormat(
bool);
149 static unsigned int seedOfRandomSequence();
151 static void initSeedOfRandomSequence();
153 static bool warnUserAboutGraphicsCard();
154 static void setWarnUserAboutGraphicsCard(
bool);
156 static bool isDisplayInDarkMode();
157 static void setDisplayInDarkMode(
bool);
159 static bool loggerAnchored();
160 static void setLoggerAnchored(
bool);
162 static QStringList recentPerspectiveFiles();
163 static void setRecentPerspectiveFiles(QStringList &doc);
165 void treatEvent(
const Event &message)
override;
169 static TulipSettings *_instance;
171 void setFavoriteAlgorithms(
const QSet<QString> &lst);
void setSeedOfRandomSequence(unsigned int seed=UINT_MAX)
Gives the value of the seed used for further initialization of a random sequence (with further calls ...