1 __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
2 from __future__ import absolute_import
6 from Cura.gui import configBase
7 from Cura.util import profile
9 class expertConfigWindow(wx.Dialog):
10 "Expert configuration window"
11 def _addSettingsToPanels(self, category, left, right):
12 count = len(profile.getSubCategoriesFor(category)) + len(profile.getSettingsForCategory(category))
16 for title in profile.getSubCategoriesFor(category):
17 n += 1 + len(profile.getSettingsForCategory(category, title))
20 configBase.TitleRow(p, title)
21 for s in profile.getSettingsForCategory(category, title):
22 if s.checkConditions():
23 configBase.SettingRow(p, s.getName())
26 super(expertConfigWindow, self).__init__(None, title='Expert config', style=wx.DEFAULT_DIALOG_STYLE)
28 wx.EVT_CLOSE(self, self.OnClose)
29 self.panel = configBase.configPanelBase(self)
31 left, right, main = self.panel.CreateConfigPanel(self)
32 self._addSettingsToPanels('expert', left, right)
34 self.okButton = wx.Button(right, -1, 'Ok')
35 right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0))
36 self.Bind(wx.EVT_BUTTON, lambda e: self.Close(), self.okButton)