@@ -63,6 +63,7 @@ class BINARYNINJAUIAPI Sidebar : public QObject
6363 static std::set<SidebarWidgetType*> m_defaultTypes;
6464 static std::optional<SidebarMetrics> m_metrics;
6565 static std::map<QString, SidebarIconVisibility> m_iconVisibility;
66+ static std::set<QString> m_unavailableTypeNames;
6667
6768private Q_SLOTS :
6869 void containerUpdated ();
@@ -148,6 +149,10 @@ private Q_SLOTS:
148149 static void moveSidebarWidgetType (SidebarWidgetType* type, SidebarWidgetLocation newLocation, size_t newIndex);
149150 static SidebarWidgetType* typeFromName (const QString& name);
150151 static bool isTypeRegistered (const QString& name);
152+ static bool isTypeAvailable (SidebarWidgetType* type);
153+ static bool isTypeAvailable (const QString& name);
154+ static void setTypeAvailable (SidebarWidgetType* type, bool available);
155+ static void setTypeAvailable (const QString& name, bool available);
151156 static std::vector<SidebarWidgetType*> types ();
152157 static const std::vector<SidebarWidgetType*>& typesForLocation (SidebarWidgetLocation location);
153158 static std::vector<SidebarWidgetType*> typesForContainerLocation (SidebarContainerLocation location);
@@ -197,7 +202,7 @@ private Q_SLOTS:
197202 static T* activateWidget (SidebarWidgetType* type)
198203 {
199204 Sidebar* sidebar = current ();
200- if (!type || !sidebar)
205+ if (!type || !sidebar || ! isTypeAvailable (type) )
201206 return (T*)nullptr ;
202207 sidebar->activate (type);
203208 QWidget* widget = sidebar->widget (type);
0 commit comments