Forums

Patch ro run PlayOnLinux with wxPython 4.0.4

Auteur Réponses
pixecs Samedi 6 Avril 2019 à 18:14
pixecsAnonymous

Hi all,

On my linux system I have installed only wxPython 4.0.4 & Python 2.7.16 and i wanted to run PlayOnLinux, so I made a small patch.

I still get a segmentation fault when trying to install a new software... but everything else seems to be working so I'm able to run previous installed software.

Forgot to mention, is for PlayOnLinux version 4.3.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
diff -U 3 -H -d -r -N -- a/python/check_python.py b/python/check_python.py
--- a/python/check_python.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/check_python.py    2019-04-06 16:21:22.233579331 +0300
@@ -1,8 +1,8 @@
-import os, wxversion
-print("wxversion(s): " + ", ".join(wxversion.getInstalled()))
+import os
+#print("wxversion(s): " + ", ".join(wxversion.getInstalled()))
  
-if os.environ["POL_OS"] != "Mac":
-    wxversion.ensureMinimal('2.8')
+#if os.environ["POL_OS"] != "Mac":
+#    wxversion.ensureMinimal('2.8')
  
 import wx
 os._exit(0)
diff -U 3 -H -d -r -N -- a/python/configurewindow/ConfigureWindow.py b/python/configurewindow/ConfigureWindow.py
--- a/python/configurewindow/ConfigureWindow.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/configurewindow/ConfigureWindow.py    2019-04-06 16:21:22.234579331 +0300
@@ -75,7 +75,7 @@
         wx.EVT_BUTTON(self, 1002, self.DeletePrefix)
  
  
-        self.list_game.SetSpacing(0)
+        #self.list_game.SetSpacing(0)
         self.list_game.SetImageList(self.images)
  
  
diff -U 3 -H -d -r -N -- a/python/configurewindow/ConfigureWindowNotebook.py b/python/configurewindow/ConfigureWindowNotebook.py
--- a/python/configurewindow/ConfigureWindowNotebook.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/configurewindow/ConfigureWindowNotebook.py    2019-04-06 16:29:04.695566427 +0300
@@ -269,7 +269,7 @@
  
         self.Menu = wx.TreeCtrl(self.panelPackages, 99, pos=(15, 75), size=(530, 260),
                                 style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders)
-        self.Menu.SetSpacing(0);
+        #self.Menu.SetSpacing(0);
         self.Menu.SetImageList(self.imagePackages)
         self.imagePackages.RemoveAll()
  
diff -U 3 -H -d -r -N -- a/python/debug.py b/python/debug.py
--- a/python/debug.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/debug.py    2019-04-06 16:21:22.234579331 +0300
@@ -60,7 +60,7 @@
         wx.EVT_TREE_SEL_CHANGED(self, 900, self.analyseLog)
  
  
-        self.list_game.SetSpacing(0);
+        #self.list_game.SetSpacing(0);
         self.list_game.SetImageList(self.images)
  
  
diff -U 3 -H -d -r -N -- a/python/install/InstallWindow.py b/python/install/InstallWindow.py
--- a/python/install/InstallWindow.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/install/InstallWindow.py    2019-04-06 18:37:45.038351008 +0300
@@ -23,9 +23,9 @@
 import subprocess
  
 import wx
-import wx.animate
+import wx.adv
 import wx.html
-import wx.lib.hyperlink
+import wx.lib.agw.hyperlink
 from wx.lib.ClickableHtmlWindow import PyClickableHtmlWindow
  
 import lib.Variables as Variables
@@ -46,7 +46,7 @@
         self.cats_icons[name] = wx.BitmapButton(self.installWindowHeader, 2000 + iid, wx.Bitmap(icon), (0, 0),
                                                 style=wx.NO_BORDER)
  
-        self.cats_links[name] = wx.lib.hyperlink.HyperLinkCtrl(self.installWindowHeader, 3000 + iid, name, pos=(0, 52))
+        self.cats_links[name] = wx.lib.agw.hyperlink.HyperLinkCtrl(self.installWindowHeader, 3000 + iid, name, pos=(0, 52))
         mataille = self.cats_links[name].GetSize()[0]
  
         mataille2 = self.cats_icons[name].GetSize()[0]
@@ -55,7 +55,7 @@
         self.cats_links[name].SetPosition((espace * iid + (espace - mataille / 1.3) / 2, 47))
         self.cats_icons[name].SetPosition((image_pos, offset))
  
-        wx.lib.hyperlink.EVT_HYPERLINK_LEFT(self, 3000 + iid, self.AddApps)
+        wx.lib.agw.hyperlink.EVT_HYPERLINK_LEFT(self, 3000 + iid, self.AddApps)
         wx.EVT_BUTTON(self, 2000 + iid, self.AddApps)
  
         self.cats_links[name].SetColours(wx.Colour(0, 0, 0), wx.Colour(0, 0, 0), wx.Colour(0, 0, 0))
@@ -116,8 +116,8 @@
         self.installWindowBodySizer.Add(self.panelWait, 1, wx.EXPAND)
         self.panelWait.Hide()
         ## FIXME: Remove those magic numbers
-        self.animation_wait = wx.animate.GIFAnimationCtrl(self.panelWait, -1,
-                                                          Variables.playonlinux_env + "/resources/images/install/wait.gif",
+        self.animation_wait = wx.adv.AnimationCtrl(self.panelWait, -1,
+                                                          wx.adv.Animation(Variables.playonlinux_env + "/resources/images/install/wait.gif"),
                                                           ((800 - 128) / 2, (550 - 128) / 2 - 71))
         self.percentageText = wx.StaticText(self.panelWait, -1, "", ((800 - 30) / 2, (550 - 128) / 2 + 128 + 10 - 71),
                                             wx.DefaultSize)
@@ -184,7 +184,7 @@
         self.appsList = wx.TreeCtrl(self.appNavigationPanel, 106,
                                     style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders)
         self.appsList.SetImageList(self.imagesapps)
-        self.appsList.SetSpacing(0)
+        #self.appsList.SetSpacing(0)
  
         self.appNavigationSizer.AddSpacer(10)
         self.appNavigationSizer.Add(self.appsList, 4, wx.EXPAND, 5)
@@ -202,7 +202,7 @@
  
         self.descriptionLoaderPanel = wx.Panel(appDescriptionPanel, -1, style=Variables.widget_borders)
         self.descriptionLoaderPanel.SetBackgroundColour((255, 255, 255))
-        self.animation = wx.animate.GIFAnimationCtrl(self.descriptionLoaderPanel, -1, Variables.playonlinux_env + "/resources/images/install/wait_mini.gif", (90, 100))
+        self.animation = wx.adv.AnimationCtrl(self.descriptionLoaderPanel, -1, wx.adv.Animation(Variables.playonlinux_env + "/resources/images/install/wait_mini.gif"), (90, 100))
         self.animation.Hide()
         self.descriptionLoaderPanel.Hide()
  
@@ -227,7 +227,7 @@
         self.cancelButton = wx.Button(buttonsPanel, wx.ID_CLOSE, _("Cancel"))
         self.installButton = wx.Button(buttonsPanel, wx.ID_APPLY, _("Install"))
         self.updateButton = wx.Button(buttonsPanel, wx.ID_REFRESH, _("Refresh"))
-        self.manualInstall = wx.lib.hyperlink.HyperLinkCtrl(buttonsPanel, 111, _("Install a non-listed program"))
+        self.manualInstall = wx.lib.agw.hyperlink.HyperLinkCtrl(buttonsPanel, 111, _("Install a non-listed program"))
         self.manualInstall.SetColours(wx.Colour(0, 0, 0), wx.Colour(0, 0, 0), wx.Colour(0, 0, 0))
         self.manualInstall.AutoBrowse(False)
         self.manualInstall.UpdateLink(True)
@@ -284,7 +284,7 @@
         wx.EVT_CLOSE(self, self.closeapp)
         wx.EVT_TREE_ITEM_ACTIVATED(self, 106, self.installapp)
         wx.EVT_TEXT(self, 110, self.search)
-        wx.lib.hyperlink.EVT_HYPERLINK_LEFT(self, 111, self.manual)
+        wx.lib.agw.hyperlink.EVT_HYPERLINK_LEFT(self, 111, self.manual)
  
         wx.EVT_CHECKBOX(self, 401, self.CheckBoxReload)
         wx.EVT_CHECKBOX(self, 402, self.CheckBoxReload)
diff -U 3 -H -d -r -N -- a/python/lib/lng.py b/python/lib/lng.py
--- a/python/lib/lng.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/lib/lng.py    2019-04-06 16:21:22.235579331 +0300
@@ -2,7 +2,7 @@
 # -*- coding: utf-8 -*-
  
 import wx
-import wxversion
+#import wxversion
 import gettext, Variables as Variables, os
 import locale, string
  
diff -U 3 -H -d -r -N -- a/python/mainwindow.py b/python/mainwindow.py
--- a/python/mainwindow.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/mainwindow.py    2019-04-06 18:17:33.169384822 +0300
@@ -35,13 +35,13 @@
     print "ERROR ! Please define POL_OS environment var first."
     os._exit(1)
  
-if (os.environ["POL_OS"] != "Mac"):
-    import wxversion
+#if (os.environ["POL_OS"] != "Mac"):
+#    import wxversion
  
-    wxversion.ensureMinimal('2.8')
+#    wxversion.ensureMinimal('2.8')
  
-import wx, wx.aui
-import wx.lib.hyperlink
+import wx, wx.aui, wx.adv
+import wx.lib.agw.hyperlink
 import lib.lng as lng
 import lib.playonlinux as playonlinux, lib.Variables as Variables
 import options, threading, debug
@@ -246,7 +246,7 @@
  
         ## List game
         self.list_game = wx.TreeCtrl(self, 105, style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT)
-        self.list_game.SetSpacing(0)
+        #self.list_game.SetSpacing(0)
         self.list_game.SetIndent(5)
         self.list_game.SetImageList(self.images)
         self.menu_gauche = wx.Panel(self, -1)
@@ -571,7 +571,7 @@
                 self.sb.Hide()
                 self.installFrame.setWaitState(False)
                 self.installFrame.Refresh()
-        except wx._core.PyDeadObjectError:
+        except RuntimeError:
             pass
         except AttributeError:  # FIXME: Install Frame is not opened
             pass
@@ -867,11 +867,11 @@
             pass
  
         if (url == None):
-            self.menuElem[id] = wx.lib.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
+            self.menuElem[id] = wx.lib.agw.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
                                                                pos=(35, 15 + pos * 20))
             self.menuElem[id].AutoBrowse(False)
         else:
-            self.menuElem[id] = wx.lib.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
+            self.menuElem[id] = wx.lib.agw.hyperlink.HyperLinkCtrl(self.menu_gauche, 10000 + pos, text,
                                                                pos=(35, 15 + pos * 20))
             self.menuElem[id].setURL(url)
  
@@ -883,7 +883,7 @@
         # self.menuElem[id].SetHoverColour(wx.Colour(100,100,100))
  
         if (evt != None):
-            wx.lib.hyperlink.EVT_HYPERLINK_LEFT(self, 10000 + pos, evt)
+            wx.lib.agw.hyperlink.EVT_HYPERLINK_LEFT(self, 10000 + pos, evt)
  
     def donate(self, event):
         if (os.environ["POL_OS"] == "Mac"):
@@ -1149,7 +1149,7 @@
         return None
  
     def About(self, event):
-        self.aboutBox = wx.AboutDialogInfo()
+        self.aboutBox = wx.adv.AboutDialogInfo()
         if (os.environ["POL_OS"] != "Mac"):
             self.aboutBox.SetIcon(wx.Icon(Variables.playonlinux_env + "/etc/playonlinux.png", wx.BITMAP_TYPE_ANY))
  
@@ -1170,7 +1170,7 @@
             self.aboutBox.SetWebSite("http://www.playonmac.com")
         else:
             self.aboutBox.SetWebSite("http://www.playonmac.com")
-        wx.AboutBox(self.aboutBox)
+        wx.adv.AboutBox(self.aboutBox)
  
  
 class PlayOnLinuxApp(wx.App):
@@ -1399,7 +1399,7 @@
 setSigchldHandler()
 lng.Lang()
  
-wx.Log_EnableLogging(False)
+wx.Log.EnableLogging(True)
  
 app = PlayOnLinuxApp(redirect=False)
 app.MainLoop()
diff -U 3 -H -d -r -N -- a/python/options.py b/python/options.py
--- a/python/options.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/options.py    2019-04-06 16:28:35.425567243 +0300
@@ -19,7 +19,7 @@
 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  
 from asyncore import dispatcher
-import wxversion, os, subprocess, getopt, sys, urllib, signal, socket, string
+import os, subprocess, getopt, sys, urllib, signal, socket, string
 import wx, time, re
 import webbrowser, shutil
 import threading, time, codecs
@@ -187,7 +187,7 @@
         self.txtPlugin = wx.StaticText(self.panelPlugins, -1, _("Installed plugins"), size=wx.DefaultSize)
         self.txtPlugin.SetFont(self.fontTitle)
         self.pluginlist = wx.TreeCtrl(self.panelPlugins, 220, style=Variables.widget_borders|wx.TR_HIDE_ROOT|wx.TR_FULL_ROW_HIGHLIGHT)
-        self.pluginlist.SetSpacing(0)
+        #self.pluginlist.SetSpacing(0)
  
         self.pluginImgList = wx.ImageList(16,16)
  
diff -U 3 -H -d -r -N -- a/python/setupwindow/POL_SetupFrame.py b/python/setupwindow/POL_SetupFrame.py
--- a/python/setupwindow/POL_SetupFrame.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/setupwindow/POL_SetupFrame.py    2019-04-06 17:15:05.081489404 +0300
@@ -27,7 +27,7 @@
 import urllib
 import urlparse
 import wx
-import wx.animate
+import wx.adv
  
 import lib.Variables as Variables
 import lib.lng
@@ -213,14 +213,14 @@
                                      style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders,
                                      pos=(25, 25), size=(460, 220))
         self.MenuGames.SetImageList(self.images)
-        self.MenuGames.SetSpacing(0)
+        #self.MenuGames.SetSpacing(0)
  
         # Login
         self.login = wx.StaticText(self.contentPanel, -1, _("Login: "), pos=(20, 40), size=(460, 20))
         self.password = wx.StaticText(self.contentPanel, -1, _("Password: "), pos=(20, 70), size=(460, 20))
         self.loginbox = wx.TextCtrl(self.contentPanel, -1, "", size=(250, 22), pos=(200, 35))
         self.passbox = wx.TextCtrl(self.contentPanel, -1, "", size=(250, 22), pos=(200, 65), style=wx.TE_PASSWORD)
-        self.register = wx.HyperlinkCtrl(self.contentPanel, 303, _("Register"), "", pos=(20, 100))
+        self.register =  wx.adv.HyperlinkCtrl(self.contentPanel, 303, _("Register"), "", pos=(20, 100))
         self.register.SetNormalColour(wx.Colour(0, 0, 0))
  
         # Fixed Events
@@ -230,7 +230,7 @@
         wx.EVT_BUTTON(self, 103, self.Parcourir)
         wx.EVT_CHECKBOX(self, 302, self.agree)
         wx.EVT_CHECKBOX(self, 304, self.switch_menu)
-        wx.EVT_HYPERLINK(self, 303, self.POL_register)
+        wx.adv.EVT_HYPERLINK(self, 303, self.POL_register)
  
         # Debug Window
         self.debugImage = wx.StaticBitmap(self.contentPanel, -1, wx.Bitmap(
diff -U 3 -H -d -r -N -- a/python/wine_versions/WineVersionsNotebook.py b/python/wine_versions/WineVersionsNotebook.py
--- a/python/wine_versions/WineVersionsNotebook.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/wine_versions/WineVersionsNotebook.py    2019-04-06 16:29:40.121565438 +0300
@@ -39,7 +39,7 @@
         self.installedWineVersionsTreeSelector[arch] = wx.TreeCtrl(installedWineVersionsPanel, 107 + self.calculateEventDelta(arch),
                                                                    style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders)
         self.installedWineVersionsTreeSelector[arch].SetImageList(self.imagesapps_i[arch])
-        self.installedWineVersionsTreeSelector[arch].SetSpacing(0)
+        #self.installedWineVersionsTreeSelector[arch].SetSpacing(0)
         installedWineVersionsSizer.Add(self.installedWineVersionsTreeSelector[arch], 1, wx.EXPAND)
         installedWineVersionsSizer.AddSpacer(10)
  
@@ -55,7 +55,7 @@
                                                                    style=wx.TR_HIDE_ROOT | wx.TR_FULL_ROW_HIGHLIGHT | Variables.widget_borders,
                                                                    size=(320, 300), pos=(10, 35))
         self.availableWineVersionsTreeSelector[arch].SetImageList(self.imagesapps[arch])
-        self.availableWineVersionsTreeSelector[arch].SetSpacing(0)
+        #self.availableWineVersionsTreeSelector[arch].SetSpacing(0)
         availableWineVersionsSizer.Add(self.availableWineVersionsTreeSelector[arch], 1, wx.EXPAND)
         availableWineVersionsSizer.AddSpacer(10)
  
diff -U 3 -H -d -r -N -- a/python/wine_versions/WineVersionsWindow.py b/python/wine_versions/WineVersionsWindow.py
--- a/python/wine_versions/WineVersionsWindow.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/wine_versions/WineVersionsWindow.py    2019-04-06 16:21:22.236579331 +0300
@@ -23,7 +23,7 @@
 import subprocess
  
 import wx
-import wx.animate
+import wx.adv
  
 import lib.Variables as Variables
 import lib.lng
diff -U 3 -H -d -r -N -- a/python/wrapper.py b/python/wrapper.py
--- a/python/wrapper.py    2018-12-24 22:22:56.000000000 +0200
+++ b/python/wrapper.py    2019-04-06 16:21:22.237579331 +0300
@@ -28,9 +28,9 @@
     print "ERROR ! Please define POL_OS environment var first."
     os._exit(1)
  
-if(os.environ["POL_OS"] == "Linux"):
-    import wxversion
-    wxversion.ensureMinimal('2.8')
+#if(os.environ["POL_OS"] == "Linux"):
+#    import wxversion
+#    wxversion.ensureMinimal('2.8')
  
 import wx
 import lib.lng as lng

 

 

 

 

Edité par pixecs

Quentin PÂRIS Dimanche 7 Avril 2019 à 14:46
Quentin PÂRISAnonymous

Cool! Thanks!

Can we make a merge request on github?

This site allows content generated by members, and we promptly remove any content that infringes copyright according to our Terms of Service. To report copyright infringement, please send a notice to dmca@playonlinux.com