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: |