summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Konrath <ben@bagu.org>2009-12-02 18:41:04 -0500
committerBen Konrath <ben@bagu.org>2009-12-02 18:41:04 -0500
commit5105a20f499da987cef9ada6d9254488c14c7d94 (patch)
tree2f6846ad517a12eb836eed3fa0b7d7e2154d90f3
parent980d6715624185c3a22531d7c2a5a334220331ad (diff)
downloadcaribou-5105a20f499da987cef9ada6d9254488c14c7d94.tar.gz
Remove _layouts global variable
-rw-r--r--src/keyboard.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/keyboard.py b/src/keyboard.py
index 0524671..505b8ed 100644
--- a/src/keyboard.py
+++ b/src/keyboard.py
@@ -37,11 +37,9 @@ class CaribouKeyboard(gtk.Frame):
gtk.Frame.__init__(self)
self.set_shadow_type(gtk.SHADOW_NONE)
- # FIXME use references instead of this??
- self._layouts = []
self._vk = virtkey.virtkey()
- switch_buttons = []
+ layouts, switch_buttons = [], []
for layout in keyboard.layouts:
layoutvbox = gtk.VBox(homogeneous=True)
layoutvbox.set_name(layout)
@@ -83,24 +81,24 @@ class CaribouKeyboard(gtk.Frame):
layoutvbox.pack_start(rowhbox, expand=False, fill=True)
- self._layouts.append(layoutvbox)
+ layouts.append(layoutvbox)
# add configuration window to layouts
# TODO use gtkBuilder
confhbox = gtk.HBox(homogeneous=True)
# return to first keyboard layout from configuration window
button = gtk.Button("abc") # FIXME use keyboard image
- button.set_name(self._layouts[0].get_name())
+ button.set_name(layouts[0].get_name())
switch_buttons.append(button)
confhbox.pack_start(button)
confhbox.pack_start(gtk.Label("configuration coming soon"))
confhbox.set_name("configuration")
- self._layouts.append(confhbox)
+ layouts.append(confhbox)
# connect the change layout buttons
for button in switch_buttons:
- for layout in self._layouts:
+ for layout in layouts:
if button.get_name() == layout.get_name():
button.connect("clicked", self.__change_layout, layout)
button.set_name("")
@@ -109,7 +107,9 @@ class CaribouKeyboard(gtk.Frame):
print "ERROR" # TODO throw exception
# add the first layout and make it visible
- self.add(self._layouts[0])
+ self.add(layouts[0])
+ del layouts
+ del switch_buttons
self.show_all()
def __send_unicode(self, widget, data):