summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2022-04-28 12:56:49 -0400
committerPeter LaFosse <peter@vector35.com>2022-04-29 07:39:15 -0400
commitdc8a1ed20fb0a0a7341f940a4c224e2002928f4e (patch)
tree6447bf50dd96e371912dd5cec16b02a3deb35381
parent87a8a04db5c0a80c06819ec6caf1568b7202cf51 (diff)
Improve navigation to correct tab when error/warn indicator is clicked
Fix potential hang and new tab navigation when clicking error/warn indicator
-rw-r--r--ui/logview.h12
-rw-r--r--ui/uicontext.h10
2 files changed, 14 insertions, 8 deletions
diff --git a/ui/logview.h b/ui/logview.h
index 2c4d6057..c7e5af07 100644
--- a/ui/logview.h
+++ b/ui/logview.h
@@ -253,26 +253,22 @@ class BINARYNINJAUIAPI LogStatus : public QWidget
QMenu* m_menu;
std::mutex m_countMutex;
- int m_totalErrorCount = 0;
- int m_totalWarnCount = 0;
std::map<uint64_t, int> m_sessionErrorCount;
std::map<uint64_t, int> m_sessionWarnCount;
size_t m_sessionId {0};
LogView* m_logView;
- std::map<size_t, QString> getSessionToNameMap();
public:
LogStatus(QWidget* parent);
void setLogView(LogView* view) { m_logView = view; }
void incrementErrorCount(uint64_t session, int count);
void incrementWarningCount(uint64_t session, int count);
- void clearIndicators(bool warnings, bool errors);
void checkForErrors();
- void focusTab(QString tabName);
-
+ void focusTab(UIContext* context, QWidget* tab);
+ void clearIndicators();
void updateTheme();
public Q_SLOTS:
void notifySessionChanged(size_t sessionId);
- private Q_SLOTS:
- void clearStatus(bool error);
+ public Q_SLOTS:
+ void clicked(bool error);
};
diff --git a/ui/uicontext.h b/ui/uicontext.h
index 94b05b05..6a139dd6 100644
--- a/ui/uicontext.h
+++ b/ui/uicontext.h
@@ -272,6 +272,16 @@ class BINARYNINJAUIAPI UIContext
virtual std::vector<std::pair<BinaryViewRef, QString>> getAvailableBinaryViews() = 0;
/*!
+ Gets the tab for for a given sessionId
+ */
+ virtual QWidget* getTabForSessionId(uint64_t sessionId) = 0;
+
+ /*!
+ Gets the name of a tab for the given session
+ */
+ virtual QString getTabNameForSessionId(uint64_t sessionId) = 0;
+
+ /*!
Get the currently visible View for the currently visible ViewFrame (if it exists)
\return Current View or nullptr if the current ViewFrame is null or does not have a View
*/