generated from itdominator/Python-With-Gtk-Template
34 lines
685 B
Python
34 lines
685 B
Python
|
# 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
|