From 4fdd3f177a23bafe84d6a58fea391ff51986d892 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Tue, 25 Feb 2014 23:54:27 -0500 Subject: [PATCH 01/10] Applying appropriate icons --- gui/aboutData.py | 2 +- .../pyfaGlobalPreferences.py | 6 +++--- .../pyfaHTMLExportPreferences.py | 20 +++++++++--------- gui/preferenceDialog.py | 8 ++++--- icons/prefs_html.png | Bin 0 -> 1825 bytes icons/prefs_settings.png | Bin 0 -> 2315 bytes 6 files changed, 19 insertions(+), 17 deletions(-) create mode 100644 icons/prefs_html.png create mode 100644 icons/prefs_settings.png diff --git a/gui/aboutData.py b/gui/aboutData.py index 5af49e734..0d1b029b5 100644 --- a/gui/aboutData.py +++ b/gui/aboutData.py @@ -23,4 +23,4 @@ license = "pyfa is released under GNU GPLv3" licenseLocation = "gpl.txt" developers = ("\n cncfanatics \t(Sakari Orisi)\n" , " DarkPhoenix \t(Kadesh Priestess)\n", " Darriele \t(Darriele)") credits = (("Entity (Entity) \t\tCapacitor calculations / EVEAPI python lib / Reverence"), ("Aurora \t\tMaths"), ("Corollax (Aamrr) \tVarious EOS/pyfa improvements")) -description = "Pyfa (the Python Fitting Assistant) is a standalone application able to create and simulate fittings for EVE-Online SciFi MMORPG with a very high degree of accuracy.\nPyfa can be virtually ran on all platforms where python and wxwidgets are supported.\n\n\nAll EVE-Online related materials are property of CCP hf.\n\nSilk Icons Set by famfamfam.com released under Creative Commons Attribution 2.5 License" +description = "Pyfa (the Python Fitting Assistant) is a standalone application able to create and simulate fittings for EVE-Online SciFi MMORPG with a very high degree of accuracy.\nPyfa can be virtually ran on all platforms where python and wxwidgets are supported.\n\n\nAll EVE-Online related materials are property of CCP hf.\n\nSilk Icons Set by famfamfam.com released under Creative Commons Attribution 2.5 License\n\nFat Cow Icons by fatcow.com released under Creative Commons Attribution 3.0 License" diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index e40b87f91..a70ba2777 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -11,7 +11,7 @@ import gui.globalEvents as GE class PFGlobalPref ( PreferenceView): - title = "Pyfa Global Options" + title = "Global Options" def populatePanel( self, panel ): @@ -243,7 +243,7 @@ class PFGlobalPref ( PreferenceView): self.sFit.refreshFit(fitID) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) event.Skip() - + def OnCBGlobalForceReloadStateChange(self, event): self.sFit.serviceFittingOptions["useGlobalForceReload"] = self.cbGlobalForceReload.GetValue() fitID = self.mainFrame.getActiveFit() @@ -260,6 +260,6 @@ class PFGlobalPref ( PreferenceView): event.Skip() def getImage(self): - return bitmapLoader.getBitmap("pyfa64", "icons") + return bitmapLoader.getBitmap("prefs_settings", "icons") PFGlobalPref.register() \ No newline at end of file diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 1e9a50bbd..4a68a25a5 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -12,10 +12,10 @@ import gui.globalEvents as GE class PFHTMLExportPref ( PreferenceView): - title = "Pyfa HTML Export Options" + title = "HTML Export" desc = """Turning this feature on will create a HTML file at the specified location -with all your fits in it. If you browse to this HTML file from the -in-game browser you can easily view and import your fits by clicking on them. +with all your fits in it. If you browse to this HTML file from the +in-game browser you can easily view and import your fits by clicking on them. The file will be updated every time a fit changes or gets added. """ @@ -30,23 +30,23 @@ The file will be updated every time a fit changes or gets added. self.stTitle.Wrap( -1 ) self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) - + self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) - + self.exportEnabled = wx.CheckBox( panel, wx.ID_ANY, u"Enable HTML export", wx.DefaultPosition, wx.DefaultSize, 0 ) self.exportEnabled.SetValue(self.HTMLExportSettings.getEnabled()) self.exportEnabled.Bind(wx.EVT_CHECKBOX, self.OnExportEnabledChange) mainSizer.Add( self.exportEnabled, 0, wx.ALL|wx.EXPAND, 5 ) self.PathLinkCtrl = wx.HyperlinkCtrl( panel, wx.ID_ANY, str(self.HTMLExportSettings.getPath()), 'file:///' + str(self.HTMLExportSettings.getPath()), wx.DefaultPosition, wx.DefaultSize, wx.HL_ALIGN_LEFT|wx.NO_BORDER|wx.HL_CONTEXTMENU ) - mainSizer.Add( self.PathLinkCtrl, 0, wx.ALL|wx.EXPAND, 5) + mainSizer.Add( self.PathLinkCtrl, 0, wx.ALL|wx.EXPAND, 5) self.fileSelectDialog = wx.FileDialog(None, "Save Fitting As...", wildcard = "EVE IGB HTML fitting file (*.html)|*.html", style = wx.FD_SAVE) self.fileSelectDialog.SetPath(self.HTMLExportSettings.getPath()) self.fileSelectDialog.SetFilename(os.path.basename(self.HTMLExportSettings.getPath())); - - self.fileSelectButton = wx.Button(panel, -1, "Set export destination", pos=(0,0)) + + self.fileSelectButton = wx.Button(panel, -1, "Set export destination", pos=(0,0)) self.fileSelectButton.Bind(wx.EVT_BUTTON, self.selectHTMLExportFilePath) mainSizer.Add( self.fileSelectButton, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) @@ -55,7 +55,7 @@ The file will be updated every time a fit changes or gets added. def setPathLinkCtrlValues(self, path): self.PathLinkCtrl.SetLabel(self.HTMLExportSettings.getPath()) - self.PathLinkCtrl.SetURL('file:///' + self.HTMLExportSettings.getPath()) + self.PathLinkCtrl.SetURL('file:///' + self.HTMLExportSettings.getPath()) self.PathLinkCtrl.SetSize(wx.DefaultSize); self.PathLinkCtrl.Refresh() @@ -69,6 +69,6 @@ The file will be updated every time a fit changes or gets added. self.HTMLExportSettings.setEnabled(self.exportEnabled.GetValue()) def getImage(self): - return bitmapLoader.getBitmap("pyfa64", "icons") + return bitmapLoader.getBitmap("prefs_html", "icons") PFHTMLExportPref.register() \ No newline at end of file diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index 8127ad77f..c9b10c636 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -31,10 +31,12 @@ class PreferenceDialog(wx.Dialog): mainSizer = wx.BoxSizer(wx.VERTICAL) self.listbook = wx.Listbook(self, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LB_DEFAULT) - self.listbook.GetListView().SetMinSize((500, -1)) - self.listbook.GetListView().SetSize((500, -1)) - self.imageList = wx.ImageList(64,64) + self.listview = self.listbook.GetListView() + self.listview.SetMinSize((500, -1)) + self.listview.SetSize((500, -1)) + + self.imageList = wx.ImageList(32,32) self.listbook.SetImageList(self.imageList) mainSizer.Add(self.listbook, 1, wx.EXPAND | wx.TOP|wx.BOTTOM|wx.LEFT, 5) diff --git a/icons/prefs_html.png b/icons/prefs_html.png new file mode 100644 index 0000000000000000000000000000000000000000..d86548cd5241066299ab0c6cd2f26a4f4b800acb GIT binary patch literal 1825 zcmV++2j2LJP)F8i5d=XlFE2kx z&-uEp<53Ff0O=?%E-qe7O|7pn*1Ei6Hc~4pDvbZCG&MCD`}XZCBfU~G08Hc_eRgZ- zzn{MVK@=g-XRyU!ADaKd^HZ>Q?_MlhwhTo@Ma2Z-$dV;X<|bo8?8%%}QB)PGqCi!L zAT*xM<4Os<&*z87GiJ;fNlsq>APBinT4*;S_W`p_6@}UkMZ~VNetdq`hkJhV7eQp(#fUT+%O^Qe z;&t=!<8pIBw&zSRM`OOle1ghjBu)}vzW~^7MUzhUt4IQ3v|hoU>kv~fVb}YIk?Xk$ zU&w~qz-81nrr?L;8&UDC7nSe1F(p5rOOnu22WCJ@08nWAE>*Rx$xP-Ttp%nxEHQQSUif<^!3Qenv8JNgQ{Dlc-319&Hfv{{38gbYJ)0MWJofX zWF?6YNMv_`KmayX!j97oSWq+-Db#Kbr$Ck3U~{cSu(K0^=pEc?eFL>k^AU*!F=y&7 z>^$nlD(^5v1%sPTx3b<~8IVl|BvGctWHk69$aJTop#!+nuA(jCN4r)_&lrVf4C6_w+q=ooA&Qz98vQTQTn+66PG%GeMk4PImI2ENxg#<$BuswlO;k2&xalV#Z3P69 zfKqtgX2^ zgsR({AkwC;-d#nRun~6UJObe~bVTjw40T{khRRj5`Ee7-|AGN#2DU}|zB4@wN6&iD zNqmQ*A>3`9fNzesP#zeL*5K1vJUt&P=O|b)GXrfce!Mkp6hB(nd`s7$09dxN(yvIF zPNS|(^Kvmtjo?b{Ed;uv1SE(+2sm}E1a9XAo)C2cdho;sj88MLZgvi02KanSSFbz3 zfDEuyOhy(+46YqGzt)R%Er9APf1}wKARu9cA^{w#-iFE=FFxG!6M`*EQMD!?s!b+9 zBA?InFnxoH0?|zVD)TTHJ+C+rC>k!TpN+3i-^A7<*HP0N;*p~13K}!Eqoi;YHoTl2 zKhzDKB0zfRq!)z&065k72tiD4vlRuSx%7W0V`2Pox1~QRfNhm7?C-dYD^+#oK__q` zdS)`##rj37(Zhdq1HG8DZdB~Q@sqQ0{i3UX0Jr=S(gZiIb+z!bpCzIgO%6wOez33w zm@?5!QjAiOepHDayP#ZPaIow@)>dQzvJju+kS5E)sxxtuvN=_rp@-4)R9z6SP08f_KVE6W zf(aSWOr~^t8miQ9rX))c P00000NkvXXu0mjf#%4;^ literal 0 HcmV?d00001 diff --git a/icons/prefs_settings.png b/icons/prefs_settings.png new file mode 100644 index 0000000000000000000000000000000000000000..2a1e72744479f7980973cc388a14300bb0a4bef4 GIT binary patch literal 2315 zcmV+m3H0`fP)Ran$O@M`*`EZE8B1X%mg1D)>ymAr_M{CaIk`W%965Q81mxv`xZe zQKX=gqVirrfqgH#?C#z7tLMMDo2-b)w7oNDcK6=@{@-_A-}#pZQ@plq-w~OZka$8Q z5)~&TB#4q{B*C<4(}1RFkl(upJw3g$lYe+~B`)0EEC!8613Vr+ z@Oo?Q4#xpp*N^M`WMAGCu;~M3hyExK2zE&~Zh-l@Il!YRP$-qq+WIg2R6$=~U*mhH zPwl|9hVtWY_9Z1GCM;XN6vT0H;P?9xoCi*)6Z-q_!PoT-pim5Fo_YVhK0<>3B=CI) z%4+iS@(_DH3v6YqP~X@DvgT&!>g=p!7|U?8tf>Xpy5Fd%?3*`tZbD(<66m;n7p`A# z1&jo1@zdiWH#-ZGlat_svw!Zv^&&LqWCZB_r3Y*B3-Y9!q#I#$)Bpyf5gHJ@x3^dS zR@I3uxJHL&Mq~Dt?0(Ei527iwbg!!*?`v zVoe6N1c>)Sp&-~}?L?s-AAwLFkK(`w5!{5;>j0<2 z33~k~7T$H(^qiDzzK*O7evuI1(|oqAz6IyAHSnZHqsA3ob$;FgP^#20Hf9F9!vzk9 z1MGwZwvk4wgRklvSun1Ozq`C1muhfu0OGOl1p+>jK;zTk_xUCzKo9~4v`FApIF%;&G0||ZrHPSCA6s+XdhBRidzM*X82%8qlf0}EsDs<$QZ1Y&}m^|=!}I0!=i5a;7@1v z;nxRT8@qU1D@LKEAc?nU&(0`JPELl7jt)3fw*P6oujfRBlyuD2&6|()F50!`x6dwv zyE;3l83(xi6x_Tw2h{R2Dn9eSYwuMTAFzY}f#e zZj~ZC1j$}lF%YJ@gRyv;>U}5>D}4s*?IjH>wgSa z2D#niBz=C@aT#4Xb{Q!KmEgK|~d6~1~#hHJvZ>XINc%leQC{(fg&KEDr zoLl|!@`dolIB+k5t8q?v3=iN`o&ac`4}O%t0CxVh58CxUFqzF)bjQ|h;qnhtk>ZD* z#gv@ezI=X8b=k8E;cCBu&3Q1m&TNEXtr8@+s{d)wsX>4Ov+=`r7^5QKFWZ;GvUzD6 z;||tc92e=wrr;s)=-18_uUI(0diRQKxNz6NR=d~#J-FU%0Ht~aj31U2-ERK!YM4+k z>u-YWG(mhC{C-sq{6lVmUo1!lwbd)pNmk|BWEU3z>hAgyZB;Zfpl$dGFC2@7 z>3(bk=;+egnmwx*OMjY~2p79XLGw89Pb;?A?l!mKJL*8E@N!lZT{Ay7uXfP7m2_iv1 z?viW|Uzi#qie%$!cTG+rK!6sP)t=q;lSM@<(ep>au`d}5C{z!?*?H}_{?qc0IDv8m zc|%CJnH!(AhU6@fxM^XkF!aeJ0tBYTu6f~N>FNboaKYey)^i3ABqPcJaNLnq=+7Vj zm;<+uE2{4lbutn!APKF_C(&oG&a*b1uL-oFXpT4vAK=cI^KV=2d+_@s{oppJWe9$b zlUOSUIR5em6jXI`=N?AUBhzY!!HU9bMI{(EIpA`)5lU8N;U5A4d#VZ$pwt!{P&k$d zII&=G&!|eKs@nbvm-EMgPfEguBy31R$++N^+FQV5j7?;~1yT^kEBN`AteJ698ap4H zxP=*y;X{ghsB)@i)yW-uaLq6`l)O{;H|2jM9sH0~QCKvx8iEmdr%Y2-{4zct4d?(S z3NjMPF4yuzVJUc`W{*x@?eG_>Q@ajwL&-QraF}4gr6j)g(P^PL`5BjPq(xO#{5x*X zu>b)w>toSoaFdYYMy8P~xUtFfe2OFjQ`XGY5$jN}5(>C;nvhdSAJ=B~|HAV})RjBN l3pmH@|ARyS-|IgD3;=X$f&6|~5VHUP002ovPDHLkV1lF~V^078 literal 0 HcmV?d00001 From 281e591984b7eb2d620d78ae8307aa2b118e294a Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 2 Mar 2014 17:28:25 -0500 Subject: [PATCH 02/10] Split general and proxy settings. Added some help text (not currently displayed). Dialog sizing needs to be addressed --- gui/builtinPreferenceViews/__init__.py | 2 +- .../pyfaGlobalPreferences.py | 190 +----------------- .../pyfaProxyPreferences.py | 172 ++++++++++++++++ 3 files changed, 184 insertions(+), 180 deletions(-) create mode 100644 gui/builtinPreferenceViews/pyfaProxyPreferences.py diff --git a/gui/builtinPreferenceViews/__init__.py b/gui/builtinPreferenceViews/__init__.py index 186166994..2aa354eb0 100644 --- a/gui/builtinPreferenceViews/__init__.py +++ b/gui/builtinPreferenceViews/__init__.py @@ -1 +1 @@ -__all__ = ["pyfaGlobalPreferences","pyfaHTMLExportPreferences"] +__all__ = ["pyfaGlobalPreferences","pyfaProxyPreferences","pyfaHTMLExportPreferences"] diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index a70ba2777..af9fb6b33 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -11,20 +11,17 @@ import gui.globalEvents as GE class PFGlobalPref ( PreferenceView): - title = "Global Options" + title = "General Options" def populatePanel( self, panel ): + charHelpText = '''Each fit has a character assigned to it, with different fits having different +character. Choose this option if you do not want to switch characters in between fits.''' + dmgHelpText = '''Each fit has a damage profile character assigned to it, with different fits having different +profiles. Choose this option if you do not want to switch profiles in between fits.''' self.mainFrame = gui.mainFrame.MainFrame.getInstance() - self.proxySettings = service.settings.ProxySettings.getInstance() self.dirtySettings = False - self.nMode = self.proxySettings.getMode() - self.nAddr = self.proxySettings.getAddress() - self.nPort = self.proxySettings.getPort() - self.nType = self.proxySettings.getType() - - mainSizer = wx.BoxSizer( wx.VERTICAL ) self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 ) @@ -33,8 +30,8 @@ class PFGlobalPref ( PreferenceView): mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) -# self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) -# mainSizer.Add( self.m_staticline1, 0, wx.EXPAND, 5 ) + #self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + #mainSizer.Add( self.m_staticline1, 0, wx.EXPAND, 5 ) self.cbGlobalChar = wx.CheckBox( panel, wx.ID_ANY, u"Use global character", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbGlobalChar, 0, wx.ALL|wx.EXPAND, 5 ) @@ -48,103 +45,12 @@ class PFGlobalPref ( PreferenceView): self.cbFitColorSlots = wx.CheckBox( panel, wx.ID_ANY, u"Color fitting view by slot", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbFitColorSlots, 0, wx.ALL|wx.EXPAND, 5 ) + # Needs to be implemented - save active fittings and reapply when starting pyfa + #self.cbReopenFits = wx.CheckBox( panel, wx.ID_ANY, u"Reopen Fits", wx.DefaultPosition, wx.DefaultSize, 0 ) + #mainSizer.Add( self.cbReopenFits, 0, wx.ALL|wx.EXPAND, 5 ) + defCharSizer = wx.BoxSizer( wx.HORIZONTAL ) - self.stDefChar = wx.StaticText( panel, wx.ID_ANY, u"Default character:", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stDefChar.Wrap( -1 ) - defCharSizer.Add( self.stDefChar, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - chDefaultCharChoices = [] - self.chDefaultChar = wx.Choice( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, chDefaultCharChoices, 0 ) - self.chDefaultChar.SetSelection( 0 ) - defCharSizer.Add( self.chDefaultChar, 1, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - mainSizer.Add( defCharSizer, 0, wx.EXPAND, 5 ) - - - self.m_staticline2 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) - mainSizer.Add( self.m_staticline2, 0, wx.EXPAND, 5 ) - - self.stPTitle = wx.StaticText( panel, wx.ID_ANY, "Proxy settings", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stPTitle.Wrap( -1 ) - self.stPTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) - - mainSizer.Add( self.stPTitle, 0, wx.ALL, 5 ) - - - ptypeSizer = wx.BoxSizer( wx.HORIZONTAL ) - - self.stPType = wx.StaticText( panel, wx.ID_ANY, u"Mode:", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stPType.Wrap( -1 ) - ptypeSizer.Add( self.stPType, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - self.chProxyTypeChoices = [ u"No proxy", u"Auto-detected proxy settings", u"Manual proxy settings" ] - self.chProxyType = wx.Choice( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chProxyTypeChoices, 0 ) - - - self.chProxyType.SetSelection( self.nMode ) - - ptypeSizer.Add( self.chProxyType, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - mainSizer.Add( ptypeSizer, 0, wx.EXPAND, 5 ) - - fgAddrSizer = wx.FlexGridSizer( 2, 2, 0, 0 ) - fgAddrSizer.AddGrowableCol( 1 ) - fgAddrSizer.SetFlexibleDirection( wx.BOTH ) - fgAddrSizer.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) - - - self.stPSetAddr = wx.StaticText( panel, wx.ID_ANY, u"Addr:", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stPSetAddr.Wrap( -1 ) - fgAddrSizer.Add( self.stPSetAddr, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - self.editProxySettingsAddr = wx.TextCtrl( panel, wx.ID_ANY, self.nAddr, wx.DefaultPosition, wx.DefaultSize, 0 ) - - fgAddrSizer.Add( self.editProxySettingsAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5 ) - - self.stPSetPort = wx.StaticText( panel, wx.ID_ANY, u"Port:", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stPSetPort.Wrap( -1 ) - - fgAddrSizer.Add( self.stPSetPort, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - self.editProxySettingsPort = wx.TextCtrl( panel, wx.ID_ANY, self.nPort, wx.DefaultPosition, wx.DefaultSize, 0 ) - - fgAddrSizer.Add( self.editProxySettingsPort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5 ) - - mainSizer.Add( fgAddrSizer, 0, wx.EXPAND, 5) - - self.stPSAutoDetected = wx.StaticText( panel, wx.ID_ANY, u"Auto-detected: ", wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stPSAutoDetected.Wrap( -1 ) - mainSizer.Add( self.stPSAutoDetected, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) - - btnSizer = wx.BoxSizer( wx.HORIZONTAL ) - btnSizer.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) - - self.btnApply = wx.Button( panel, wx.ID_ANY, u"Apply", wx.DefaultPosition, wx.DefaultSize, 0 ) - - btnSizer.Add( self.btnApply, 0, wx.ALL, 5 ) - - mainSizer.Add(btnSizer, 0, wx.EXPAND,5) - - proxy = self.proxySettings.autodetect() - - if proxy is not None: - addr,port = proxy - txt = addr + ":" + str(port) - else: - txt = "None" - - self.stPSAutoDetected.SetLabel("Auto-detected: " + txt) - self.stPSAutoDetected.Disable() - - cChar = service.Character.getInstance() - charList = cChar.getCharacterList() - - for id, name, active in charList: - self.chDefaultChar.Append(name, id) - - self.chDefaultChar.SetSelection(0) - self.sFit = service.Fit.getInstance() useGlobalChar = self.sFit.serviceFittingOptions["useGlobalCharacter"] useGlobalDmgPattern = self.sFit.serviceFittingOptions["useGlobalDamagePattern"] @@ -160,83 +66,9 @@ class PFGlobalPref ( PreferenceView): self.cbGlobalForceReload.Bind(wx.EVT_CHECKBOX, self.OnCBGlobalForceReloadStateChange) self.cbFitColorSlots.Bind(wx.EVT_CHECKBOX, self.onCBGlobalColorBySlot) - self.chDefaultChar.Disable() - self.chDefaultChar.Show(False) - self.stDefChar.Show(False) - - self.chProxyType.Bind(wx.EVT_CHOICE, self.OnCHProxyTypeSelect) - self.editProxySettingsAddr.Bind(wx.EVT_TEXT, self.OnEditPSAddrText) - self.editProxySettingsPort.Bind(wx.EVT_TEXT, self.OnEditPSPortText) - - - self.btnApply.Bind(wx.EVT_BUTTON, self.OnBtnApply) - - self.UpdateApplyButtonState() - - if self.nMode is not 2: - self.ToggleProxySettings(False) - else: - self.ToggleProxySettings(True) - panel.SetSizer( mainSizer ) panel.Layout() - def OnEditPSAddrText(self, event): - self.nAddr = self.editProxySettingsAddr.GetValue() - self.dirtySettings = True - self.UpdateApplyButtonState() - - def OnEditPSPortText(self, event): - self.nPort = self.editProxySettingsPort.GetValue() - self.dirtySettings = True - self.UpdateApplyButtonState() - - def OnBtnApply(self, event): - self.dirtySettings = False - self.UpdateApplyButtonState() - self.SaveSettings() - - def SaveSettings(self): - self.proxySettings.setMode(self.nMode) - self.proxySettings.setAddress(self.nAddr) - self.proxySettings.setPort(self.nPort) - self.proxySettings.setType(self.nType) - - def UpdateApplyButtonState(self): - if self.dirtySettings: - self.btnApply.Enable() - else: - self.btnApply.Disable() - - def OnCHProxyTypeSelect(self, event): - choice = self.chProxyType.GetSelection() - - self.nMode = choice - self.dirtySettings = True - - self.UpdateApplyButtonState() - - if choice is not 2: - self.ToggleProxySettings(False) - else: - self.ToggleProxySettings(True) - - def ToggleProxySettings(self, mode): - if mode: - self.stPSetAddr.Enable() - self.editProxySettingsAddr.Enable() - self.stPSetPort.Enable() - self.editProxySettingsPort.Enable() - else: - self.stPSetAddr.Disable() - self.editProxySettingsAddr.Disable() - self.stPSetPort.Disable() - self.editProxySettingsPort.Disable() - - def OnCBProxySettingsStateChange(self, event): - self.ToggleProxySettings(self.cbProxySettings.GetValue()) - event.Skip() - def onCBGlobalColorBySlot(self, event): self.sFit.serviceFittingOptions["colorFitBySlot"] = self.cbFitColorSlots.GetValue() fitID = self.mainFrame.getActiveFit() diff --git a/gui/builtinPreferenceViews/pyfaProxyPreferences.py b/gui/builtinPreferenceViews/pyfaProxyPreferences.py new file mode 100644 index 000000000..711eefa7a --- /dev/null +++ b/gui/builtinPreferenceViews/pyfaProxyPreferences.py @@ -0,0 +1,172 @@ +import wx +import service +import urllib2 + +from gui.preferenceView import PreferenceView +from gui import bitmapLoader + +import gui.mainFrame +import service +import gui.globalEvents as GE + + +class PFProxyPref ( PreferenceView): + title = "Proxy" + + def populatePanel( self, panel ): + + self.mainFrame = gui.mainFrame.MainFrame.getInstance() + self.proxySettings = service.settings.ProxySettings.getInstance() + self.dirtySettings = False + + self.nMode = self.proxySettings.getMode() + self.nAddr = self.proxySettings.getAddress() + self.nPort = self.proxySettings.getPort() + self.nType = self.proxySettings.getType() + + mainSizer = wx.BoxSizer( wx.VERTICAL ) + + self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stTitle.Wrap( -1 ) + self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) + + mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) + + ptypeSizer = wx.BoxSizer( wx.HORIZONTAL ) + + self.stPType = wx.StaticText( panel, wx.ID_ANY, u"Mode:", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stPType.Wrap( -1 ) + ptypeSizer.Add( self.stPType, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + self.chProxyTypeChoices = [ u"No proxy", u"Auto-detected proxy settings", u"Manual proxy settings" ] + self.chProxyType = wx.Choice( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, self.chProxyTypeChoices, 0 ) + + + self.chProxyType.SetSelection( self.nMode ) + + ptypeSizer.Add( self.chProxyType, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + mainSizer.Add( ptypeSizer, 0, wx.EXPAND, 5 ) + + fgAddrSizer = wx.FlexGridSizer( 2, 2, 0, 0 ) + fgAddrSizer.AddGrowableCol( 1 ) + fgAddrSizer.SetFlexibleDirection( wx.BOTH ) + fgAddrSizer.SetNonFlexibleGrowMode( wx.FLEX_GROWMODE_SPECIFIED ) + + + self.stPSetAddr = wx.StaticText( panel, wx.ID_ANY, u"Addr:", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stPSetAddr.Wrap( -1 ) + fgAddrSizer.Add( self.stPSetAddr, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + self.editProxySettingsAddr = wx.TextCtrl( panel, wx.ID_ANY, self.nAddr, wx.DefaultPosition, wx.DefaultSize, 0 ) + + fgAddrSizer.Add( self.editProxySettingsAddr, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5 ) + + self.stPSetPort = wx.StaticText( panel, wx.ID_ANY, u"Port:", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stPSetPort.Wrap( -1 ) + + fgAddrSizer.Add( self.stPSetPort, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + self.editProxySettingsPort = wx.TextCtrl( panel, wx.ID_ANY, self.nPort, wx.DefaultPosition, wx.DefaultSize, 0 ) + + fgAddrSizer.Add( self.editProxySettingsPort, 0, wx.ALL | wx.ALIGN_CENTER_VERTICAL | wx.EXPAND, 5 ) + + mainSizer.Add( fgAddrSizer, 0, wx.EXPAND, 5) + + self.stPSAutoDetected = wx.StaticText( panel, wx.ID_ANY, u"Auto-detected: ", wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stPSAutoDetected.Wrap( -1 ) + mainSizer.Add( self.stPSAutoDetected, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5 ) + + btnSizer = wx.BoxSizer( wx.HORIZONTAL ) + btnSizer.AddSpacer( ( 0, 0), 1, wx.EXPAND, 5 ) + + self.btnApply = wx.Button( panel, wx.ID_ANY, u"Apply", wx.DefaultPosition, wx.DefaultSize, 0 ) + + btnSizer.Add( self.btnApply, 0, wx.ALL, 5 ) + + mainSizer.Add(btnSizer, 0, wx.EXPAND,5) + + proxy = self.proxySettings.autodetect() + + if proxy is not None: + addr,port = proxy + txt = addr + ":" + str(port) + else: + txt = "None" + + self.stPSAutoDetected.SetLabel("Auto-detected: " + txt) + self.stPSAutoDetected.Disable() + + self.chProxyType.Bind(wx.EVT_CHOICE, self.OnCHProxyTypeSelect) + self.editProxySettingsAddr.Bind(wx.EVT_TEXT, self.OnEditPSAddrText) + self.editProxySettingsPort.Bind(wx.EVT_TEXT, self.OnEditPSPortText) + + + self.btnApply.Bind(wx.EVT_BUTTON, self.OnBtnApply) + + self.UpdateApplyButtonState() + + if self.nMode is not 2: + self.ToggleProxySettings(False) + else: + self.ToggleProxySettings(True) + + panel.SetSizer( mainSizer ) + panel.Layout() + + def OnEditPSAddrText(self, event): + self.nAddr = self.editProxySettingsAddr.GetValue() + self.dirtySettings = True + self.UpdateApplyButtonState() + + def OnEditPSPortText(self, event): + self.nPort = self.editProxySettingsPort.GetValue() + self.dirtySettings = True + self.UpdateApplyButtonState() + + def OnBtnApply(self, event): + self.dirtySettings = False + self.UpdateApplyButtonState() + self.SaveSettings() + + def SaveSettings(self): + self.proxySettings.setMode(self.nMode) + self.proxySettings.setAddress(self.nAddr) + self.proxySettings.setPort(self.nPort) + self.proxySettings.setType(self.nType) + + def UpdateApplyButtonState(self): + if self.dirtySettings: + self.btnApply.Enable() + else: + self.btnApply.Disable() + + def OnCHProxyTypeSelect(self, event): + choice = self.chProxyType.GetSelection() + + self.nMode = choice + self.dirtySettings = True + + self.UpdateApplyButtonState() + + if choice is not 2: + self.ToggleProxySettings(False) + else: + self.ToggleProxySettings(True) + + def ToggleProxySettings(self, mode): + if mode: + self.stPSetAddr.Enable() + self.editProxySettingsAddr.Enable() + self.stPSetPort.Enable() + self.editProxySettingsPort.Enable() + else: + self.stPSetAddr.Disable() + self.editProxySettingsAddr.Disable() + self.stPSetPort.Disable() + self.editProxySettingsPort.Disable() + + def getImage(self): + return bitmapLoader.getBitmap("prefs_settings", "icons") + +PFProxyPref.register() \ No newline at end of file From cd5d047891194ee62a6130bcd27833987c5ad4ed Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 2 Mar 2014 19:54:35 -0500 Subject: [PATCH 03/10] Use .Wrap() and the dialogs width to set appropriate sizer of large text --- .../pyfaHTMLExportPreferences.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 4a68a25a5..927a71c8b 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -13,17 +13,16 @@ import gui.globalEvents as GE class PFHTMLExportPref ( PreferenceView): title = "HTML Export" - desc = """Turning this feature on will create a HTML file at the specified location -with all your fits in it. If you browse to this HTML file from the -in-game browser you can easily view and import your fits by clicking on them. -The file will be updated every time a fit changes or gets added. -""" + desc = "Turning this feature on will create a HTML file at the specified location "+ \ + "with all your fits in it. If you browse to this HTML file from the "+\ + "in-game browser you can easily view and import your fits by clicking on them. "+\ + "The file will be updated every time a fit changes or gets added." def populatePanel( self, panel ): self.mainFrame = gui.mainFrame.MainFrame.getInstance() self.HTMLExportSettings = service.settings.HTMLExportSettings.getInstance() self.dirtySettings = False - + dlgWidth = panel.GetParent().GetParent().ClientSize.width mainSizer = wx.BoxSizer( wx.VERTICAL ) self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 ) @@ -32,6 +31,7 @@ The file will be updated every time a fit changes or gets added. mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stDesc.Wrap(dlgWidth - 120) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) self.exportEnabled = wx.CheckBox( panel, wx.ID_ANY, u"Enable HTML export", wx.DefaultPosition, wx.DefaultSize, 0 ) @@ -50,6 +50,8 @@ The file will be updated every time a fit changes or gets added. self.fileSelectButton.Bind(wx.EVT_BUTTON, self.selectHTMLExportFilePath) mainSizer.Add( self.fileSelectButton, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) + # Quick and dirty hack to size the dialog in a nice way. This will have to change with more pages/content + mainSizer.AddSpacer( ( 0, 30), 1, wx.EXPAND, 5 ) panel.SetSizer( mainSizer ) panel.Layout() From ea3969e1e3f7fdf44e4893fa0fb9ab510d3a9c0d Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 2 Mar 2014 20:02:36 -0500 Subject: [PATCH 04/10] Show preference pages in the order they appear in builtinPreferenceViews --- gui/builtinPreferenceViews/__init__.py | 2 +- gui/builtinPreferenceViews/pyfaGlobalPreferences.py | 2 +- gui/preferenceDialog.py | 4 ++-- gui/preferenceView.py | 8 ++------ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/gui/builtinPreferenceViews/__init__.py b/gui/builtinPreferenceViews/__init__.py index 2aa354eb0..457724c9a 100644 --- a/gui/builtinPreferenceViews/__init__.py +++ b/gui/builtinPreferenceViews/__init__.py @@ -1 +1 @@ -__all__ = ["pyfaGlobalPreferences","pyfaProxyPreferences","pyfaHTMLExportPreferences"] +__all__ = ["pyfaGlobalPreferences","pyfaHTMLExportPreferences","pyfaProxyPreferences"] diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index af9fb6b33..22384b932 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -11,7 +11,7 @@ import gui.globalEvents as GE class PFGlobalPref ( PreferenceView): - title = "General Options" + title = "General" def populatePanel( self, panel ): charHelpText = '''Each fit has a character assigned to it, with different fits having different diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index c9b10c636..15f0c2add 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -53,7 +53,7 @@ class PreferenceDialog(wx.Dialog): self.Centre(wx.BOTH) - for title, prefView in PreferenceView.views.iteritems(): + for prefView in PreferenceView.views: page = wx.Panel(self.listbook) bmp = prefView.getImage() if bmp: @@ -61,7 +61,7 @@ class PreferenceDialog(wx.Dialog): else: imgID = -1 prefView.populatePanel(page) - self.listbook.AddPage(page, title, imageId = imgID) + self.listbook.AddPage(page, prefView.title, imageId = imgID) self.Fit() self.Layout() diff --git a/gui/preferenceView.py b/gui/preferenceView.py index 8833d8cb7..bf1ba76ed 100644 --- a/gui/preferenceView.py +++ b/gui/preferenceView.py @@ -20,17 +20,13 @@ import wx class PreferenceView(object): - views = {} + views = [] def __init__(self): pass @classmethod def register(cls): - PreferenceView.views[cls.title] = cls() - - @classmethod - def getView(cls, name): - return cls.views[name] + PreferenceView.views.append(cls()) def populatePanel(self, panel): raise NotImplementedError() From 91b2eff7b4d3eb56fc6756f40280a39addd9b072 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 2 Mar 2014 22:23:49 -0500 Subject: [PATCH 05/10] Added proxy icon, removed help text for global char and profile options --- .../pyfaGlobalPreferences.py | 5 ----- .../pyfaProxyPreferences.py | 2 +- icons/prefs_proxy.png | Bin 0 -> 2387 bytes 3 files changed, 1 insertion(+), 6 deletions(-) create mode 100644 icons/prefs_proxy.png diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index 22384b932..a08b5e46f 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -14,11 +14,6 @@ class PFGlobalPref ( PreferenceView): title = "General" def populatePanel( self, panel ): - charHelpText = '''Each fit has a character assigned to it, with different fits having different -character. Choose this option if you do not want to switch characters in between fits.''' - dmgHelpText = '''Each fit has a damage profile character assigned to it, with different fits having different -profiles. Choose this option if you do not want to switch profiles in between fits.''' - self.mainFrame = gui.mainFrame.MainFrame.getInstance() self.dirtySettings = False diff --git a/gui/builtinPreferenceViews/pyfaProxyPreferences.py b/gui/builtinPreferenceViews/pyfaProxyPreferences.py index 711eefa7a..4e783733e 100644 --- a/gui/builtinPreferenceViews/pyfaProxyPreferences.py +++ b/gui/builtinPreferenceViews/pyfaProxyPreferences.py @@ -167,6 +167,6 @@ class PFProxyPref ( PreferenceView): self.editProxySettingsPort.Disable() def getImage(self): - return bitmapLoader.getBitmap("prefs_settings", "icons") + return bitmapLoader.getBitmap("prefs_proxy", "icons") PFProxyPref.register() \ No newline at end of file diff --git a/icons/prefs_proxy.png b/icons/prefs_proxy.png new file mode 100644 index 0000000000000000000000000000000000000000..e54b67685ebea287da28f1a00afc9aa2781d75d8 GIT binary patch literal 2387 zcmaJ@c{r5&9v@prwrt6AX&R+yR@<1#Om`T@HZtfS!Yr?uF=pN|^I}ZN(vGaBtA)A= zZ7!WivL?|H>R671PKiV6NU0Oa)g7I5?jN`NKF|C9mgn>Nd_Ujs@B4e6_o$yQOdwNj)6(fB4RbQp}O6Br*iopbO3x)!~C@6s`0bmpk$O7P=LM9jR2bi41*bcxM z22(-s1B0Ppx(|^J3en7E3|b}>E7&lY^LCk-$rb<*oCR?CA`)Vzz8L}Mb4Z9F2RfE6 zb_IBR54i*gkoyL*B;6SQH!Uh=V)YqjC0Ff;|BVx5eVH7@REzi$~$GLi#8`VnssmAV^HaU=k7%&EP{PIF2m}HKYm2e9MJW&{X`%>X%1|Py<%$9o zkg_FwF~kQ&@MT3N3ygzE2!+!>QxJ;3%8I04%A_b5M#dClaA@puN-ID*{r^LS!mns4 zd=BdpP9CRLnASu|?T+jC6g@Codhv0HD#&X=vybgWFS_@RBo9FRWPcu8(;7=m9R5{WzQ7lsMyY$11%Su*Uqw3OU#?}V%5pUfOkmC3wjvX ztK)5AYvu8x;LFvD=n6O$m%)0EZd!{?9;Gps_|WN4@>OeMwXGj!HBvyk<*rf6bwkFRElyos$F@Qv_Hb8^E->dxmam3Y)hVQ zen3P0+sW)3nfdtG_l4`ZFBS)i({AL z_Y%x%(plBZ4RQAGV^rh1)n~ZTISljTJIOvpCywr}&+bNsE#34Am@*ryZ%S$%{*V!D zX_QhlUA|avdVqhSC5NTw#c;?7M7sBkrICtsa^oxVUh@BD!c8J7MKb*ii(r0E8`oaA zU;V5!ZR)*V0szg#PZrSDp+m0=+7}#ljCfW?8>Yloyn2Y(wU0mE7&=HP?W;IRgU)CC zEGjV9Zqm7!9+gy3S^?TNRxQ9gY!ba_0)hJ6<1x3;dY6zA29G}e!0hhCo+rUKtD?t- z7VAyaYbf}s$X>{wi=yblxvz`gPT~hP3fjvoByrU z?dAG%uTfnFH+%Q#B-!~+F=P=s2?(1)dH zOQuI|lj#Rm+v1?>gj{LxN!X8GSs4^7lR!13#S-Zd*>3p7l}{Xe`pdEw)Qg~B4lQw7 z>m0Izb!5IlpNt+-_rp|oS}gdju4@)#Rd`>#L{`e?`JGGuxUQuYMkVEV5s|Z*w3xM5 z+RJ^st9P(4DD!)x-wgy-PR~5+aaHc=n$n@D<{D2bmphi^TG4(TMp$ocBSakQSN_f2 ullQoUwWK!gaW8tld3C~- Date: Mon, 3 Mar 2014 01:52:57 -0500 Subject: [PATCH 06/10] Fix for PreferenceDialog sizing issues --- gui/preferenceDialog.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gui/preferenceDialog.py b/gui/preferenceDialog.py index 15f0c2add..c3a1f9f1a 100644 --- a/gui/preferenceDialog.py +++ b/gui/preferenceDialog.py @@ -63,7 +63,15 @@ class PreferenceDialog(wx.Dialog): prefView.populatePanel(page) self.listbook.AddPage(page, prefView.title, imageId = imgID) - self.Fit() + # Set the height based on a condition. Can all the panels fit in the current height? + # If not, use the .GetBestVirtualSize() to ensure that all content is available. + minHeight = 360 + bestFit = self.GetBestVirtualSize() + if minHeight > bestFit[1]: + self.SetSizeWH(450, minHeight) + else: + self.SetSizeWH(450, bestFit[1]) + self.Layout() self.btnOK.Bind(wx.EVT_BUTTON, self.OnBtnOK) From 9b096524ccd44fc667a3a8e57accffbe2e773fea Mon Sep 17 00:00:00 2001 From: blitzmann Date: Mon, 3 Mar 2014 01:53:55 -0500 Subject: [PATCH 07/10] Updated update preference view with new icon and text wrapping --- .../pyfaHTMLExportPreferences.py | 2 +- .../pyfaUpdatePreferences.py | 24 +++++++++--------- icons/prefs_update.png | Bin 0 -> 2096 bytes 3 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 icons/prefs_update.png diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 927a71c8b..225f42a93 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -31,7 +31,7 @@ class PFHTMLExportPref ( PreferenceView): mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) - self.stDesc.Wrap(dlgWidth - 120) + self.stDesc.Wrap(dlgWidth - 50) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) self.exportEnabled = wx.CheckBox( panel, wx.ID_ANY, u"Enable HTML export", wx.DefaultPosition, wx.DefaultSize, 0 ) diff --git a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py index 0655564fd..b7f9cffbb 100644 --- a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py +++ b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py @@ -10,17 +10,17 @@ import gui.globalEvents as GE class PFUpdatePref (PreferenceView): - title = "Pyfa Update Options" - desc = """ -Pyfa can automatically check and notify you of new releases. -These options will allow you to choose what kind of updates, if any, you wish -to receive notifications for. -""" + title = "Updates" + desc = "Pyfa can automatically check and notify you of new releases. "+\ + "These options will allow you to choose what kind of updates, "+\ + "if any, you wish to receive notifications for." def populatePanel( self, panel ): self.UpdateSettings = service.settings.UpdateSettings.getInstance() self.dirtySettings = False + dlgWidth = panel.GetParent().GetParent().ClientSize.width + mainSizer = wx.BoxSizer( wx.VERTICAL ) self.stTitle = wx.StaticText( panel, wx.ID_ANY, self.title, wx.DefaultPosition, wx.DefaultSize, 0 ) @@ -29,6 +29,7 @@ to receive notifications for. mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.stDesc.Wrap(dlgWidth - 50) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) self.suppressAll = wx.CheckBox( panel, wx.ID_ANY, u"Don't check for updates", wx.DefaultPosition, wx.DefaultSize, 0 ) @@ -51,11 +52,9 @@ to receive notifications for. self.versionTitle.Wrap( -1 ) self.versionTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) - self.versionInfo = ''' -There is a release available which you have chosen to suppress. -You can choose to reset notification suppression for this release, -or download the new release from GitHub. -''' + self.versionInfo = "There is a release available which you have chosen to suppress. "+\ + "You can choose to reset notification suppression for this release, "+\ + "or download the new release from GitHub." self.versionSizer.AddSpacer( ( 5, 5), 0, wx.EXPAND, 5 ) @@ -64,6 +63,7 @@ or download the new release from GitHub. self.versionSizer.Add( self.versionTitle, 0, wx.EXPAND, 5 ) self.versionDesc = wx.StaticText( panel, wx.ID_ANY, self.versionInfo, wx.DefaultPosition, wx.DefaultSize, 0 ) + self.versionDesc.Wrap(dlgWidth - 50) self.versionSizer.Add( self.versionDesc, 0, wx.ALL, 5 ) actionSizer = wx.BoxSizer( wx.HORIZONTAL ) @@ -114,6 +114,6 @@ or download the new release from GitHub. wx.LaunchDefaultBrowser('https://github.com/DarkFenX/Pyfa/releases/tag/'+self.UpdateSettings.get('version')) def getImage(self): - return bitmapLoader.getBitmap("pyfa64", "icons") + return bitmapLoader.getBitmap("prefs_update", "icons") PFUpdatePref.register() \ No newline at end of file diff --git a/icons/prefs_update.png b/icons/prefs_update.png new file mode 100644 index 0000000000000000000000000000000000000000..c1ab75d3bfabcb68c0ee0ca63ed27e12ee32783d GIT binary patch literal 2096 zcmV-02+#M4P)9aiWq^euq+Tl5+Edw?bwceeeHYgyK_F@Yi#30thIFFT>JaZ`F+3hJLi1n;Oo82 z>wEg+YBB{W4M0mJ{|!my?U--uujdcF9KIh1+}8x)e5$)I@T;BQ00JQ=k}y6!3&VFp zaAnkcSqV>fo_*~{Be+hR4}fWXPu~olz@EfEY^64LL>_nWkm^0Te{&~3y4JngH|43V zfFuGawV9yaWrLQgVu&M{PY3V7m66HAXI|ON8bIw=6FEm`GNp6{7Au5zOsF>4ic;x3I%~7F|em_@%ix}T)Y{AXO=C1 zuJ%O>w4T1v{yiHT^FdIwDB7*lJv*P{d?P39=&Q(LDqtem&;*gcM?bv41J4T}Ab0`) zH;DpRL=iZAes5qBrejI?-nzxrPaNnSC%pLp2$2tMTuXu1Q*2@z$&r|20y7`d&E-j# z*772UAnuwVa3CUBi;0K6K_B>}By3#K=vlMp$Q!gJ8vwo3C0+Z(R`}h86Afa1a(ZR)W*%+`aVs-OUDr1_06V(27HC z4=;cjS-}(V_nJUX1(=N|vjHe5t`&nv|MXJu#^5J0uNPEF!ZeAvUdZef5di7q_<#J+ zzN8k)8kZh1Qo#V!w>{&wS&LRLZK{OcE7OeXLLi9hC<4erK>8US{p9^)pT4&H7pHo5 zbx1z%bQ~EGn2)rdGE#DuxH2zZmFm16U(8KJ)vhZIxJglypnkVF8JUz|F8_Kz>V8lAj3 zGCmc$rwj{#nDGx^cu$T>Ot|@4l2keZYg??VFn<$R-&D6bxkpow`k{aPrH`mR)xGn( zQSX$b%Cn!(KQTZa>OFK$k>hDUS!GH715#!zaH3wyjDA|2eYj$)34G}=lwUs$loR_l zufg{?1<7vdYrBvAo#XgbAMM>#L45@+X1567vYWskNoD-fds4ewNWAf3Oa+F}Kuc7W zSVgFD6~nS0^gNu^F^8#Z(v~a$HsFMfo7)zZefvP~DAoA#pZsoRrK@V~EcfLSrEXRzKPVEl>aQQvM{% zz1e7B#`RxL#i6X+4Qs#I0;4mDwD647>H{qj3;ijM3=K?_!(1dgDzdjkxj7D*8q}XTK6A~LK%wnsim=v2dkOoJdDZF@OZb7)=3#9h(<;~!7medZIpN&+n-1fefkbZyWx6hr=E=Q_) z5U~4cTEWX7eea+0f;<}-pqLb!*Y9f4tHOa{LxtKk@cHTppp=#yFO4U+DibG%<2?21lxB z7Sn@7(8n+~C>4)D`5g-?2&4)+o_rKY`E;i=sz#U(0NVJ~>kzs<{O;|49luO5v+n~` zT7k2FcwzsoYr}p;PT;jlWP&j|m`O-mFs@;a6&RS1(-%cUm>T4Cy?i4OtqpGAEOwjT z*wkzQnvQ7lRCnjrp^KM%34QS7h*D39(Ndwn)od=Ka;&VWh7B9qw?DDx$XiBiK5IW| zVFqpNxA%EQwwG>F^G$X-Vi8(7T18QLO;z*epKU9tZC-D(mOQ{(ES}__2X}aq3E8jz zQnKFX?@djgs1kP{KVD5b5TdLUtxONb>zcWtzkj9I|MTlu(3_4`r Date: Mon, 3 Mar 2014 11:19:32 -0500 Subject: [PATCH 08/10] Removing sizing hack now that dialog sizing is correct --- gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 225f42a93..39b09b301 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -50,8 +50,6 @@ class PFHTMLExportPref ( PreferenceView): self.fileSelectButton.Bind(wx.EVT_BUTTON, self.selectHTMLExportFilePath) mainSizer.Add( self.fileSelectButton, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) - # Quick and dirty hack to size the dialog in a nice way. This will have to change with more pages/content - mainSizer.AddSpacer( ( 0, 30), 1, wx.EXPAND, 5 ) panel.SetSizer( mainSizer ) panel.Layout() From e6bc83130508e099b6a35acd4c1cbe04629b14a6 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 7 Mar 2014 20:57:39 -0500 Subject: [PATCH 09/10] Added static line under pref page title --- gui/builtinPreferenceViews/pyfaGlobalPreferences.py | 4 ++-- gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py | 3 +++ gui/builtinPreferenceViews/pyfaProxyPreferences.py | 3 +++ gui/builtinPreferenceViews/pyfaUpdatePreferences.py | 3 +++ 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py index a08b5e46f..725b22540 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGlobalPreferences.py @@ -25,8 +25,8 @@ class PFGlobalPref ( PreferenceView): mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) - #self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) - #mainSizer.Add( self.m_staticline1, 0, wx.EXPAND, 5 ) + self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 ) self.cbGlobalChar = wx.CheckBox( panel, wx.ID_ANY, u"Use global character", wx.DefaultPosition, wx.DefaultSize, 0 ) mainSizer.Add( self.cbGlobalChar, 0, wx.ALL|wx.EXPAND, 5 ) diff --git a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py index 39b09b301..bc5928cd7 100644 --- a/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py +++ b/gui/builtinPreferenceViews/pyfaHTMLExportPreferences.py @@ -30,6 +30,9 @@ class PFHTMLExportPref ( PreferenceView): self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) + self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 ) + self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) self.stDesc.Wrap(dlgWidth - 50) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) diff --git a/gui/builtinPreferenceViews/pyfaProxyPreferences.py b/gui/builtinPreferenceViews/pyfaProxyPreferences.py index 4e783733e..40c2286f1 100644 --- a/gui/builtinPreferenceViews/pyfaProxyPreferences.py +++ b/gui/builtinPreferenceViews/pyfaProxyPreferences.py @@ -32,6 +32,9 @@ class PFProxyPref ( PreferenceView): mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) + self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 ) + ptypeSizer = wx.BoxSizer( wx.HORIZONTAL ) self.stPType = wx.StaticText( panel, wx.ID_ANY, u"Mode:", wx.DefaultPosition, wx.DefaultSize, 0 ) diff --git a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py index b7f9cffbb..94b49b759 100644 --- a/gui/builtinPreferenceViews/pyfaUpdatePreferences.py +++ b/gui/builtinPreferenceViews/pyfaUpdatePreferences.py @@ -28,6 +28,9 @@ class PFUpdatePref (PreferenceView): self.stTitle.SetFont( wx.Font( 12, 70, 90, 90, False, wx.EmptyString ) ) mainSizer.Add( self.stTitle, 0, wx.ALL, 5 ) + self.m_staticline1 = wx.StaticLine( panel, wx.ID_ANY, wx.DefaultPosition, wx.DefaultSize, wx.LI_HORIZONTAL ) + mainSizer.Add( self.m_staticline1, 0, wx.EXPAND|wx.TOP|wx.BOTTOM, 5 ) + self.stDesc = wx.StaticText( panel, wx.ID_ANY, self.desc, wx.DefaultPosition, wx.DefaultSize, 0 ) self.stDesc.Wrap(dlgWidth - 50) mainSizer.Add( self.stDesc, 0, wx.ALL, 5 ) From 652e0738afb9479e48f784eb8f43712c7d00e224 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Fri, 7 Mar 2014 21:28:58 -0500 Subject: [PATCH 10/10] Rename GlobalPreferences to GeneralPreferences --- gui/builtinPreferenceViews/__init__.py | 2 +- .../{pyfaGlobalPreferences.py => pyfaGeneralPreferences.py} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename gui/builtinPreferenceViews/{pyfaGlobalPreferences.py => pyfaGeneralPreferences.py} (98%) diff --git a/gui/builtinPreferenceViews/__init__.py b/gui/builtinPreferenceViews/__init__.py index 09ab03247..ac253597d 100644 --- a/gui/builtinPreferenceViews/__init__.py +++ b/gui/builtinPreferenceViews/__init__.py @@ -1 +1 @@ -__all__ = ["pyfaGlobalPreferences","pyfaHTMLExportPreferences","pyfaUpdatePreferences","pyfaProxyPreferences"] \ No newline at end of file +__all__ = ["pyfaGeneralPreferences","pyfaHTMLExportPreferences","pyfaUpdatePreferences","pyfaProxyPreferences"] \ No newline at end of file diff --git a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py similarity index 98% rename from gui/builtinPreferenceViews/pyfaGlobalPreferences.py rename to gui/builtinPreferenceViews/pyfaGeneralPreferences.py index 725b22540..81bb81856 100644 --- a/gui/builtinPreferenceViews/pyfaGlobalPreferences.py +++ b/gui/builtinPreferenceViews/pyfaGeneralPreferences.py @@ -10,7 +10,7 @@ import service import gui.globalEvents as GE -class PFGlobalPref ( PreferenceView): +class PFGeneralPref ( PreferenceView): title = "General" def populatePanel( self, panel ): @@ -89,4 +89,4 @@ class PFGlobalPref ( PreferenceView): def getImage(self): return bitmapLoader.getBitmap("prefs_settings", "icons") -PFGlobalPref.register() \ No newline at end of file +PFGeneralPref.register() \ No newline at end of file