From 03fdb57de22d0cd03dc87677d987f9f92686d2db Mon Sep 17 00:00:00 2001 From: Bjorn Date: Mon, 14 Jan 2019 17:15:47 +0100 Subject: [PATCH] Maintance: remove trailing slashes from url and diable broken yr plugin --- .../YrWeatherService/YrWeatherServiceEndpoint.cs | 2 +- FloatingGlucose/FloatingGlucose.cs | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/FloatingGlucose/Classes/DataSources/Plugins/YrWeatherService/YrWeatherServiceEndpoint.cs b/FloatingGlucose/Classes/DataSources/Plugins/YrWeatherService/YrWeatherServiceEndpoint.cs index 49da24a..f43f7bd 100644 --- a/FloatingGlucose/Classes/DataSources/Plugins/YrWeatherService/YrWeatherServiceEndpoint.cs +++ b/FloatingGlucose/Classes/DataSources/Plugins/YrWeatherService/YrWeatherServiceEndpoint.cs @@ -22,7 +22,7 @@ internal class YrWeatherServiceEndpoint : IDataSourcePlugin public bool PluginHandlesFormatting => true; public bool RequiresUserNameAndPassword => false; public bool RequiresDataSource => true; - public bool PluginDisabled => false; + public bool PluginDisabled => true; public bool RequiresBrowseButton => false; public string BrowseDialogFileFilter => ""; public string DataSourceShortName => "Yr.no Weather"; diff --git a/FloatingGlucose/FloatingGlucose.cs b/FloatingGlucose/FloatingGlucose.cs index 0deb4de..db7415d 100644 --- a/FloatingGlucose/FloatingGlucose.cs +++ b/FloatingGlucose/FloatingGlucose.cs @@ -33,10 +33,11 @@ private NameValueCollection datasourceLocation // data points to calculate raw glucose diff var count = Default.EnableRawGlucoseDisplay ? 2 : 1; var units = Default.GlucoseUnits; + var urlstripped = Default.DataPathLocation.TrimEnd('/'); return new NameValueCollection() { { "raw", Default.DataPathLocation }, - { "location", $"{Default.DataPathLocation}/pebble?count={count}&units={units}"} + { "location", $"{urlstripped}/pebble?count={count}&units={units}"} }; } } @@ -57,6 +58,17 @@ private FormGlucoseSettings settingsForm return this._settingsForm; } } + [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] + private static extern IntPtr CreateRoundRectRgn + ( + int nLeftRect, // x-coordinate of upper-left corner + int nTopRect, // y-coordinate of upper-left corner + int nRightRect, // x-coordinate of lower-right corner + int nBottomRect, // y-coordinate of lower-right corner + int nWidthEllipse, // height of ellipse + int nHeightEllipse // width of ellipse + ); + public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; @@ -105,6 +117,8 @@ public FloatingGlucose() var r = Screen.PrimaryScreen.WorkingArea; this.Location = new Point(r.Width - this.Width, r.Height - this.Height); } + //draws round corners + //this.Region = System.Drawing.Region.FromHrgn(CreateRoundRectRgn(Width, Height, Width, Height, 20, 20)); } private void setFormSize()