Add methods to enable and disable the data entry panel. This will be useful to prevent user input when no record is selected.

pull/17/head
Christian Jacobs 2013-03-23 21:34:58 +00:00
rodzic 995ef47c94
commit 742e256f0c
2 zmienionych plików z 15 dodań i 0 usunięć

Wyświetl plik

@ -48,5 +48,19 @@ class DataEntryPanel(Gtk.VBox):
return
def enable(self):
# Activates all text boxes and the "Store data" button
keys = self.sources.keys()
for i in range(0, len(keys)):
self.sources[keys[i]].set_property("editable", True)
self.sources[keys[i]].set_can_focus(True)
self.store.set_sensitive(True)
def disable(self):
# Deactivates all text boxes and the "Store data" button
keys = self.sources.keys()
for i in range(0, len(keys)):
self.sources[keys[i]].set_property("editable", False)
self.sources[keys[i]].set_can_focus(False)
self.store.set_sensitive(False)

Wyświetl plik

@ -55,6 +55,7 @@ class PyQSO(Gtk.Window):
vbox_outer.pack_start(hbox, True, True, 0)
self.data_entry_panel = DataEntryPanel(self, hbox)
self.data_entry_panel.disable()
# Render the logbook
self.treeview = Gtk.TreeView(self.logbook)