diff options
| author | Tannin <devnull@localhost> | 2013-09-21 19:25:33 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-09-21 19:25:33 +0200 |
| commit | dfca8be71b15bc13997110cc8777dd5a84a1fde7 (patch) | |
| tree | aac3cf02be006c1f5a15c48872db965fa6f7b10f /src/settings.h | |
| parent | 08037bf876659d52b8bb8be26c7aca362555ef85 (diff) | |
- esp reader now handles invalid files more gracefully
- files moved will now also be treated as "deleted" in the old location so a newly created file with that same name is not created in overwrite
- introduced a mechanism by which MO can recognize if it crashed before when attempting to load a plugin. That plugin can be blacklisted so it doesn't get loaded again
- plugins can now programaticaly change their settings
- plugins can now store data persistently without exposing that data as settings
- requesting an unset-setting from a plugin is no longer treated as a bug
- clarified warning message for when files are in overwrite directory
- the proxyPython plugin will now discover if python initialization crashed MO on a previous session and give the user a chance to fix it or disable the plugin
- bugfix: GetModuleFileName modified the buffer past the zero termination. While this doesn't violate the API documentation it is different from the regular windows implementation
- bugfix: proxy plugins couldn't access the parent widget
- bugfix: when moving a file from overwrite to a mod the in-memory file structure wasn't updated
- bugfix: name input dialog for profiles allowed names that weren't valid directory names
- bugfix: profile dialog wasn't able to delete profiles if the name started or ended in whitespaces
- bugfix: The name-cells for plugin settings could be changed (without effect)
- removed a few obsolete files from the repository
Diffstat (limited to 'src/settings.h')
| -rw-r--r-- | src/settings.h | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/src/settings.h b/src/settings.h index bf17d162..51ee6b92 100644 --- a/src/settings.h +++ b/src/settings.h @@ -57,6 +57,7 @@ public: /** * @brief register plugin to be configurable * @param plugin the plugin to register + * @return true if the plugin may be registered, false if it is blacklisted */ void registerPlugin(MOBase::IPlugin *plugin); @@ -195,11 +196,38 @@ public: * @param pluginName name of the plugin * @param key name of the setting to retrieve * @return the requested value as a QVariant - * @throws an exception is thrown if this setting doesn't exist + * @note an invalid QVariant is returned if the the plugin/setting is not declared */ QVariant pluginSetting(const QString &pluginName, const QString &key) const; /** + * @brief set a setting for one of the installed mods + * @param pluginName name of the plugin + * @param key name of the setting to change + * @param value the new value to set + * @throw an exception is thrown if pluginName is invalid + */ + void setPluginSetting(const QString &pluginName, const QString &key, const QVariant &value); + + /** + * @brief retrieve a persistent value for a plugin + * @param pluginName name of the plugin to store data for + * @param key id of the value to retrieve + * @param def default value to return if the value is not set + * @return the requested value + */ + QVariant pluginPersistent(const QString &pluginName, const QString &key, const QVariant &def) const; + + /** + * @brief set a persistent value for a plugin + * @param pluginName name of the plugin to store data for + * @param key id of the value to retrieve + * @param value value to set + * @throw an exception is thrown if pluginName is invalid + */ + void setPluginPersistent(const QString &pluginName, const QString &key, const QVariant &value, bool sync); + + /** * @return short code of the configured language (corresponding to the translation files) */ QString language(); @@ -210,6 +238,19 @@ public: */ void updateServers(const QList<ServerInfo> &servers); + /** + * @brief add a plugin that is to be blacklisted + * @param fileName name of the plugin to blacklist + */ + void addBlacklistPlugin(const QString &fileName); + + /** + * @brief test if a plugin is blacklisted and shouldn't be loaded + * @param fileName name of the plugin + * @return true if the file is blacklisted + */ + bool pluginBlacklisted(const QString &fileName) const; + private: QString obfuscate(const QString &password) const; @@ -219,6 +260,8 @@ private: void addStyles(QComboBox *styleBox); bool isNXMHandler(bool *modifyable); void setNXMHandlerActive(bool active, bool writable); + void readPluginBlacklist(); + void writePluginBlacklist(); private slots: @@ -241,6 +284,8 @@ private: QMap<QString, QMap<QString, QVariant> > m_PluginSettings; + QSet<QString> m_PluginBlacklist; + }; #endif // WORKAROUNDS_H |
