Menu

Diff of /trunk/Src/UNotifier.pas [r73] .. [r74]  Maximize  Restore

Switch to side-by-side view

--- a/trunk/Src/UNotifier.pas
+++ b/trunk/Src/UNotifier.pas
@@ -44,6 +44,8 @@
  *                        TNotifier.
  * v1.6 of 12 Jul 2009  - Added new DisplayCategory and SetDisplayCategoryAction
  *                        methods to TNotifier.
+ *                      - Changed SetDisplayRoutineAction to pass notifier
+ *                        reference to the action.
  *
  *
  * ***** BEGIN LICENSE BLOCK *****
@@ -248,7 +250,7 @@
 
 uses
   // Delphi
-  StdActns,
+  SysUtils, StdActns,
   // Project
   IntfCompilers, UCategoryAction, UCompLogAction, UEditRoutineAction,
   URoutineAction, UViewItemAction;
@@ -381,6 +383,8 @@
 begin
   Assert(Action is TCategoryAction,
     ClassName + '.SetDisplayCategoryAction: Action is not TCategoryAction');
+  Assert(Supports(Action, ISetNotifier),
+    ClassName + '.SetDisplayCategoryAction: Action must support ISetNotifier');
   fDisplayCategoryAction := Action;
   (fDisplayCategoryAction as ISetNotifier).SetNotifier(Self);
 end;
@@ -393,7 +397,10 @@
 begin
   Assert(Action is TRoutineAction,
     ClassName + '.SetDisplayRoutineAction: Action is not TRoutineAction');
+  Assert(Supports(Action, ISetNotifier),
+    ClassName + '.SetDisplayRoutineAction: Action must support ISetNotifier');
   fDisplayRoutineAction := Action;
+  (fDisplayRoutineAction as ISetNotifier).SetNotifier(Self);
 end;
 
 procedure TNotifier.SetDonateAction(const Action: TBasicAction);
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.