pygui: fixed issue saving selected background to xml when not located within the ~/.coregui/backgrounds directory
This commit is contained in:
parent
4bcaa32fdb
commit
082677c17b
1 changed files with 8 additions and 4 deletions
|
@ -22,7 +22,7 @@ from core.api.grpc import (
|
||||||
wlan_pb2,
|
wlan_pb2,
|
||||||
)
|
)
|
||||||
from core.gui import appconfig
|
from core.gui import appconfig
|
||||||
from core.gui.appconfig import XMLS_PATH, CoreServer, Observer
|
from core.gui.appconfig import BACKGROUNDS_PATH, XMLS_PATH, CoreServer, Observer
|
||||||
from core.gui.dialogs.emaneinstall import EmaneInstallDialog
|
from core.gui.dialogs.emaneinstall import EmaneInstallDialog
|
||||||
from core.gui.dialogs.error import ErrorDialog
|
from core.gui.dialogs.error import ErrorDialog
|
||||||
from core.gui.dialogs.mobilityplayer import MobilityPlayer
|
from core.gui.dialogs.mobilityplayer import MobilityPlayer
|
||||||
|
@ -546,11 +546,15 @@ class CoreClient:
|
||||||
|
|
||||||
def set_metadata(self) -> None:
|
def set_metadata(self) -> None:
|
||||||
# create canvas data
|
# create canvas data
|
||||||
wallpaper = None
|
wallpaper_path = None
|
||||||
if self.app.canvas.wallpaper_file:
|
if self.app.canvas.wallpaper_file:
|
||||||
wallpaper = Path(self.app.canvas.wallpaper_file).name
|
wallpaper = Path(self.app.canvas.wallpaper_file)
|
||||||
|
if BACKGROUNDS_PATH == wallpaper.parent:
|
||||||
|
wallpaper_path = wallpaper.name
|
||||||
|
else:
|
||||||
|
wallpaper_path = str(wallpaper)
|
||||||
canvas_config = {
|
canvas_config = {
|
||||||
"wallpaper": wallpaper,
|
"wallpaper": wallpaper_path,
|
||||||
"wallpaper-style": self.app.canvas.scale_option.get(),
|
"wallpaper-style": self.app.canvas.scale_option.get(),
|
||||||
"gridlines": self.app.canvas.show_grid.get(),
|
"gridlines": self.app.canvas.show_grid.get(),
|
||||||
"fit_image": self.app.canvas.adjust_to_dim.get(),
|
"fit_image": self.app.canvas.adjust_to_dim.get(),
|
||||||
|
|
Loading…
Add table
Reference in a new issue