-
Notifications
You must be signed in to change notification settings - Fork 1
Widget Mode, Mute Other apps on adhan play, always on top, Update checker #34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… yes opens the browser and starts the download (currently installation is done manually by user)
…f this project is used)" This reverts commit 34b2ec6.
|
MashaaAllah brother, I'm only looking at screenshots right now, but I love this!!!!!! I can't believe you implemented the updater/version-checker feature!!!! 😁 !!!!! And this minified mode of the app display is also very neat. JazzakAllahukhayr! I'm a bit busy right now so it'll likely be a few days before I get to properly reviewing this, but just know I'm not ignoring it. Looking forward to getting this merged in inshaaAllah!!!! 😄 |
All good brother take your time. |
|
^ |
iysaleh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks very nice, great refactors and good new features...
There are just few problems that need to be addressed before this can be merged:
Looks like the unit tests & RegistrySettingsHandler app fails to install:

Just as an FYI, the purpose of the RegistrySettingsHandler application is to install the registry keys as administrator when the app is first installed on a new computer -- It also opens the permissions for those keys so the OpenAdhan app can modify/update them as users please without admin privileges.
Also, maybe I'm wrong here, but is the small-mode/normal-mode toggle button a little brighter than the rest of the white used in the app? It feels distracting, can you please make it darker/greyer so it doesn't steal focus?

Sorry about the super late review -- things have been super busy here. Ramadan Mubarak!!!! 😄
| SaveRegistryValue(automaticDaylightSavingsAdjustmentKey, "0", "int"); | ||
| SaveRegistryValue(normalAdhanFilePathkey, oass.normalAdhanFilePath, "string"); | ||
| SaveRegistryValue(fajrAdhanFilePathKey, oass.fajrAdhanFilePath, "string"); | ||
| SaveRegistryValue(muteAllAppsOnAdhanPlayingKey, oass.muteAllAppsOnAdhanPlaying ? "1" : "0", "int"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's turn this off by default -- The adhan often plays in the middle of important work happening, including meetings that people are having-- muting the meeting/work fully is likely undesired default behavior.
| nextPrayerLabel.BackColor = Color.Transparent; | ||
| nextPrayerNameLabel.BackColor = Color.Transparent; | ||
| nextPrayerInLabel.BackColor = Color.Transparent; | ||
| nextPrayerInTimeLabel.BackColor = Color.Transparent; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, the label renames here should make things clearer.
| this.timers.RemoveRange(0, this.timers.Count); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 nice refactor
| //System.Diagnostics.Debug.WriteLine("RSH CalcMethod: " + calcMethod); | ||
| //System.Diagnostics.Debug.WriteLine("RSH JuristicMethod: " + juristicMethod); | ||
| //System.Diagnostics.Debug.WriteLine("RSH Lat: " + lat); | ||
| //System.Diagnostics.Debug.WriteLine("RSH Lon: " + lon); | ||
| //System.Diagnostics.Debug.WriteLine("RSH TZ: " + tz); | ||
| //System.Diagnostics.Debug.WriteLine("RSH Date is DST: " + TimeZoneInfo.Local.IsDaylightSavingTime(cc)); | ||
| string jsonString = await response.Content.ReadAsStringAsync(); | ||
|
|
||
| string searchTagName = "\"tag_name\":"; | ||
| int tagNameIndex = jsonString.IndexOf(searchTagName); | ||
|
|
||
| String[] prayer_times_strings = p.getDatePrayerTimes(y, m, d, lon, lat, tz); | ||
| // This only returns HH:MM -- all date info is lost. | ||
|
|
||
| //System.Diagnostics.Debug.WriteLine("PrayTimes Fajr: " + prayer_times_strings[fajr]); | ||
|
|
||
| double daylightSavingsTimeAdjustment = 0.0; | ||
| if (autoDst) | ||
| { | ||
| if (TimeZoneInfo.Local.IsDaylightSavingTime(cc)) | ||
| if (tagNameIndex != -1) | ||
| { | ||
| daylightSavingsTimeAdjustment = +60.0; | ||
| } | ||
| } | ||
| int start = tagNameIndex + searchTagName.Length; | ||
| int end = jsonString.IndexOf(",", start); | ||
|
|
||
| // if specific date isn't null (IE, not calculating for today): | ||
| if (specificDate != null) | ||
| { | ||
| prayer_times_strings[fajr] = cc.Date.ToShortDateString() + " " + prayer_times_strings[fajr]; | ||
| prayer_times_strings[shurook] = cc.Date.ToShortDateString() + " " + prayer_times_strings[shurook]; | ||
| prayer_times_strings[dhuhr] = cc.Date.ToShortDateString() + " " + prayer_times_strings[dhuhr]; | ||
| prayer_times_strings[asr] = cc.Date.ToShortDateString() + " " + prayer_times_strings[asr]; | ||
| prayer_times_strings[sunset] = cc.Date.ToShortDateString() + " " + prayer_times_strings[sunset]; | ||
| prayer_times_strings[maghrib] = cc.Date.ToShortDateString() + " " + prayer_times_strings[maghrib]; | ||
| prayer_times_strings[isha] = cc.Date.ToShortDateString() + " " + prayer_times_strings[isha]; | ||
| } | ||
| string latestVersion = jsonString.ToLower().Substring(start, end - start).Trim('"').Trim('v'); | ||
|
|
||
| // Parse DateTimes | ||
| this.prayer_datetimes = new DateTime[7]; | ||
| try | ||
| { | ||
| this.prayer_datetimes[fajr] = DateTime.Parse(prayer_times_strings[fajr]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.fajrAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[shurook] = DateTime.Parse(prayer_times_strings[shurook]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.shurookAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[dhuhr] = DateTime.Parse(prayer_times_strings[dhuhr]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.dhuhrAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[asr] = DateTime.Parse(prayer_times_strings[asr]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.asrAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[sunset] = DateTime.Parse(prayer_times_strings[sunset]).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[maghrib] = DateTime.Parse(prayer_times_strings[maghrib]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.maghribAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| this.prayer_datetimes[isha] = DateTime.Parse(prayer_times_strings[isha]).AddMinutes(this.rsh.SafeLoadFloatRegistryValue(RegistrySettingsHandler.ishaAdjustmentKey)).AddMinutes(daylightSavingsTimeAdjustment); | ||
| if (latestVersion != currentVersion) | ||
| { | ||
| string message = "A new version of OpenAdhan is available.\n\n" + | ||
| "Current Version: " + currentVersion + "\n" + | ||
| "Latest Version: " + latestVersion + "\n\n" + | ||
| "Would you like to update now?"; | ||
|
|
||
| if (MessageBox.Show(message, "OpenAdhan", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) | ||
| { | ||
| System.Diagnostics.Process.Start("https://github.com/HICalSoft/OpenAdhan/releases/download/V" + latestVersion + "/OpenAdhanInstaller.exe"); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! 😄
Not quite full auto-updating just yet, but atleast the user knows there's a new version that should probably be downloaded.
|
Btw, don't you think it looks better with the sun in front of the timeline? (the top one, what we had before these changes) @abdofallah |
as that is weird... |
Hmm, I thought that maybe it's because I'm on a new Windows 11 computer now (was previously building on Windows 10) --- but I just built the main branch on my Windows 11 computer and the sun is in front of the line as expected --- it only goes behind the line on this branch... Something must have changed I think. |






Optimize:
Added:
Preview:



