Rework more windows to rely on auxiliary frame

This commit is contained in:
DarkPhoenix
2019-08-12 14:41:41 +03:00
parent 4f2e1be9ac
commit bcdefdc4ac
11 changed files with 24 additions and 25 deletions

View File

@@ -50,8 +50,7 @@ DroneSplitStack.register()
class DroneStackSplit(wx.Dialog):
def __init__(self, parent, value):
wx.Dialog.__init__(self, parent, title="Split Drone Stack")
super().__init__(parent, title="Split Drone Stack", style=wx.DEFAULT_DIALOG_STYLE)
self.SetMinSize((346, 156))
bSizer1 = wx.BoxSizer(wx.VERTICAL)

View File

@@ -88,7 +88,7 @@ ChangeItemAmount.register()
class AmountChanger(wx.Dialog):
def __init__(self, parent, value, limits=None):
wx.Dialog.__init__(self, parent, title="Change Amount")
super().__init__(parent, title="Change Amount", style=wx.DEFAULT_DIALOG_STYLE)
self.SetMinSize((346, 156))
bSizer1 = wx.BoxSizer(wx.VERTICAL)

View File

@@ -890,7 +890,7 @@ class APIView(wx.Panel):
class SecStatusDialog(wx.Dialog):
def __init__(self, parent, sec):
wx.Dialog.__init__(self, parent, title="Set Security Status", size=(300, 175))
super().__init__(parent, title="Set Security Status", size=(300, 175), style=wx.DEFAULT_DIALOG_STYLE)
self.SetSizeHints(wx.DefaultSize, wx.DefaultSize)

View File

@@ -42,8 +42,7 @@ class CopySelectDialog(wx.Dialog):
copyFormatEfs = 5
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1),
style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(parent, id=wx.ID_ANY, title="Select a format", size=(-1, -1), style=wx.DEFAULT_DIALOG_STYLE)
self.CopySelectDict = {
CopySelectDialog.copyFormatEft : self.exportEft,

View File

@@ -298,11 +298,12 @@ class ExportToEve(AuxiliaryFrame):
pyfalog.error(ex)
class SsoCharacterMgmt(wx.Dialog):
class SsoCharacterMgmt(AuxiliaryFrame):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="SSO Character Management", pos=wx.DefaultPosition,
size=wx.Size(550, 250), style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(
parent, id=wx.ID_ANY, title="SSO Character Management", pos=wx.DefaultPosition,
size=wx.Size(550, 250), style=wx.RESIZE_BORDER)
self.mainFrame = parent
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
@@ -334,6 +335,7 @@ class SsoCharacterMgmt(wx.Dialog):
self.SetSizer(mainSizer)
self.Layout()
self.SetMinSize(self.GetSize())
self.Centre(wx.BOTH)
@@ -351,7 +353,7 @@ class SsoCharacterMgmt(wx.Dialog):
def OnClose(self, event):
self.mainFrame.Unbind(GE.EVT_SSO_LOGIN, handler=self.ssoLogin)
self.Destroy()
event.Skip()
def popCharList(self):
sEsi = Esi.getInstance()

View File

@@ -14,7 +14,7 @@ def fitSorter(fit):
class FitBrowserLiteDialog(wx.Dialog):
def __init__(self, parent, title='Add Fits', excludedFitIDs=()):
wx.Dialog.__init__(self, parent, title=title, style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(parent, title=title, style=wx.DEFAULT_DIALOG_STYLE)
listWidth = 250 if 'wxGTK' in wx.PlatformInfo else 200

View File

@@ -601,8 +601,7 @@ class MainFrame(wx.Frame):
self.command.Submit(cmd.GuiToggleFittingRestrictionsCommand(fitID=fitID))
def eveFittings(self, event):
dlg = EveFittings(self)
dlg.Show()
EveFittings.openOne(parent=self)
def onSSOLogin(self, event):
menu = self.GetMenuBar()
@@ -619,12 +618,10 @@ class MainFrame(wx.Frame):
menu.Enable(menu.exportToEveId, not enable)
def ssoHandler(self, event):
dlg = SsoCharacterMgmt(self)
dlg.Show()
SsoCharacterMgmt.openOne(parent=self)
def exportToEve(self, event):
dlg = ExportToEve(self)
dlg.Show()
ExportToEve.openOne(parent=self)
def toggleOverrides(self, event):
ModifiedAttributeDict.overrides_enabled = not ModifiedAttributeDict.overrides_enabled

View File

@@ -26,7 +26,7 @@ from gui.bitmap_loader import BitmapLoader
class PreferenceDialog(wx.Dialog):
def __init__(self, parent):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(parent, id=wx.ID_ANY, size=wx.DefaultSize, style=wx.DEFAULT_DIALOG_STYLE)
self.SetTitle("pyfa - Preferences")
i = wx.Icon(BitmapLoader.getBitmap("preferences_small", "gui"))
self.SetIcon(i)

View File

@@ -9,11 +9,13 @@ class SsoLogin(wx.Dialog):
def __init__(self):
mainFrame = gui.mainFrame.MainFrame.getInstance()
wx.Dialog.__init__(self, mainFrame, id=wx.ID_ANY, title="SSO Login", size=wx.Size(400, 240))
super().__init__(
mainFrame, id=wx.ID_ANY, title="SSO Login", style=wx.DEFAULT_DIALOG_STYLE,
size=wx.Size(450, 240) if "wxGTK" in wx.PlatformInfo else wx.Size(400, 240))
bSizer1 = wx.BoxSizer(wx.VERTICAL)
text = wx.StaticText(self, wx.ID_ANY, "Copy and paste the block of text provided by pyfa.io, then click OK")
text = wx.StaticText(self, wx.ID_ANY, "Copy and paste the block of text provided by pyfa.io")
bSizer1.Add(text, 0, wx.ALL | wx.EXPAND, 10)
self.ssoInfoCtrl = wx.TextCtrl(self, wx.ID_ANY, wx.EmptyString, wx.DefaultPosition, (-1, -1), style=wx.TE_MULTILINE)
@@ -47,7 +49,7 @@ class SsoLogin(wx.Dialog):
class SsoLoginServer(wx.Dialog):
def __init__(self, port):
mainFrame = gui.mainFrame.MainFrame.getInstance()
wx.Dialog.__init__(self, mainFrame, id=wx.ID_ANY, title="SSO Login", size=(-1, -1))
super().__init__(mainFrame, id=wx.ID_ANY, title="SSO Login", size=(-1, -1), style=wx.DEFAULT_DIALOG_STYLE)
from service.esi import Esi

View File

@@ -48,8 +48,9 @@ hr {{ border: #000 1px solid; }}
class UpdateDialog(wx.Dialog):
def __init__(self, parent, release, version):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title="pyfa Update Available", pos=wx.DefaultPosition,
size=wx.Size(550, 450), style=wx.DEFAULT_DIALOG_STYLE)
super().__init__(
parent, id=wx.ID_ANY, title="pyfa Update Available", pos=wx.DefaultPosition,
size=wx.Size(550, 450), style=wx.DEFAULT_DIALOG_STYLE)
self.UpdateSettings = svc_UpdateSettings.getInstance()
self.releaseInfo = release

View File

@@ -91,8 +91,7 @@ class LoadAnimation(wx.Window):
class WaitDialog(wx.Dialog):
def __init__(self, parent, title="Processing"):
wx.Dialog.__init__(self, parent, id=wx.ID_ANY, title=title, size=(300, 30),
style=wx.NO_BORDER)
super().__init__(parent, id=wx.ID_ANY, title=title, size=(300, 30), style=wx.NO_BORDER)
mainSizer = wx.BoxSizer(wx.HORIZONTAL)
self.progress = LoadAnimation(self, label=title, size=(300, 30))