chiark / gitweb /
Added general help for plugin tab, added open plugin folder button, fixed scale to...
[cura.git] / Cura / gui / pluginPanel.py
index 8ae787f90cfbd5d825d57d6ce3c9972f7cc128be..204693afe02c975c01635af1d2711daef06f572a 100644 (file)
@@ -3,6 +3,7 @@ import sys, math, threading, os, webbrowser
 from wx.lib import scrolledpanel
 
 from util import profile
+from util import exporer
 
 class pluginPanel(wx.Panel):
        def __init__(self, parent):
@@ -20,19 +21,23 @@ class pluginPanel(wx.Panel):
                self.listbox = wx.ListBox(self, -1, choices=effectStringList)
                title = wx.StaticText(self, -1, "Plugins:")
                title.SetFont(wx.Font(wx.SystemSettings.GetFont(wx.SYS_ANSI_VAR_FONT).GetPointSize(), wx.FONTFAMILY_DEFAULT, wx.NORMAL, wx.FONTWEIGHT_BOLD))
+               helpButton = wx.Button(self, -1, '?', style=wx.BU_EXACTFIT)
                addButton = wx.Button(self, -1, '>', style=wx.BU_EXACTFIT)
+               openPluginLocationButton = wx.Button(self, -1, 'Open plugin location')
                sb = wx.StaticBox(self, label="Enabled plugins")
                boxsizer = wx.StaticBoxSizer(sb, wx.VERTICAL)
                self.pluginEnabledPanel = scrolledpanel.ScrolledPanel(self)
                self.pluginEnabledPanel.SetupScrolling(False, True)
                
                sizer.Add(title, (0,0), border=10, flag=wx.ALIGN_CENTER_VERTICAL|wx.LEFT|wx.TOP)
-               sizer.Add(self.listbox, (1,0), span=(2,1), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM)
-               sizer.Add(addButton, (1,1), border=5, flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_BOTTOM)
-               sizer.Add(boxsizer, (1,2), span=(2,1), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT|wx.BOTTOM)
+               sizer.Add(helpButton, (0,1), border=10, flag=wx.ALIGN_RIGHT|wx.RIGHT|wx.TOP)
+               sizer.Add(self.listbox, (1,0), span=(2,2), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
+               sizer.Add(addButton, (1,2), border=5, flag=wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_BOTTOM)
+               sizer.Add(boxsizer, (1,3), span=(2,1), border=10, flag=wx.EXPAND|wx.LEFT|wx.RIGHT)
+               sizer.Add(openPluginLocationButton, (3, 0), span=(1,2), border=10, flag=wx.LEFT|wx.BOTTOM)
                boxsizer.Add(self.pluginEnabledPanel, 1, flag=wx.EXPAND)
                
-               sizer.AddGrowableCol(2)
+               sizer.AddGrowableCol(3)
                sizer.AddGrowableRow(1)
                sizer.AddGrowableRow(2)
                
@@ -40,6 +45,8 @@ class pluginPanel(wx.Panel):
                self.pluginEnabledPanel.SetSizer(sizer)
                
                self.Bind(wx.EVT_BUTTON, self.OnAdd, addButton)
+               self.Bind(wx.EVT_BUTTON, self.OnGeneralHelp, helpButton)
+               self.Bind(wx.EVT_BUTTON, self.OnOpenPluginLocation, openPluginLocationButton)
                self.listbox.Bind(wx.EVT_LEFT_DCLICK, self.OnAdd)
                self.panelList = []
                self.updateProfileToControls()
@@ -152,3 +159,9 @@ class pluginPanel(wx.Panel):
                fname = fname[0].upper() + fname[1:]
                fname = fname[:fname.rfind('.')]
                webbrowser.open('http://wiki.ultimaker.com/CuraPlugin:_' + fname)
+       
+       def OnGeneralHelp(self, e):
+               webbrowser.open('http://wiki.ultimaker.com/Category:CuraPlugin')
+       
+       def OnOpenPluginLocation(self, e):
+               exporer.openExporerPath(profile.getPluginBasePaths()[0])