summaryrefslogtreecommitdiff
path: root/examples/uinotification
diff options
context:
space:
mode:
authorGlenn Smith <glenn@vector35.com>2021-05-24 22:37:09 -0400
committerGlenn Smith <glenn@vector35.com>2021-05-26 16:48:34 -0400
commita46902ef8bbde08221ffd869054e206c0dfc2234 (patch)
treeedce5b743129d49a4748b6e32406152aa622e37d /examples/uinotification
parente278b2452efbf1b653f2d7d6b6d8090128d02ff3 (diff)
Updated examples and docs
Diffstat (limited to 'examples/uinotification')
-rw-r--r--examples/uinotification/uinotification.cpp20
-rw-r--r--examples/uinotification/uinotification.h2
2 files changed, 21 insertions, 1 deletions
diff --git a/examples/uinotification/uinotification.cpp b/examples/uinotification/uinotification.cpp
index f498db4c..d9eada8e 100644
--- a/examples/uinotification/uinotification.cpp
+++ b/examples/uinotification/uinotification.cpp
@@ -2,7 +2,8 @@
#include "uinotification.h"
#include "filecontext.h"
#include "viewframe.h"
-#include <QMessageBox>
+#include <QtWidgets/QMessageBox>
+#include <QtCore/QFileInfo>
using namespace BinaryNinja;
@@ -92,6 +93,23 @@ void NotificationListener::OnAddressChange(UIContext* context, ViewFrame* frame,
}
+bool NotificationListener::GetNameForFile(UIContext* context, FileContext* file, QString& name)
+{
+ LogInfo("GetNameForFile");
+ name = file->getFilename() + " Foo";
+ return true;
+}
+
+
+bool NotificationListener::GetNameForPath(UIContext* context, const QString& path, QString& name)
+{
+ QFileInfo info(path);
+ LogInfo("GetNameForPath");
+ name = info.baseName() + " Foo";
+ return true;
+}
+
+
extern "C"
{
BN_DECLARE_UI_ABI_VERSION
diff --git a/examples/uinotification/uinotification.h b/examples/uinotification/uinotification.h
index 3a3231be..31ffbc34 100644
--- a/examples/uinotification/uinotification.h
+++ b/examples/uinotification/uinotification.h
@@ -18,6 +18,8 @@ public:
virtual void OnAfterCloseFile(UIContext* context, FileContext* file, ViewFrame* frame) override;
virtual void OnViewChange(UIContext* context, ViewFrame* frame, const QString& type) override;
virtual void OnAddressChange(UIContext* context, ViewFrame* frame, View* view, const ViewLocation& location) override;
+ virtual bool GetNameForFile(UIContext* context, FileContext* file, QString& name) override;
+ virtual bool GetNameForPath(UIContext* context, const QString& path, QString& name) override;
static void init();
}; \ No newline at end of file