printrun-src/printrun/gui/widgets.py

changeset 26
5c98c7e24b02
parent 22
4c9bb8f93ae8
child 46
cce0af6351f0
equal deleted inserted replaced
25:0e3e7fbf0bc6 26:5c98c7e24b02
133 sbox = wx.StaticBoxSizer(header, wx.VERTICAL) 133 sbox = wx.StaticBoxSizer(header, wx.VERTICAL)
134 notebook = wx.Notebook(panel) 134 notebook = wx.Notebook(panel)
135 all_settings = pronterface.settings._all_settings() 135 all_settings = pronterface.settings._all_settings()
136 group_list = [] 136 group_list = []
137 groups = {} 137 groups = {}
138 for group in ["Printer", "UI", "Viewer", "Colors", "External"]: 138 for group in ["Printer", "UI", "Viewer", "Colors", "External", "Laser"]:
139 group_list.append(group) 139 group_list.append(group)
140 groups[group] = [] 140 groups[group] = []
141 for setting in all_settings: 141 for setting in all_settings:
142 if setting.group not in group_list: 142 if setting.group not in group_list:
143 group_list.append(setting.group) 143 group_list.append(setting.group)
177 topsizer.Add(panel, 1, wx.ALL | wx.EXPAND) 177 topsizer.Add(panel, 1, wx.ALL | wx.EXPAND)
178 topsizer.Add(self.CreateButtonSizer(wx.OK | wx.CANCEL), 0, wx.ALIGN_RIGHT) 178 topsizer.Add(self.CreateButtonSizer(wx.OK | wx.CANCEL), 0, wx.ALIGN_RIGHT)
179 self.SetSizerAndFit(topsizer) 179 self.SetSizerAndFit(topsizer)
180 self.SetMinSize(self.GetSize()) 180 self.SetMinSize(self.GetSize())
181 181
182 def PronterOptions(pronterface): 182 self.notebook = notebook
183 self.group_list = group_list
184
185 def setPage(self, name):
186 self.notebook.ChangeSelection(self.group_list.index(name))
187
188 def PronterOptions(pronterface, defaulttab = None):
183 dialog = PronterOptionsDialog(pronterface) 189 dialog = PronterOptionsDialog(pronterface)
190 if defaulttab:
191 # set the active tab before open dialog
192 dialog.setPage(defaulttab)
193
184 if dialog.ShowModal() == wx.ID_OK: 194 if dialog.ShowModal() == wx.ID_OK:
185 for setting in pronterface.settings._all_settings(): 195 for setting in pronterface.settings._all_settings():
186 old_value = setting.value 196 old_value = setting.value
187 setting.update() 197 setting.update()
188 if setting.value != old_value: 198 if setting.value != old_value:

mercurial