diff --git a/src/main/python/editor/macro_recorder.py b/src/main/python/editor/macro_recorder.py index f9bd27bb0d..a8269ac341 100644 --- a/src/main/python/editor/macro_recorder.py +++ b/src/main/python/editor/macro_recorder.py @@ -47,15 +47,6 @@ def __init__(self): self.recording_append = False self.tabs = TabWidgetWithKeycodes() - for x in range(32): - tab = MacroTab(self, self.recorder is not None) - tab.changed.connect(self.on_change) - tab.record.connect(self.on_record) - tab.record_stop.connect(self.on_tab_stop) - self.macro_tabs.append(tab) - w = QWidget() - w.setLayout(tab) - self.macro_tab_w.append(w) self.lbl_memory = QLabel() @@ -81,6 +72,16 @@ def rebuild(self, device): return self.keyboard = self.device.keyboard + for x in range(self.keyboard.macro_count - len(self.macro_tab_w)): + tab = MacroTab(self, self.recorder is not None) + tab.changed.connect(self.on_change) + tab.record.connect(self.on_record) + tab.record_stop.connect(self.on_tab_stop) + self.macro_tabs.append(tab) + w = QWidget() + w.setLayout(tab) + self.macro_tab_w.append(w) + # only show the number of macro editors that keyboard supports while self.tabs.count() > 0: self.tabs.removeTab(0)