printrun-src/printrun/gui/widgets.py

changeset 26
5c98c7e24b02
parent 22
4c9bb8f93ae8
child 46
cce0af6351f0
--- a/printrun-src/printrun/gui/widgets.py	Sat Jun 04 14:27:06 2016 +0200
+++ b/printrun-src/printrun/gui/widgets.py	Sat Jun 04 15:18:06 2016 +0200
@@ -135,7 +135,7 @@
         all_settings = pronterface.settings._all_settings()
         group_list = []
         groups = {}
-        for group in ["Printer", "UI", "Viewer", "Colors", "External"]:
+        for group in ["Printer", "UI", "Viewer", "Colors", "External", "Laser"]:
             group_list.append(group)
             groups[group] = []
         for setting in all_settings:
@@ -179,8 +179,18 @@
         self.SetSizerAndFit(topsizer)
         self.SetMinSize(self.GetSize())
 
-def PronterOptions(pronterface):
+        self.notebook = notebook
+        self.group_list = group_list
+
+    def setPage(self, name):
+        self.notebook.ChangeSelection(self.group_list.index(name))
+
+def PronterOptions(pronterface, defaulttab = None):
     dialog = PronterOptionsDialog(pronterface)
+    if defaulttab:
+        # set the active tab before open dialog
+        dialog.setPage(defaulttab)
+
     if dialog.ShowModal() == wx.ID_OK:
         for setting in pronterface.settings._all_settings():
             old_value = setting.value

mercurial