Skip to content

Commit

Permalink
Store gui contributions enabled/disabled in plugin settings
Browse files Browse the repository at this point in the history
  • Loading branch information
joern274 committed Oct 26, 2024
1 parent 77051f5 commit bd1f47b
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 122 deletions.
18 changes: 12 additions & 6 deletions plugins/gui/include/gui/plugin_relay/gui_plugin_manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ namespace hal {
FacExtensionInterface::Feature mFeature;
QStringList mFeatureArguments;
bool mUserInterface;
bool mGuiExtensions;
int mGuiExtensionState; // 0 = not initialized 1 = no extensions 2 = disabled 3 = enabled
QString mCliOptions;
bool mFileFound;

Expand All @@ -79,6 +79,7 @@ namespace hal {
void updateFromLoaded(const BasePluginInterface* bpif, bool isUser, const QDateTime& modified = QDateTime());
bool isFileFound() const { return mFileFound; }
void setFileFound(bool fnd) { mFileFound = fnd; }
int enforceGuiExtensionState(GuiExtensionInterface* geif) const;
};

class GuiPluginManager;
Expand Down Expand Up @@ -148,7 +149,8 @@ namespace hal {
QStringList neededBy(const QString& pluginName);
void persist();
bool isLoaded(const QModelIndex& index) const;
bool hasGuiExtension(const QModelIndex& index) const;
int guiExtensionState(const QModelIndex& index) const;
void setGuiExtensionState(const QString& pluginName, int state);
bool hasCliExtension(const QModelIndex& index) const;
bool isHalGui(const QModelIndex& index) const;
void loadFeature(FacExtensionInterface::Feature ft, const QString& extension=QString());
Expand All @@ -172,7 +174,8 @@ namespace hal {
Q_PROPERTY(QString unloadIconStyle READ unloadIconStyle WRITE setUnloadIconStyle)
Q_PROPERTY(QString cliIconPath READ cliIconPath WRITE setCliIconPath)
Q_PROPERTY(QString cliIconStyle READ cliIconStyle WRITE setCliIconStyle)
Q_PROPERTY(QString guiIconPath READ guiIconPath WRITE setGuiIconPath)
Q_PROPERTY(QString guiIconEnabledPath READ guiIconEnabledPath WRITE setGuiIconEnabledPath)
Q_PROPERTY(QString guiIconDisabledPath READ guiIconDisabledPath WRITE setGuiIconDisabledPath)
Q_PROPERTY(QString guiIconEnabledStyle READ guiIconEnabledStyle WRITE setGuiIconEnabledStyle)
Q_PROPERTY(QString guiIconDisabledStyle READ guiIconDisabledStyle WRITE setGuiIconDisabledStyle)
Q_PROPERTY(QColor defaultTextColor READ defaultTextColor WRITE setDefaultTextColor)
Expand All @@ -188,7 +191,8 @@ namespace hal {
QString mUnloadIconStyle;
QString mCliIconPath;
QString mCliIconStyle;
QString mGuiIconPath;
QString mGuiIconEnabledPath;
QString mGuiIconDisabledPath;
QString mGuiIconEnabledStyle;
QString mGuiIconDisabledStyle;
QColor mDefaultTextColor;
Expand Down Expand Up @@ -216,7 +220,8 @@ namespace hal {
QString unloadIconStyle() const;
QString cliIconPath() const;
QString cliIconStyle() const;
QString guiIconPath() const;
QString guiIconEnabledPath() const;
QString guiIconDisabledPath() const;
QString guiIconEnabledStyle() const;
QString guiIconDisabledStyle() const;
QColor defaultTextColor() const;
Expand All @@ -229,7 +234,8 @@ namespace hal {
void setUnloadIconStyle(const QString& s);
void setCliIconPath(const QString& s);
void setCliIconStyle(const QString& s);
void setGuiIconPath(const QString& s);
void setGuiIconEnabledPath(const QString& s);
void setGuiIconDisabledPath(const QString& s);
void setGuiIconEnabledStyle(const QString& s);
void setGuiIconDisabledStyle(const QString& s);
void setDefaultTextColor(QColor& c);
Expand Down
3 changes: 2 additions & 1 deletion plugins/gui/resources/gui_resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
<file alias="attention">icons/attention.png</file>
<file alias="insert-plugin">icons/0501-insert-plugin.svg</file>
<file alias="cli-options">icons/0502-cli-options.svg</file>
<file alias="invoke-gui">icons/0503-invoke-gui.svg</file>
<file alias="enable-gui-contributions">icons/context-menu.svg</file>
<file alias="disable-gui-contributions">icons/no-context-menu.svg</file>
<file alias="tree-collapsed">icons/tree-collapsed.svg</file>
<file alias="view-ctx">icons/view-ctx.svg</file>
<file alias="view-dir">icons/view-dir.svg</file>
Expand Down
92 changes: 0 additions & 92 deletions plugins/gui/resources/icons/0503-invoke-gui.svg

This file was deleted.

138 changes: 138 additions & 0 deletions plugins/gui/resources/icons/context-menu.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit bd1f47b

Please sign in to comment.