Skip to content

Commit 576e2dc

Browse files
committed
APIs for collaboration availability.
1 parent e35002f commit 576e2dc

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

ui/projectbrowser.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ class BINARYNINJAUIAPI ProjectBrowser: public QWidget, public UIContextNotificat
401401

402402
ClickableIcon* m_refreshButton;
403403
ClickableIcon* m_editDetailsButton;
404+
QToolButton* m_projectLinkButton = nullptr;
404405

405406
UIActionHandler* m_projectTreeActionHandler = nullptr;
406407
UIActionHandler* m_projectTableActionHandler = nullptr;
@@ -463,6 +464,7 @@ private slots:
463464
~ProjectBrowser();
464465

465466
ProjectRef GetProject() const { return m_project; };
467+
void setCollaborationAvailable(bool available);
466468

467469
static void registerActions();
468470
};

ui/sidebar.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

6768
private 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);

ui/uitypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// there are changes to the API that affect linking, including new functions,
77
// new types, modifications to existing functions or types, or new versions
88
// of the Qt libraries.
9-
#define BN_CURRENT_UI_ABI_VERSION 18
9+
#define BN_CURRENT_UI_ABI_VERSION 19
1010

1111
// Minimum ABI version that is supported for loading of plugins. Plugins that
1212
// are linked to an ABI version less than this will not be able to load and

0 commit comments

Comments
 (0)