From ad0c784e223d0305ce4d7025a864a203bb82c6bb Mon Sep 17 00:00:00 2001 From: kozec Date: Sun, 24 Dec 2017 10:23:03 +0100 Subject: [PATCH] Fix: osd-styles not being installed --- {osd_styles => osd-styles}/Blue.colors.json | 0 {osd_styles => osd-styles}/Classic.gtkstyle.css | 0 {osd_styles => osd-styles}/Cyan.colors.json | 0 {osd_styles => osd-styles}/Green.colors.json | 0 {osd_styles => osd-styles}/Red.colors.json | 0 {osd_styles => osd-styles}/Reloaded.gtkstyle.css | 0 {osd_styles => osd-styles}/Yellow.colors.json | 0 scc/gui/global_settings.py | 4 ++-- scc/osd/__init__.py | 4 ++-- setup.py | 2 ++ 10 files changed, 6 insertions(+), 4 deletions(-) rename {osd_styles => osd-styles}/Blue.colors.json (100%) rename {osd_styles => osd-styles}/Classic.gtkstyle.css (100%) rename {osd_styles => osd-styles}/Cyan.colors.json (100%) rename {osd_styles => osd-styles}/Green.colors.json (100%) rename {osd_styles => osd-styles}/Red.colors.json (100%) rename {osd_styles => osd-styles}/Reloaded.gtkstyle.css (100%) rename {osd_styles => osd-styles}/Yellow.colors.json (100%) diff --git a/osd_styles/Blue.colors.json b/osd-styles/Blue.colors.json similarity index 100% rename from osd_styles/Blue.colors.json rename to osd-styles/Blue.colors.json diff --git a/osd_styles/Classic.gtkstyle.css b/osd-styles/Classic.gtkstyle.css similarity index 100% rename from osd_styles/Classic.gtkstyle.css rename to osd-styles/Classic.gtkstyle.css diff --git a/osd_styles/Cyan.colors.json b/osd-styles/Cyan.colors.json similarity index 100% rename from osd_styles/Cyan.colors.json rename to osd-styles/Cyan.colors.json diff --git a/osd_styles/Green.colors.json b/osd-styles/Green.colors.json similarity index 100% rename from osd_styles/Green.colors.json rename to osd-styles/Green.colors.json diff --git a/osd_styles/Red.colors.json b/osd-styles/Red.colors.json similarity index 100% rename from osd_styles/Red.colors.json rename to osd-styles/Red.colors.json diff --git a/osd_styles/Reloaded.gtkstyle.css b/osd-styles/Reloaded.gtkstyle.css similarity index 100% rename from osd_styles/Reloaded.gtkstyle.css rename to osd-styles/Reloaded.gtkstyle.css diff --git a/osd_styles/Yellow.colors.json b/osd-styles/Yellow.colors.json similarity index 100% rename from osd_styles/Yellow.colors.json rename to osd-styles/Yellow.colors.json diff --git a/scc/gui/global_settings.py b/scc/gui/global_settings.py index 1b21db056..4966436a0 100644 --- a/scc/gui/global_settings.py +++ b/scc/gui/global_settings.py @@ -635,7 +635,7 @@ def on_entTitle_changed(self, ent): def on_cbOSDColorPreset_changed(self, cb): theme = cb.get_model().get_value(cb.get_active_iter(), 0) if theme in (None, "None"): return - filename = os.path.join(get_share_path(), "osd_styles", theme) + filename = os.path.join(get_share_path(), "osd-styles", theme) data = json.loads(file(filename, "r").read()) # Transfer values from json to config @@ -653,7 +653,7 @@ def on_cbOSDColorPreset_changed(self, cb): def on_cbOSDStyle_changed(self, cb): color_keys = self.app.config['osk_colors'].keys() + self.app.config['osd_colors'].keys() osd_style = cb.get_model().get_value(cb.get_active_iter(), 0) - css_file = os.path.join(get_share_path(), "osd_styles", osd_style) + css_file = os.path.join(get_share_path(), "osd-styles", osd_style) first_line = file(css_file, "r").read().split("\n")[0] used_colors = None # None means "all" if "Used colors:" in first_line: diff --git a/scc/osd/__init__.py b/scc/osd/__init__.py index 0dd617695..7d5d3a42f 100644 --- a/scc/osd/__init__.py +++ b/scc/osd/__init__.py @@ -69,7 +69,7 @@ def _apply_css(config): for x in config['osd_colors'] : colors[x] = config['osd_colors'][x] colors = OSDCssMagic(colors) try: - css_file = os.path.join(get_share_path(), "osd_styles", config["osd_style"]) + css_file = os.path.join(get_share_path(), "osd-styles", config["osd_style"]) css = file(css_file, "r").read() if ((Gtk.get_major_version(), Gtk.get_minor_version()) > (3, 20)): css += OSDWindow.CSS_3_20 @@ -85,7 +85,7 @@ def _apply_css(config): log.error("Retrying with default values") OSDWindow.css_provider = Gtk.CssProvider() - css_file = os.path.join(get_share_path(), "osd_styles", "Classic.gtkstyle.css") + css_file = os.path.join(get_share_path(), "osd-styles", "Classic.gtkstyle.css") css = file(css_file, "r").read() if ((Gtk.get_major_version(), Gtk.get_minor_version()) > (3, 20)): css += OSDWindow.CSS_3_20 diff --git a/setup.py b/setup.py index 1015bebb1..256169e83 100755 --- a/setup.py +++ b/setup.py @@ -18,6 +18,8 @@ ('share/scc/default_profiles', glob.glob("default_profiles/.*.sccprofile")), ('share/scc/default_menus', glob.glob("default_menus/*.menu")), ('share/scc/default_menus', glob.glob("default_menus/.*.menu")), + ('share/scc/osd-styles', glob.glob("osd-styles/*.json")), + ('share/scc/osd-styles', glob.glob("osd-styles/*.css")), ('share/pixmaps', [ "images/sc-controller.svg" ]), ('share/mime/packages', [ "scc-mime-types.xml" ]), ('share/applications', ['scripts/sc-controller.desktop' ]),