Skip to content
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

Improvements #1468

Merged
merged 3 commits into from Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 12 additions & 18 deletions wingetui/Interface/GenericSections.py
Expand Up @@ -284,25 +284,22 @@ def __init__(self, parent=None):
langDictWithPercentage = {}
invertedLangDict = {}
for key, value in languageReference.items():
if (key in untranslatedPercentage):
langValue = value
if key in untranslatedPercentage:
perc = untranslatedPercentage[key]
if perc == "0%":
continue
if key not in lang["locale"]:
langListWithPercentage.append(f"{value} ({perc})")
langDictWithPercentage[key] = f"{value} ({perc})"
invertedLangDict[f"{value} ({perc})"] = key
else:
if key in lang["locale"]:
marticliment marked this conversation as resolved.
Show resolved Hide resolved
k = len(lang.keys())
v = len([val for val in lang.values() if val is None])
perc = f"{int(100-v/k*100)}%"
langListWithPercentage.append(f"{value} ({perc})")
langDictWithPercentage[key] = f"{value} ({perc})"
invertedLangDict[f"{value} ({perc})"] = key
else:
invertedLangDict[value] = key
langDictWithPercentage[key] = value
langListWithPercentage.append(value)
v = len([val for val in lang.values() if val != None])
percNum = v / k
perc = f"{percNum:.0%}"
if (perc == "100%" and percNum < 1):
perc = "99%"
langValue = f"{value} ({perc})"
langListWithPercentage.append(langValue)
langDictWithPercentage[key] = langValue
invertedLangDict[langValue] = key
try:
self.language.combobox.insertItems(0, langListWithPercentage)
self.language.combobox.setCurrentIndex(
Expand Down Expand Up @@ -415,7 +412,6 @@ def ww():
self.theme.setStyleSheet(
"QWidget#stBtn{border-bottom-left-radius: 0;border-bottom-right-radius: 0;border-bottom: 0px;}")
self.generalTitle.addWidget(self.theme)
self.theme.restartButton.setText(_("Apply"))

themes = {
_("Light"): "light",
Expand Down Expand Up @@ -447,11 +443,9 @@ def applyTheme():
mode = win32mica.MicaTheme.LIGHT
win32mica.ApplyMica(globals.mainWindow.winId(), mode)
globals.mainWindow.ApplyStyleSheetsAndIcons()
self.theme.restartButton.hide()

self.theme.combobox.currentTextChanged.connect(lambda v: (
setSettingsValue("PreferredTheme", themes[v]), applyTheme()))
self.theme.restartButton.clicked.connect(applyTheme)

def exportSettings():
nonlocal self
Expand Down
16 changes: 8 additions & 8 deletions wingetui/Interface/SoftwareSections.py
Expand Up @@ -290,11 +290,11 @@ def getToolbar(self) -> QToolBar:

toolbar.addSeparator()

self.HelpMenuEntry1 = QAction("Guide for beginners on how to install a package")
self.HelpMenuEntry1 = QAction(_("Guide for beginners on how to install a package"))
self.HelpMenuEntry1.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/install-a-program"))
self.HelpMenuEntry2 = QAction("Discover Packages overview - every feature explained")
self.HelpMenuEntry2 = QAction(_("Discover Packages overview - every feature explained"))
self.HelpMenuEntry2.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/discover-overview"))
self.HelpMenuEntry3 = QAction("WingetUI Help and Documentation")
self.HelpMenuEntry3 = QAction(_("WingetUI Help and Documentation"))
self.HelpMenuEntry3.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help"))

def showHelpMenu():
Expand Down Expand Up @@ -781,15 +781,15 @@ def blacklistSelectedPackages():

toolbar.addSeparator()

self.HelpMenuEntry1 = QAction("How to upgrade a package with WingetUI")
self.HelpMenuEntry1 = QAction(_("How to upgrade a package with WingetUI"))
self.HelpMenuEntry1.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/update-software/"))
self.HelpMenuEntry2 = QAction("How to enable automatic updates")
self.HelpMenuEntry2 = QAction(_("How to enable automatic updates"))
self.HelpMenuEntry2.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/update-software/#enable-updates"))
self.HelpMenuEntry3 = QAction("How to ignore updates for certain packages")
self.HelpMenuEntry3 = QAction(_("How to ignore updates for certain packages"))
self.HelpMenuEntry3.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/update-software/#ignore"))
self.HelpMenuEntry4 = QAction("How to manage ignored updates")
self.HelpMenuEntry4 = QAction(_("How to manage ignored updates"))
self.HelpMenuEntry4.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help/update-software/#manage-ignored"))
self.HelpMenuEntry5 = QAction("WingetUI Help and Documentation")
self.HelpMenuEntry5 = QAction(_("WingetUI Help and Documentation"))
self.HelpMenuEntry5.triggered.connect(lambda: os.startfile("https://marticliment.com/wingetui/help"))

def showHelpMenu():
Expand Down