event log: remove static property from LinkClicked method
This commit is contained in:
parent
77add3df11
commit
82ec6c8b79
|
@ -55,6 +55,7 @@ namespace SparkleShare {
|
|||
public SparkleEventLog () : base ()
|
||||
{
|
||||
Title = "Recent Events";
|
||||
|
||||
Delegate = new SparkleEventsDelegate ();
|
||||
|
||||
SetFrame (new RectangleF (0, 0, 480, 640), true);
|
||||
|
@ -142,6 +143,12 @@ namespace SparkleShare {
|
|||
ContentView.AddSubview (this.progress_indicator);
|
||||
|
||||
|
||||
(this.web_view.PolicyDelegate as SparkleWebPolicyDelegate)
|
||||
.LinkClicked += delegate (string href) {
|
||||
Controller.LinkClicked (href);
|
||||
};
|
||||
|
||||
|
||||
UpdateContent (null);
|
||||
UpdateChooser (null);
|
||||
OrderFrontRegardless ();
|
||||
|
@ -274,11 +281,16 @@ namespace SparkleShare {
|
|||
|
||||
|
||||
public class SparkleWebPolicyDelegate : WebPolicyDelegate {
|
||||
|
||||
|
||||
public event LinkClickedHandler LinkClicked;
|
||||
public delegate void LinkClickedHandler (string href);
|
||||
|
||||
|
||||
public override void DecidePolicyForNavigation (WebView web_view, NSDictionary action_info,
|
||||
NSUrlRequest request, WebFrame frame, NSObject decision_token)
|
||||
{
|
||||
SparkleEventLogController.LinkClicked (request.Url.ToString ());
|
||||
if (LinkClicked != null)
|
||||
LinkClicked (request.Url.ToString ());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ namespace SparkleShare {
|
|||
|
||||
this.web_view.NavigationRequested += delegate (object o, WebKit.NavigationRequestedArgs args) {
|
||||
if (args.Request.Uri == this.link_status)
|
||||
SparkleEventLogController.LinkClicked (args.Request.Uri);
|
||||
Controller.LinkClicked (args.Request.Uri);
|
||||
|
||||
// Don't follow HREFs (as this would cause a page refresh)
|
||||
if (!args.Request.Uri.Equals ("file:"))
|
||||
|
|
|
@ -178,7 +178,7 @@ namespace SparkleShare {
|
|||
}
|
||||
|
||||
|
||||
public static void LinkClicked (string url)
|
||||
public void LinkClicked (string url)
|
||||
{
|
||||
if (url.StartsWith (Path.VolumeSeparatorChar.ToString ())) {
|
||||
Program.Controller.OpenFile (url);
|
||||
|
|
Loading…
Reference in a new issue