Fixes for webgui and more native gui development
This commit is contained in:
+17
-2
@@ -8,6 +8,7 @@ from gi.repository import GLib, Gtk, Gdk
|
||||
from .view import View
|
||||
from yms import gtkutils, combobox, treeview
|
||||
from yms.model import storage
|
||||
from yms.lookup import Dropdown
|
||||
|
||||
class StorageView(View):
|
||||
|
||||
@@ -34,6 +35,14 @@ class StorageView(View):
|
||||
treeview.add_column(self.tree['storage'], _('Remarks'), 3)
|
||||
self.tree['storage'].set_model(self.lst_storage)
|
||||
|
||||
combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE)
|
||||
combobox.load_from_dict(self.combo['type'], combodict)
|
||||
|
||||
combodict = self.context.lookup.dropdown(Dropdown.STORAGE_TYPE)
|
||||
combobox.load_from_dict(self.combo['type'], combodict)
|
||||
|
||||
combodict = self.context.lookup.enum('storage.capaunit')
|
||||
combobox.load_from_dict(self.combo['unit'], combodict)
|
||||
|
||||
def load_list(self):
|
||||
pass
|
||||
@@ -56,9 +65,11 @@ class StorageView(View):
|
||||
self.topwidget.set_visible_child(self.box['stor_edit'])
|
||||
|
||||
def on_but_edit_clicked(self, widget):
|
||||
sid = treeview.get_value(self.tree['storage'], 0)
|
||||
if sid is None:
|
||||
return
|
||||
self.newrecord = False
|
||||
self.label['title_edit'].set_text("Edit Storage")
|
||||
sid = treeview.get_value(self.tree['storage'], 0)
|
||||
self.storage.load(sid)
|
||||
self.edit_record()
|
||||
self.topwidget.set_visible_child(self.box['stor_edit'])
|
||||
@@ -80,8 +91,12 @@ class StorageView(View):
|
||||
|
||||
# buttons on edit page
|
||||
def on_but_save_clicked(self, widget):
|
||||
print("save not implemented yet")
|
||||
self.newrecord = False
|
||||
# check mandatory fields
|
||||
sname = self.entry['sname'].get_text().strip()
|
||||
if not sname:
|
||||
return
|
||||
# here be dragons
|
||||
|
||||
def on_but_cancel_clicked(self, widget):
|
||||
self.topwidget.set_visible_child(self.box['storage'])
|
||||
|
||||
Reference in New Issue
Block a user