MCPcopy Create free account
hub / github.com/PlayOnLinux/POL-POM-4 / Reload

Method Reload

python/mainwindow.py:888–928  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

886 webbrowser.open("http://www.playonlinux.com/en/donate.html")
887
888 def Reload(self, event):
889 self.games = os.listdir(Variables.playonlinux_rep + "shortcuts/")
890 self.games.sort(key=str.upper)
891
892 try:
893 self.games.remove(".DS_Store")
894 except:
895 pass
896
897 self.list_game.DeleteAllItems()
898 self.images.RemoveAll()
899 root = self.list_game.AddRoot("")
900 self.i = 0
901 if (self.iconSize <= 32):
902 self.iconFolder = "32"
903 else:
904 self.iconFolder = "full_size"
905 for game in self.games: # METTRE EN 32x32
906 if (self.searchbox.GetValue().lower() in game.lower()):
907 if (not os.path.isdir(Variables.playonlinux_rep + "/shortcuts/" + game)):
908 if (os.path.exists(Variables.playonlinux_rep + "/icones/" + self.iconFolder + "/" + game)):
909 file_icone = Variables.playonlinux_rep + "/icones/" + self.iconFolder + "/" + game
910 else:
911 file_icone = Variables.playonlinux_env + "/etc/playonlinux.png"
912
913 try:
914 self.bitmap = wx.Image(file_icone)
915 self.bitmap.Rescale(self.iconSize, self.iconSize, wx.IMAGE_QUALITY_HIGH)
916 self.bitmap = self.bitmap.ConvertToBitmap()
917 self.images.Add(self.bitmap)
918 except:
919 pass
920
921 item = self.list_game.AppendItem(root, game, self.i)
922 self.i += 1
923 self.generate_menu(None)
924
925 if (os.environ["POL_OS"] == "Mac"):
926 self.playTool.Enable(False)
927 self.stopTool.Enable(False)
928 self.removeTool.Enable(False)
929
930 def RConfigure(self, function_to_run, *args):
931 """Starts polconfigurator remotely."""

Callers 3

__init__Method · 0.95
TimerActionMethod · 0.95
iconDisplayMethod · 0.95

Calls 1

generate_menuMethod · 0.95

Tested by

no test coverage detected