Various compilation scripts & patches for Linux programs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
2.7 KiB

7 years ago
  1. --- a/python/wine_versions.py
  2. +++ b/python/wine_versions.py
  3. @@ -356,6 +356,18 @@
  4. if(arch == "amd64"):
  5. self.download64.thread_message = "get"
  6. + def checkVersionUse(self, arch): # Check the wine version use by wineprefix
  7. + used_versions = []
  8. + file_to_check = os.listdir(Variables.playonlinux_rep+"/wineprefix/") # List of wineprefix
  9. + file_to_check.remove('default') # Remove 'default' (no wine version use by it)
  10. + for i in range(len(file_to_check)):
  11. + tmp = open(Variables.playonlinux_rep+"/wineprefix/"+file_to_check[i]+"/playonlinux.cfg","r")
  12. + if "ARCH="+arch in tmp.readline(): # Check if the wineprefix use a wine arch equal to 'arch'
  13. + line = tmp.readline().split("\n")[0] # Remove the '\n'
  14. + if "VERSION=" in line and line.split("=")[1] not in used_versions: # Fix wine system problem (no VERSION= if system is used)
  15. + used_versions.append(line.split("=")[1]) # Keep de wine version only
  16. + tmp.close()
  17. + return(used_versions)
  18. def WriteVersion(self, arch="x86"):
  19. self.onglets.imagesapps[arch].RemoveAll()
  20. @@ -378,6 +390,8 @@
  21. root2 = self.onglets.list_ver_installed[arch].AddRoot("")
  22. wfolder = os_pref+"-"+arch
  23. +
  24. + used_version = self.checkVersionUse(arch) # Get the list of wine version used by wineprefix
  25. installed_versions = os.listdir(Variables.playonlinux_rep+"/wine/"+wfolder)
  26. installed_versions.sort(key=keynat)
  27. @@ -386,11 +400,14 @@
  28. self.j = 0
  29. while(self.i < len(installed_versions)):
  30. if(os.path.isdir(Variables.playonlinux_rep+"/wine/"+wfolder+"/"+installed_versions[self.i])):
  31. + itemId = self.onglets.list_ver_installed[arch].AppendItem(root2,installed_versions[self.i],self.j)
  32. if(len(os.listdir(Variables.playonlinux_rep+"/wine/"+wfolder+"/"+installed_versions[self.i])) == 0):
  33. self.onglets.imagesapps_i[arch].Add(wx.Bitmap(Variables.playonlinux_env+"/etc/install/wine-warning.png"))
  34. + elif installed_versions[self.i] not in used_version: # Clearly shows the unused wine version
  35. + self.onglets.imagesapps_i[arch].Add(wx.Bitmap(Variables.playonlinux_env+"/etc/install/wine-unused.png"))
  36. + self.onglets.list_ver_installed[arch].SetItemTextColour(itemId, (191,191,191))
  37. else:
  38. self.onglets.imagesapps_i[arch].Add(wx.Bitmap(Variables.playonlinux_env+"/etc/install/wine.png"))
  39. - self.onglets.list_ver_installed[arch].AppendItem(root2,installed_versions[self.i],self.j)
  40. self.j += 1
  41. self.i += 1
  42. try :