generated from itdominator/Python-With-Gtk-Template
Adding notebook save and loading structure
This commit is contained in:
@@ -73,6 +73,11 @@ class IPCServer:
|
||||
if file:
|
||||
event_system.emit("handle_file_from_ipc", file)
|
||||
|
||||
if "DIR|" in msg:
|
||||
file = msg.split("DIR|")[1].strip()
|
||||
if file:
|
||||
event_system.emit("handle_dir_from_ipc", file)
|
||||
|
||||
conn.close()
|
||||
break
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ class Settings(StartCheckMixin):
|
||||
self._USR_CONFIG_FILE = f"{self._USR_PATH}/settings.json"
|
||||
self._HOME_CONFIG_PATH = f"{self._USER_HOME}/.config/{app_name.lower()}"
|
||||
self._PLUGINS_PATH = f"{self._HOME_CONFIG_PATH}/plugins"
|
||||
self._NOTEBOOKS_PATH = f"{self._HOME_CONFIG_PATH}/notebooks"
|
||||
self._DEFAULT_ICONS = f"{self._HOME_CONFIG_PATH}/icons"
|
||||
self._CONFIG_FILE = f"{self._HOME_CONFIG_PATH}/settings.json"
|
||||
self._GLADE_FILE = f"{self._HOME_CONFIG_PATH}/Main_Window.glade"
|
||||
@@ -35,6 +36,8 @@ class Settings(StartCheckMixin):
|
||||
os.mkdir(self._HOME_CONFIG_PATH)
|
||||
if not os.path.exists(self._PLUGINS_PATH):
|
||||
os.mkdir(self._PLUGINS_PATH)
|
||||
if not os.path.exists(self._NOTEBOOKS_PATH):
|
||||
os.mkdir(self._NOTEBOOKS_PATH)
|
||||
|
||||
if not os.path.exists(self._CONFIG_FILE):
|
||||
import shutil
|
||||
@@ -69,15 +72,16 @@ class Settings(StartCheckMixin):
|
||||
bindings = json.load(file)["keybindings"]
|
||||
keybindings.configure(bindings)
|
||||
|
||||
self._main_window = None
|
||||
self._main_window_w = 800
|
||||
self._main_window_h = 600
|
||||
self._builder = None
|
||||
self.PAINT_BG_COLOR = (0, 0, 0, 0.54)
|
||||
self._main_window = None
|
||||
self._main_window_w = 800
|
||||
self._main_window_h = 600
|
||||
self._builder = None
|
||||
self.PAINT_BG_COLOR = (0, 0, 0, 0.54)
|
||||
|
||||
self._trace_debug = False
|
||||
self._debug = False
|
||||
self._dirty_start = False
|
||||
self._trace_debug = False
|
||||
self._debug = False
|
||||
self._dirty_start = False
|
||||
self._active_notebook = None
|
||||
|
||||
self.load_settings()
|
||||
|
||||
@@ -97,7 +101,8 @@ class Settings(StartCheckMixin):
|
||||
|
||||
def set_main_window(self, window): self._main_window = window
|
||||
def set_builder(self, builder) -> any: self._builder = builder
|
||||
|
||||
def set_active_notebook(self, path: str): self._active_notebook = path
|
||||
def get_active_notebook(self) -> str: return self._active_notebook
|
||||
|
||||
def get_monitor_data(self) -> list:
|
||||
screen = self._main_window.get_screen()
|
||||
@@ -121,6 +126,7 @@ class Settings(StartCheckMixin):
|
||||
def get_home_config_path(self) -> str: return self._HOME_CONFIG_PATH
|
||||
def get_window_icon(self) -> str: return self._WINDOW_ICON
|
||||
def get_home_path(self) -> str: return self._USER_HOME
|
||||
def get_notebooks_path(self) -> str: return self._NOTEBOOKS_PATH
|
||||
|
||||
# Filter returns
|
||||
def get_office_filter(self) -> tuple: return tuple(self._settings["filters"]["office"])
|
||||
|
||||
Reference in New Issue
Block a user