| 1114 | self.POLDie() |
| 1115 | |
| 1116 | def ClosePol(self, event): |
| 1117 | pids = [] |
| 1118 | for pid in self.registeredPid: |
| 1119 | try: |
| 1120 | os.kill(pid, 0) |
| 1121 | pid_exists = True |
| 1122 | pids.append(pid) |
| 1123 | except OSError: |
| 1124 | pid_exists = False |
| 1125 | print("Registered PID: %d (%s)" % (pid, 'Present' if pid_exists else 'Missing')) |
| 1126 | self.registeredPid = pids |
| 1127 | |
| 1128 | if (playonlinux.GetSettings( |
| 1129 | "DONT_ASK_BEFORE_CLOSING") == "TRUE" or self.registeredPid == [] or wx.YES == wx.MessageBox( |
| 1130 | _('Are you sure you want to close all {0} windows?').format(os.environ["APPLICATION_TITLE"]), os.environ["APPLICATION_TITLE"], style=wx.YES_NO | wx.ICON_QUESTION)): |
| 1131 | self.SizeToSave = self.GetSize() |
| 1132 | self.PositionToSave = self.GetPosition() |
| 1133 | # Save size and position |
| 1134 | playonlinux.SetSettings("MAINWINDOW_WIDTH", str(self.SizeToSave[0])) |
| 1135 | playonlinux.SetSettings("MAINWINDOW_HEIGHT", str(self.SizeToSave[1] - Variables.windows_add_playonmac * 56)) |
| 1136 | playonlinux.SetSettings("MAINWINDOW_X", str(self.PositionToSave[0])) |
| 1137 | playonlinux.SetSettings("MAINWINDOW_Y", str(self.PositionToSave[1])) |
| 1138 | |
| 1139 | self._mgr.Destroy() |
| 1140 | |
| 1141 | self.POLDie() |
| 1142 | return None |
| 1143 | |
| 1144 | def About(self, event): |
| 1145 | self.aboutBox = wx.adv.AboutDialogInfo() |