kopia lustrzana https://github.com/ctjacobs/pyqso
Add methods to enable and disable the data entry panel. This will be useful to prevent user input when no record is selected.
rodzic
995ef47c94
commit
742e256f0c
|
@ -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)
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
Ładowanie…
Reference in New Issue