Skip to content

Commit cfe2699

Browse files
committed
[VEX-21]: Added setting to ignore pre-releases
1 parent 78bdcc5 commit cfe2699

File tree

5 files changed

+17
-1
lines changed

5 files changed

+17
-1
lines changed

src/VexTrack.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,12 @@ def _fixed_map(style, style_name, option):
507507
ignoreInactiveDaysSettingCheck.grid(padx=8, pady=2, columnspan=2, column=2, row=7, sticky="we")
508508
ignoreInactiveDaysSettingVar.set(settings["ignoreInactiveDays"])
509509

510+
ignorePrereleasesSettingVar = IntVar()
511+
ttk.Label(settingsContainer, text="Ignore pre-releases:").grid(padx=8, pady=2, columnspan=2, column=0, row=8, sticky="we")
512+
ignorePrereleasesSettingCheck = ttk.Checkbutton(settingsContainer, onvalue=1, offvalue=0, variable=ignorePrereleasesSettingVar)
513+
ignorePrereleasesSettingCheck.grid(padx=8, pady=2, columnspan=2, column=2, row=8, sticky="we")
514+
ignorePrereleasesSettingVar.set(settings["ignorePrereleases"])
515+
510516
settingsBtnContainer = tk.Frame(settingsTab)
511517
settingsBtnContainer.pack(fill="x")
512518

@@ -706,6 +712,7 @@ def updateSettings():
706712

707713
settings["useHistoryColors"] = enableColorsSettingVar.get()
708714
settings["ignoreInactiveDays"] = ignoreInactiveDaysSettingVar.get()
715+
settings["ignorePrereleases"] = ignorePrereleasesSettingVar.get()
709716

710717
settings["winBackground"] = winBackgroundSettingBtn.color
711718
settings["winForeground"] = winForegroundSettingBtn.color
@@ -1072,6 +1079,7 @@ def updateSettingsUI(updateBufferDays):
10721079
bufferDaysSettingEntry.insert(0, settings["bufferDays"])
10731080
enableColorsSettingVar.set(settings["useHistoryColors"])
10741081
ignoreInactiveDaysSettingVar.set(settings["ignoreInactiveDays"])
1082+
ignorePrereleasesSettingVar.set(settings["ignorePrereleases"])
10751083

10761084
winBackgroundSettingBtn.setValues(color=settings["winBackground"])
10771085
winForegroundSettingBtn.setValues(color=settings["winForeground"])
@@ -1203,6 +1211,7 @@ def updateValues(updateBufferDays=True):
12031211
bufferDaysSettingVar.trace("w", lambda a, b, c: updateSettings())
12041212
enableColorsSettingCheck.configure(command=lambda: updateSettings())
12051213
ignoreInactiveDaysSettingCheck.configure(command=lambda: updateSettings())
1214+
ignorePrereleasesSettingCheck.configure(command=lambda: updateSettings())
12061215

12071216
winBackgroundSettingBtn.setValues(command=lambda: updateSettings())
12081217
winForegroundSettingBtn.setValues(command=lambda: updateSettings())

src/updaterLib/core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from tokenString import *
99
import json
1010
import time
11+
from vextrackLib import settings
1112

1213
root = Tk()
1314
root.withdraw()
@@ -139,6 +140,8 @@ def checkNewVersion(softwareName):
139140
isNewVersion = False
140141
legacyMode = False
141142

143+
setts = settings.loadSettings()
144+
142145
versionString, legacyMode, ignoredVersions = getVersionString(softwareName)
143146
versionNumber = versionString.split("v")[1]
144147

@@ -164,6 +167,8 @@ def checkNewVersion(softwareName):
164167
if versionNumber > latestVersionNumber: break
165168

166169
if versionNumber < latestVersionNumber:
170+
if r["prerelease"] and setts["ignorePrereleases"] == 1: continue
171+
167172
res = messagebox.askquestion("Updater", "A new version of " + softwareName + " is available: " + latestVersionString + "\nDo you want to update?")
168173

169174
if res == "yes":

src/vars.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
DEFAULT_BUFFER_DAYS = 8
3333
DEFAULT_USE_HISTORY_COLORS = 1
3434
DEFAULT_IGNORE_INACTIVE_DAYS = 0
35+
DEFAULT_IGNORE_PRERELEASES = 1
3536

3637
DEFAULT_NONE_BG_COLOR = "#939393"
3738
DEFAULT_WIN_BG_COLOR = "#AFE0D2"

src/vextrackLib/settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
"bufferDays": DEFAULT_BUFFER_DAYS,
88
"useHistoryColors": DEFAULT_USE_HISTORY_COLORS,
99
"ignoreInactiveDays": DEFAULT_IGNORE_INACTIVE_DAYS,
10+
"ignorePrereleases": DEFAULT_IGNORE_PRERELEASES,
1011
"winBackground": DEFAULT_WIN_BG_COLOR,
1112
"winForeground": DEFAULT_WIN_FG_COLOR,
1213
"lossBackground": DEFAULT_LOSS_BG_COLOR,

version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"VexTrack": "v1.6",
3-
"Updater": "v1.3"
3+
"Updater": "v1.35"
44
}

0 commit comments

Comments
 (0)