generated from itdominator/Python-With-Gtk-Template
WIP saving of widget through pickle process
This commit is contained in:
33
src/utils/widget_save_load_controller.py
Normal file
33
src/utils/widget_save_load_controller.py
Normal file
@@ -0,0 +1,33 @@
|
||||
# Python imports
|
||||
|
||||
# Lib imports
|
||||
|
||||
# Application imports
|
||||
|
||||
|
||||
|
||||
class SaveLoadControllerException(Exception):
|
||||
...
|
||||
|
||||
|
||||
class WidgetSaveLoadController:
|
||||
def __init__(self):
|
||||
super(WidgetSaveLoadController, self).__init__()
|
||||
self.saveable_data = []
|
||||
self.save_collection = {
|
||||
"width": -1,
|
||||
"height": -1,
|
||||
"x": 0,
|
||||
"y": 0,
|
||||
"data": None,
|
||||
"widget_type": None
|
||||
}
|
||||
|
||||
def register_saveable_data(self, data):
|
||||
self.saveable_data.append(data)
|
||||
|
||||
def load_saveable_data(self, data):
|
||||
self.save_collection = data
|
||||
|
||||
def get_saveable_data(self):
|
||||
return self.save_collection
|
||||
Reference in New Issue
Block a user