Commit 1e2a09b9 authored by Guillaume Seguin's avatar Guillaume Seguin

Correctly compress custom buttons list when removing one

Should remove the need for workarounds such as
http://t00tiereprap.wordpress.com/2013/04/02/messy-custom-button-placement-in-pronterface/
parent 99bc25d6
......@@ -859,10 +859,10 @@ class PronterWindow(MainWindow, pronsole.pronsole):
def cbutton_remove(self, e, button):
n = button.custombutton
self.custombuttons[n]=None
self.cbutton_save(n, None)
#while len(self.custombuttons) and self.custombuttons[-1] is None:
# del self.custombuttons[-1]
del self.custombuttons[n]
for i in range(n, len(self.custombuttons)):
self.cbutton_save(i, self.custombuttons[i])
wx.CallAfter(self.cbuttons_reload)
def cbutton_order(self, e, button, dir):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment